LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Monitor Resolution Dynamically?

Is there a method in CVI to dynamically save and change the monitor resolution under program control? I have a touch panel CVI application that runs under WindowsXP. I would like to change the monitor resoultion to 640x480 on program startup, and then restore the monitor resolution back to the user's settings on exit. Can this be done? Using the Win32 SDK? CVI?

Doug Wendelboe
Noninvasive Medical Technologies LLC
Las Vegas, NV 89123
0 Kudos
Message 1 of 2
(3,924 Views)
You will need the Windows SDK installed. There is a function called ChangeDisplaySettings in the Win SDK that will do this. You can get a DEVMODE enum for the current display setting with EnumDisplaySettings and make changes to it. The code would look something like this:


DEVMODE DevMode;


EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &DevMode);
DevMode.dmPelsWidth = 1024;
DevMode.dmPelsHeight = 768;

ChangeDisplaySettings(&DevMode, 0);


Best Regards,

Chris Matthews
National Instruments
Message 2 of 2
(3,921 Views)