#81713 - 2003-07-10 05:39 PM
New GetConsoleState() function
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Request for thoughts ...
Was following this thread with much interest. And since one can get mildy annoyed when one loose's the console window (when SetConsole("HIDE") is used), would like to suggest the following new function. The state can then be saved and (if required) restored later.
$State = GetConsoleState()
Where $State is:
0 Console is HIDDEN 1 Console is SHOWN 2 Console is MINIMIZED 3 Console is MAXIMIZED
Maybe need another value meaning "N/A" when running wkix32 ? Thought about asking for return codes from SetConsole() (ie, previous state) but that would probably break too many existing scripts. [ 10. July 2003, 17:40: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#81715 - 2003-07-10 06:06 PM
Re: New GetConsoleState() function
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
It does make sense to return this from SetConsole(), that would be the perfect solution, but (I) can't see how to do that without breaking existing scripts ...
|
|
Top
|
|
|
|
#81722 - 2003-07-10 08:03 PM
Re: New GetConsoleState() function
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Well, I know I may be ranting about this a little bit. Just thinking that there must be a better way to handle this SetConsole("HIDE") thingy.
Most folk just slap that statement in their scripts, without giving much thought to us old farts that like to run things from the command line . What I usually do, when a see a script with a HIDE in it, is to manually go in and comment it out ... would be nice (in theory) if one didn't have to do that.
Having said that, maybe this suggestion for a new function and/or in combination with a best pratice could be devised for scripts that use the HIDE feature. Maybe just as simple as suggesting that the SetConsole("SHOW") be performed before exiting ... just not sure if thats advisible given the (potentially) unknown state of the console ... [ 10. July 2003, 20:06: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#81723 - 2003-07-10 08:12 PM
Re: New GetConsoleState() function
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
perhaps @ColsoleState would be the way to go...
0= kix32 'hidden' and wkix 1= minimized 2= shown 3= max 4= always on top etc...
which would return the current state of the console... Ruud has to have a handle on it as he sets an errorcode for setconsole.
|
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 302 anonymous users online.
|
|
|