Think very carefully about the implications of this action before proceeding!
I you really need to upset your users and risk legal action them there are plenty of ready made projects out there to change screen resolution, for example:
HOWEVER:
1. Most computer users will be very upset if you mess with their hardware settings
2. Be prepared for the lawsuits which follow when your program damages monitors. There are many monitors in use that will be physically damaged if driven at screen resolutions beyond their capabilities.
Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting
The url you have given claims it does not change setting(hardware or registry). We do not wish to drive monitors at capabilities outside there range. For example we want to set the resolutions to the most standard setting (e.g. 1024x768). Virtually all monitors support this resolution.
Do you have any bad experience specially using the code given in this url? Kindly advice.
Yes I have seen physical damage. Out there in the real world there are still a large number of 800 x 600 displays, and quite a few 640 x 480. If your application is going to the open market you will need to ensure that you don't try to drive the older displays at 1024 x 768.
The program obviously can't make hardware changes, but does change software video card settings.
If you must do this, then at least ensure that you are only changing down, not up. Changing a 1600 x 1200 screen to 1024 x 768 won't do physical damage (it will only annoy the user), but changing 640 x 480 to 1024 x 768 may well physically damage the monitor.
To check current settings you can use GetSystemMetrics API. There is a worked example at:
Thanks John for the advice and alert. It is very much appreciated. Shall visit the link given in your response and review the whole subject of screen resolution changes.