Posted: 10th Jun 2003 1:14
This has almost been seen before but i've added support for 16 and 32 bit colour depths:

+ Code Snippet
   load dll "user32.dll",1 
      x=call dll(1,"GetSystemMetrics",0) 
      y=call dll(1,"GetSystemMetrics",1) 
      c=call dll(1,"GetSysColor",0) 
      if c=13160664 then c=16 
      if c=13160660 then c=32 
   delete dll 1 

   set display mode x,y,c 
Posted: 10th Jun 2003 2:58
I don't mean to be critical, but your colour check *only* works if you are using certain windows styles.

You need a little more to get the depth under all circumstances - but not a lot more.

+ Code Snippet
hdc as dword

load dll "user32.dll",1
load dll "gdi32.dll", 2

x=call dll(1,"GetSystemMetrics",0)
y=call dll(1,"GetSystemMetrics",1)

` Get the device context for the entire display
hdc=call dll(1, "GetDC", 0)

` Get the 'bits per pixel' setting
c=call dll(2, "GetDeviceCaps", hdc, 12)

` Release the device context
call dll 1, "ReleaseDC", 0, hdc

print x
print y
print c

delete dll 1
delete dll 2
wait key
Posted: 10th Jun 2003 13:45
Thankyou for the correction Ian, my first foray into learning about Windows .dll commands - and I get it wrong, unsuprisingly.
Posted: 10th Jun 2003 14:50
MS don't make it easy - that's why people get paid for coding under Windows