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.
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