Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

changing windows screen resolution when running .exe 1

Status
Not open for further replies.

ahaws

Programmer
Nov 28, 2001
355
US
hi all -
Would like to know if it is possible to change the user's windows screen resolution when they run my .exe.

The reason is that some of the users must have their resolution set at 640 * 480 to run other applications smoothly...thus had to develop a 640 * 480 program...else they would not be able to see all the forms and buttons.

However, in another department, they have their machines set at 800 * 600 and some are even 1024 * 780! so my .exe looks very small in the left corner of their screen.

So was looking into a way to change the 800 *600 and 1024 * 780 to 640 * 480 and change back upon exit of the program.

Is this possible?
Thanks
Angie
 
Angie,

Sorry I can't answer your question.

However, I would suggest that you think carefully before doing this.

The reason different users have different screen resolutions is because of personal preference. Some users don't have good eyesight (I know ... I'm one of them); some like to have lots of windows sprayed out on the screen; others like to concentrate on one window at a time.

The point is that we, as deveolopers, should respect these choices. We certainly shouldn't override them. If you app doesn't look right at a given resolution, you should allow the user to alter the size of your app. That might mean writing code to resize and zoom forms dynamically, which is perfectly possible.

Well, that's my EUR 0.02 worth. No doubt others will have different views.

Mike


Mike Lewis
Edinburgh, Scotland
 
Hi Mike -
You are absolutely right when you say that we should respect the user's preferences, however, since I am programming for an environment where the users really don't have a choice of desktop personalization - I would like to find out if this is possible.
Who I work for decided this - since some user's have changed some things that totally screwed the station up (one being background color - grey on grey - they didnt see a thing - that took a while to figure out what the heck was going on)
So - it would only be for this app that I would like to change for.
thanks for your input though-
Angie
 
Hi Angie,

If some of your users still have 640x480 resolution, I suggest you go with the development in 640x480 only.

However, for those having higher resolution, the Windows can be made to enlarge to the maximum window size. Now the question is how to proportinaly set the fonts and reposition them.

For this I use a freeware class called stretch with some code modification. This will resize all controls in a form proportionately as the forms are resized. I call this function after instatiation the form and then resizing it to maximum screen size. This also helps, if the user resizes the form for some reason to open out another form and want to retain this in some portion of screen.

:)



ramani :)
(Subramanian.G)
 
Hi Angie,

Yes it is possible. Look at thread184-603429 for the code.

Btw, I agree with Mike. So use it carefully :)

Regards


-- AirCon --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top