Jump to content
Sign in to follow this  
gempie

WindowSetstate

Recommended Posts

gempie

Hi,

in my script i use

[/code]
WinSetState("ChipSoft EZIS / EZIS 4.9 Productie-omgeving","", @SW_Maximize)
[code]

to max a window. But i can't get the window to return to normal once my script is done.

i tried @SW_SHOWNORMAL and @SW_SHOWDEFAULT but neither works.

if i do wingetstate when the window still isn't messed with it gives me the value 37. after i @maximized it it gives me 39 but i don't know how to get it back to 37. The helpfile says: "Multiple values are added together so use BitAND() to examine the part you are interested in" but i don't know how to use it to get an @SW_ state out of that.

TY

Share this post


Link to post
Share on other sites
Monamo

WinSetState("ChipSoft EZIS / EZIS 4.9 Productie-omgeving","", @SW_Maximize)

to max a window. But i can't get the window to return to normal once my script is done.

i tried @SW_SHOWNORMAL and @SW_SHOWDEFAULT but neither works.

Use @SW_RESTORE to return to the "pre-maximized" window size.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites
gempie

Use @SW_RESTORE to return to the "pre-maximized" window size.

Hey, thnx for the response but this doesn't seem to work. (problem is i can't minimize the windows anymore) The wingetstate now gives me 7 instead of 39. If i start the app at first it gives me 37 if then i only do @sw_restore and nothing else it goes to 7. Any idea's?

Edited by gempie

Share this post


Link to post
Share on other sites
Monamo

Hey, thnx for the response but this doesn't seem to work. (problem is i can't minimize the windows anymore) The wingetstate now gives me 7 instead of 39. If i start the app at first it gives me 37 if then i only do @sw_restore and nothing else it goes to 7. Any idea's?

If WinGetState() returns 37, it suggests that the window is "maximized" already:37 = 32(maximized) + 4 (enabled) + 1 (exists)

If you're just trying to return the window to the original size and position, AND @SW_RESTORE didn't work as you needed, a quick and dirty way to handle it would be:

$aOrigWinSize = WinGetPos("My Program")

WinSetState("My Program","",@SW_MAXIMIZE)
;Do your groove thing

;now you're done...
WinSetState("My Program","",@SW_RESTORE)
WinMove("My Program","",$aOrigWinSize[0],$aOrigWinSize[1],$aOrigWinSize[2],$aOrigWinSize[3])
Edited by Monamo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Share this post


Link to post
Share on other sites
gempie

If WinGetState() returns 37, it suggests that the window is "maximized" already:37 = 32(maximized) + 4 (enabled) + 1 (exists)

If you're just trying to return the window to the original size and position, AND @SW_RESTORE didn't work as you needed, a quick and dirty way to handle it would be:

$aOrigWinSize = WinGetPos("My Program")

WinSetState("My Program","",@SW_MAXIMIZE)
;Do your groove thing

;now you're done...
WinSetState("My Program","",@SW_RESTORE)
WinMove("My Program","",$aOrigWinSize[0],$aOrigWinSize[1],$aOrigWinSize[2],$aOrigWinSize[3])
thnx for your help, but my problem still remains: after i do a maximize the minimize button on the program doesn't work anymore even if i try all of the above suggestions. Any idea?

Share this post


Link to post
Share on other sites
PsaltyDS

thnx for your help, but my problem still remains: after i do a maximize the minimize button on the program doesn't work anymore even if i try all of the above suggestions. Any idea?

Perhaps @SW_SHOWNORMAL?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×