GLBasic forum

Codesnippets => Inline / 3rd party => Topic started by: Kitty Hello on 2008-Apr-14

Title: Get Desktop Resolution
Post by: Kitty Hello on 2008-Apr-14
Code (glbasic) Select
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