Codesnippets > Inline / 3rd party

Get Desktop Resolution

(1/1)

Kitty Hello:

--- Code: (glbasic) --- GetDesktopResolution(sx, sy)

PRINT "Desktop: "+sx+", "+sy, 0,0
SHOWSCREEN
MOUSEWAIT


FUNCTION end_main:
ENDFUNCTION

INLINE
}
#ifdef WIN32
#define SM_CXSCREEN 0
#define SM_CYSCREEN 1
extern "C" __stdcall int GetSystemMetrics(int);
#endif
namespace __GLBASIC__{
ENDINLINE


FUNCTION GetDesktopResolution: BYREF sx, BYREF sy
INLINE
#ifdef WIN32
sx = ::GetSystemMetrics(SM_CXSCREEN);
sy = ::GetSystemMetrics(SM_CYSCREEN);
#endif
ENDINLINE
ENDFUNCTION
--- End code ---

Navigation

[0] Message Index

Go to full version