Jammer Posted February 21, 2005 Share Posted February 21, 2005 (edited) anyone got an idea how to make the ShowHide work? It simply shows and hides again.. thats because the second cheking loops is after the first... Lost in my code... dunno how to force it work... i should need somekinda ExitFunc command... or something... or somehow to force the function to work as i want..... The result should be when I press pause it should hide and when i press it againt it should show... press again - hide ,press again - show and so on... And it should depend on $s var.... (because if it crashed it should get the last status that user set'ed and do actions by that status ($s = 0 - hide , $s = 1 - show) expandcollapse popup;Seting Var's $s = 1 ;Hide? $answer = MsgBox(4, "Hide window?", "Do you want to hide emulator window?") If $answer = 7 Then $s = 0 EndIf ;Options Opt("WinTitleMatchMode", 2) ;Hotkeys HotKeySet("{ESC}", "Terminate") HotKeySet("{PAUSE}", "ShowHide") ;Script If Not ProcessExists("wowemu.exe") Then Run("wowemu.exe") EndIf sleep(50) $title = WinGetTitle("wowemu.exe", "") WinSetTitle($title, "", "World Of Warcraft Emulator by WAD + Jammer anticrash system") if $s = 1 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE) if $s = 0 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW) While 1 ProcessWaitClose("wowemu.exe") Run("wowemu.exe") sleep(50) $title = WinGetTitle("wowemu.exe", "") WinSetTitle($title, "", "World Of Warcraft Emulator by WAD + Jammer anticrash system") if $s = 1 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE) if $s = 0 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW) WEnd ;Functions Func Terminate() Exit 0 EndFunc Func ShowHide() if $s = 1 Then $s = 0 WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW) EndIF if $s = 0 Then $s = 1 WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE) EndIF EndFunc Edited February 21, 2005 by Jammer Link to comment Share on other sites More sharing options...
ZeDMIN Posted February 21, 2005 Share Posted February 21, 2005 I would make it even shorter: Func ShowHide() If $s = 1 Then WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_SHOW) Else WinSetState("World Of Warcraft Emulator by WAD + Jammer anticrash system", "", @SW_HIDE) EndIf $s = Not $s EndFunc I guess there is no other value than 0 or 1 for $s, so the $s = Not $s should do it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now