Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get windows desktop dimensions
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00781479
Message ID:
00781510
Views:
14
Certainly Sergey's choice is better -- use SYSMETRIC with no trouble.

If you still want to use the GetWindowRect:
DECLARE INTEGER GetDesktopWindow IN user32
DECLARE SHORT GetWindowRect IN user32;
	INTEGER hwnd, STRING @lpRect
LOCAL hDesktop, cRect
hDesktop = GetDesktopWindow()
cRect = Repli(Chr(0), 16)
= GetWindowRect(hDesktop, @cRect)
? dword2num(SUBSTR(cRect, 1,4))
? dword2num(SUBSTR(cRect, 5,4))
? dword2num(SUBSTR(cRect, 9,4))
? dword2num(SUBSTR(cRect, 13,4))

FUNCTION dword2num(lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
	BitLShift(Asc(SUBSTR(lcBuffer, 2,1)),  8) +;
	BitLShift(Asc(SUBSTR(lcBuffer, 3,1)), 16) +;
	BitLShift(Asc(SUBSTR(lcBuffer, 4,1)), 24)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform