Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to get the size of the frontmost window on Windows?

Answer: Try this code:

Make yourself a class for the WindowRect with four properties:

Bottom as Integer
Left as Integer
Right as Integer
Top as Integer

Add the following method to your class:

Sub GetWindowRect(windowhandle as Integer)
dim err as Integer
dim mem as memoryBlock
#if targetwin32 then
Declare Function GetWindowRect Lib "user32.dll" (hwnd as Integer, ipRect As Ptr) as Integer

mem = newmemoryBlock(16)
err = GetWindowRect(windowhandle, mem)
Left = mem.long(0)
Top = mem.Long(4)
Right = mem.Long(8)
Bottom = mem.Long(12)
#endif
End Sub

Good to use for the MDI Master Window!


The biggest plugin in space...