global desktop_width
global desktop_height
global desktop_depth
get_desktop_size()
print "W = ";desktop_width
print "H = ";desktop_height
print "D = ";desktop_depth
wait key
end
function get_desktop_size()
SM_CXSCREEN = 0
SM_CYSCREEN = 1
BITSPIXEL = 12
hdc as dword
dll_1=free_dll()
load dll "user32.dll",dll_1
dll_2=free_dll()
load dll "gdi32.dll",dll_2
desktop_width=call dll(dll_1,"GetSystemMetrics",SM_CXSCREEN)
desktop_height=call dll(dll_1,"GetSystemMetrics",SM_CYSCREEN)
hdc=call dll(dll_1, "GetDC", 0)
desktop_depth=call dll(dll_2, "GetDeviceCaps", hdc, BITSPIXEL)
call dll dll_1, "ReleaseDC", 0, hdc
delete dll dll_2
delete dll dll_1
endfunction
function free_dll()
repeat
inc n
until dll exist(n)=0
endfunction n
Posted by spooky in
http://forum.thegamecreators.com/?m=forum_view&t=89117&b=1
By way of demonstration, he emitted a batlike squeak that was indeed bothersome.