Hello Me You Posted February 22, 2007 Share Posted February 22, 2007 (edited) Can I make this script shorter? expandcollapse popup; =================================================================== HotKeySet("^!h", "_hide") HotKeySet("^!u", "_unhide") HotKeySet("^!#x", "_exit") ; =================================================================== TraySetToolTip("Window Hider") ; =================================================================== $msgbox = "" ; Especially Here ; Especially Here Do ; Especially Here MsgBox(0, "Info", "info") ; Especially Here $msgbox = "ok" ; Especially Here Until $msgbox = "ok" ; Especially Here ; =================================================================== While 1 WEnd ; =================================================================== Func _hide() $in_hide = InputBox("Hide Window", "Enter window title:") If @error Then Return WinSetState($in_hide, "", @SW_HIDE) EndFunc Func _unhide() $in_unhide = InputBox("Unhide Window", "Enter window title:") WinSetState($in_unhide, "", @SW_SHOW) EndFunc ; =================================================================== Func _exit() $msg = MsgBox(1, "Exit Script", "Are you sure?") If $msg = 1 Then Exit EndIf EndFunc ; =================================================================== Thank You Edited February 22, 2007 by Hello Me You Random Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 22, 2007 Moderators Share Posted February 22, 2007 HotKeySet("^!h", "_hide") HotKeySet("^!u", "_unhide") HotKeySet("^!#x", "_exit") TraySetToolTip("Window Hider") MsgBox(0, 'Info', 'info');There's only one button, it's always going to = 1 ("ok") While 1 Sleep(10);Have to add this line, or risk hurting yoru CPU WEnd Func _hide() WinSetState(InputBox("Hide Window", "Enter window title:"), "", @SW_HIDE) EndFunc Func _unhide() WinSetState(InputBox("Unhide Window", "Enter window title:"), "", @SW_SHOW) EndFunc Func _exit() If MsgBox(4, "Exit Script", "Are you sure?") = 6 Then Exit EndFuncI am not commenting on your method or if it's sound, only showing how you can merge functions. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Hello Me You Posted February 22, 2007 Author Share Posted February 22, 2007 I am not commenting on your method or if it's sound, only showing how you can merge functions.I don't know any other way to do it. Random Link to comment Share on other sites More sharing options...
Shevilie Posted February 22, 2007 Share Posted February 22, 2007 Hint - Parameters Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit 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