Solved

Code to change windows 7 screen resolution in windows application

Posted on 2013-06-25
3
495 Views
Last Modified: 2013-06-28
Can someone provide vb.net code or a method of changing the windows 7 screen resolution in a windows application?

Thanks!
0
Comment
Question by:dave_sky
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Joe Winograd, EE MVE earned 500 total points
ID: 39276967
Hi Dave,
I'm a huge fan of NirSoft's (free!) utilities, which I've been using for many years:
http://www.nirsoft.net/

One of them is NirCmd:
http://www.nirsoft.net/utils/nircmd.html

Scroll down to the bottom for the download links. Note that there are separate ones for 32-bit and 64-bit.

There are so many things you can do with this...I suggest reading through all of it...I think you'll be impressed...I certainly am. Anyway, one of the options is "setdisplay". The syntax, description, and examples from the Help file are below. Regards, Joe

setdisplay {monitor:index/name} [width] [height] [color bits] {refresh rate} {-updatereg} {-allusers}

Changes your display settings. The [width] and [height] parameters represents the number of pixels on your screen. The [color bits] parameter represents the number of colors shown on your screen (8 - 256 color, 16 - 16bit color, 24 - 24bit color, and so on). {refresh rate} is an optional parameter that specifies the monitor refresh rate. If you specify the {-updatereg} parameter, the new settings will be saved in the Registry. If you specify both {-updatereg} and {-allusers} parameters, the new settings will be saved in the Registry for all users.

If you have multiple monitors, you can use the optional monitor parameter, which specifies for which monitor you want to change the display settings. You can specify the monitor by index (0 for the first monitor, 1 for the second one, and so on) or by specifying a string in the system monitor name. The monitor name can be found in the Device manager of Windows: Right click on the monitor item, and then choose 'Properties'. The string displayed in the 'location' field is the monitor name.

Example:

setdisplay 800 600 24 -updatereg
setdisplay 1024 768 24 90
setdisplay 1024 768 8
setdisplay monitor:1 1024 768 24 90
setdisplay monitor:name1 1024 768 24 90
0
 

Author Closing Comment

by:dave_sky
ID: 39285877
Thanks a lot!
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 39285896
You're very welcome!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Old Xray equipment running on Win XP so can't upgrade to the latest Eaglesoft 10 58
REXEX help Part 2 2 25
Driver Error when Starting Win 7 Setup 28 51
USB 2 Driver 7 29
One of the features I've come to appreciate about Windows 7 and Windows Server 2008 R2 is the ability to pin applications to the task bar. As useful a feature as I've found this, it does have some quirks.  For example, have you ever tried pinning an…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question