Solved

Code to change windows 7 screen resolution in windows application

Posted on 2013-06-25
3
482 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 51

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 51

Expert Comment

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
OfficeMate Freezes on login or does not load after login credentials are input.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now