Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Screen Resolution

Status
Not open for further replies.

hojo

Computer
Oct 9, 2002
18
Hi All,

I was wondering if there is a way to change a PC's Resolution when it starts my VB program. (and possibly back again once its finished)

I am wanting to do this because I have created a program that works best on one resolution and it may be used on a variety of computers. To save people having to change their resolution everytime they run my program it would be easier if the program changed it for them.

Any help appreciated.

Cheers

Hojo
 
Replies continue below

Recommended for you

Yes it's easy to do! BUT be very sure that you really want to do it. There are still many PCs out there that support very limited choice of resolutions, and if you try and force them you may do physical damage to the monitor.

There is also the matter of common courtesy - if you try and change my computer hardware settings, I would get very upset, and I'm sure many others would as well!

If you're really sure then you'll need to use the ChangeDisplaySettingsEx API. There is a worked example here:

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting

UK steam enthusiasts:
 
Good answer johnwm.

Please allow me to reinforce the warning.

==> you try and change my computer hardware settings, I would get very upset, and I'm sure many others would as well!
Me too. Proceed with extreme caution.

You also run the risk of 'breaking' another application already running at the time.



Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top