Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

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:
Notes:
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!

Feedback, Comments & Corrections




Links
MBS Xojo tutorial videos