will88 Posted June 25, 2008 Share Posted June 25, 2008 (edited) HotkeySet("{F1}", "Start") HotkeySet("{F2}", "Stop") HotkeySet("{F3}", "Hide") HotkeySet("{F4}", "Show") Global $Loop = 1 While 1 If $Loop = 1 Then sleep(random(500, 1000)) If $Loop = 1 Then Sleep(1000) Else ExitLoop EndIf EndIF WEnd Func Start() $Loop = 1 EndFunc Func Stop() $Loop = 0 EndFunc Func Show() If Not Winactive( "Untitled - Notepad" )Then WinSetState( "Untitled - Notepad", "", @SW_Show ) EndIf EndFunc Func Hide() If WinActive( "Untitled - Notepad" ) Then WinSetState( "Untitled - Notepad", "", @SW_Hide ) EndIf EndFunc When I press f3 to minimize Untitled - Notepad it dissapeers like It should. When I press f4 to bring it up again it doesent work. Edited June 25, 2008 by will88 Password-Keeper Link to comment Share on other sites More sharing options...
smashly Posted June 25, 2008 Share Posted June 25, 2008 (edited) Hi, slightly modified your codeHotkeySet("{ESC}", "Quit") HotkeySet("{F3}", "Hide") HotkeySet("{F4}", "Show") Global $hWnd = WinGetHandle("Untitled - Notepad") While 1 Sleep(100) WEnd Func Quit() Show() Exit EndFunc Func Show() If WinExists($hWnd) And Not BitAnd(WinGetState($hWnd), 2) Then WinSetState($hWnd, "", @SW_SHOW) EndFunc Func Hide() If WinExists($hWnd) And BitAnd(WinGetState($hWnd), 2) Then WinSetState($hWnd, "", @SW_HIDE) EndFunc Cheers Edited June 25, 2008 by smashly Link to comment Share on other sites More sharing options...
will88 Posted June 25, 2008 Author Share Posted June 25, 2008 Hi, slightly modified your codeHotkeySet("{ESC}", "Quit") HotkeySet("{F3}", "Hide") HotkeySet("{F4}", "Show") Global $hWnd = WinGetHandle("Untitled - Notepad") While 1 Sleep(100) WEnd Func Quit() Show() Exit EndFunc Func Show() If WinExists($hWnd) And Not BitAnd(WinGetState($hWnd), 2) Then WinSetState($hWnd, "", @SW_SHOW) EndFunc Func Hide() If WinExists($hWnd) And BitAnd(WinGetState($hWnd), 2) Then WinSetState($hWnd, "", @SW_HIDE) EndFunc Cheers Ty! Password-Keeper 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