Changing Screen Resolution Programmatically From LabVIEW

Publish Date: Sep 06, 2006 | 1 Ratings | 5.00 out of 5 | Print | 2 Customer Reviews | Submit your review
This VI calls a Visual Basic DLL in order to change the screen resolution. The DLL makes calls to the Windows API functions: "EnumDisplaySettings" and "ChangeDisplaySettings".

Before running the VI, you will have to extract the resolution.dll into a directory and register it. To register the dll, you can use regsvr32.exe as follows:

- Go to Start » Run.

- Type the following in the dialog box that appears:

regsvr32 "Full path of .dll file"

Where "Full path of .dll file" is the location of the extracted resolution.dll file.

Once the dll has been registered, run the resolution.vi. To set different resolutions, change the Resolution control in the resolution.vi. By default, it is set to 1024x768.

The "dmDisplayFrequency" parameter of the "ChangeDisplaySettings" function is not configured in the resolution.dll, so this example will reset the Screen Refresh Rate to default (60Hz). To change it manually back to the desired rate, go to
Control Panel >> Display >> Settings >> Advanced >> Monitor.
You can also change the rate programmatically by modifying the resolution.cls code.

Visual Basic source code is included for your information.

Back to Top

Customer Reviews
2 Reviews | Submit your review

Problem with HDMI connection  - Jun 17, 2012

for this program is this just using for VGA cable connection only ? I try use this example with 2 computer which using HDMI cable and my application stop running on those 2 PC. May i ask that is this whether function in all monitor connection ?

Its simply superb...  - Jun 18, 2010

Bookmark & Share


Downloads

Attachments:

resolution.vi

Requirements


Ratings

Rate this document

Answered Your Question?
Yes No

Submit