Page 1 of 1

[Implemented] Idea for ScreenLib

Posted: Thu Dec 06, 2001 12:42 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Add Features and Description:

ScreenWidth()
Returns the width of desktop screen

ScreenHeight()
Returns the height of desktop screen

ScreenModeExist(#width,height,#depth)
Returns true or false... Check if GfxCard support the mode :wink:

greetz

MrVainSCL!

Posted: Thu Dec 06, 2001 3:21 pm
by BackupUser
Restored from previous forum. Originally posted by wavemaker.

You can use the API for the first two:

ScreenWidth()
Returns the width of desktop screen

Code: Select all

GetSystemMetrics_(#SM_CXSCREEN);
ScreenHeight()
Returns the height of desktop screen

Code: Select all

GetSystemMetrics_(#SM_CYSCREEN);
ScreenModeExist(#width,#height,#depth)
Returns true or false... Check if GfxCard support the mode :wink:

You can use the ChangeDisplaySettings_ API function for this, but I don't know exactly how it works, but try this:

Code: Select all

lpDevMode.LPDEVMODE
lpDevMode\dmPelsWidth = #width
lpDevMode\dmPelsHeight = #height
lpDevMode\dmBitsPerPel = #depth
lpDevMode\dmFields = #DM_PELSWIDTH|#DM_PELSHEIGHT|#DM_BITSPERPEL
If ChangeDisplaySettings_(@lpDevMode,#CDS_TEST)  #DISP_CHANGE_BADMODE
  ; supported
Else
  ; not supported
Endif
You can also use EnumDisplaySettings_ to know which modes are actually available in the system.

Bye,


Edited by - wavemaker on 06 December 2001 15:29:43

Edited by - wavemaker on 06 December 2001 15:34:44

Edited by - wavemaker on 06 December 2001 15:35:49