Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default API

ChangeDisplaySettings can be really useful in a controlled environment.

However, if you really must offer this on other people's systems, can I
please make a couple of suggestions.

Remember, this is a fundamental change to the computer's settings

At the very least, check the return value of ChangeDisplaySettings

Const DISP_CHANGE_SUCCESSFUL As Long = 0
Const DISP_CHANGE_RESTART As Long = 1

If it returns 0, the machine thinks it has succeeded
If it returns 1, you have made a change the user won't see till next
time (s)he reboots. That can be really nasty.

Any other return value probably means failure of some sort.

Const DISP_CHANGE_FAILED As Long = -1
Const DISP_CHANGE_BADMODE As Long = -2
Const DISP_CHANGE_NOTUPDATED As Long = -3
Const DISP_CHANGE_BADFLAGS As Long = -4
Const DISP_CHANGE_BADPARAM As Long = -5

I recommend after a successful change you ask the user to confirm all is
OK (do not use a msgBox or modal form) and, if not, reset the resolution
after say 45 seconds.

And, of course, whatever else you do, aways reset to the original
settings before finishing.
These settings may well be neither 1280x768 nor 800x600

Having said all that, I still think you'd be much better to offer
alternate versions of you forms to the user instead of messing with
things of which the users may not understand the significance.

DennisE wrote:

Harald,

I'd never in a million years mess with
anyone's laptop in an arbitrary fashion.
The decision to switch from 1280X768
to 800X600 (or the reverse) will be left entirely in the hands of users who
might wish to see userforms larger or smaller (perhaps even selectively so as
they move through the program) without having to leave Excel to adjust their
desktop parameters.

-- Dennis Eisen




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"