James Posted November 26, 2006 Posted November 26, 2006 Hey, Im making a desktop ball, and with some GUI. I have it running the program, and nearly closing it, but I also need it to hide the GUI box. I have the hider script working, but not with the GUI. Any help? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
BigDod Posted November 26, 2006 Posted November 26, 2006 Hey, Im making a desktop ball, and with some GUI.I have it running the program, and nearly closing it, but I also need it to hide the GUI box. I have the hider script working, but not with the GUI.Any help?Show us your script and someone will help. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
James Posted November 26, 2006 Author Posted November 26, 2006 Yeah Ok, I was just going to do that. While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $start sleep(3000) Run('E:\Programs\ballbasic.exe') ; Run Desktop Ball MsgBox(0, 'Running', 'Desktop has started') ; Tell user ball started Case $msg = $stop MsgBox(0, 'Stop', 'Pressing this will end the ball game - stop function not working yet') ; Stop Ball Case $msg = $hide If $hidden = "yes" Then Sleep (10) Else Global $title = WinGetTitle("") Sleep (10) EndIf EndSelect Wend Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Xenobiologist Posted November 26, 2006 Posted November 26, 2006 Hi, not sure, but maybe this helps GUISetState(@SW_HIDE) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
James Posted November 26, 2006 Author Posted November 26, 2006 Where do I put this? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
/dev/null Posted November 26, 2006 Posted November 26, 2006 Where do I put this?where it makes sense... meaning where you want to hide the GUI...CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
James Posted November 26, 2006 Author Posted November 26, 2006 Hmm, I cant seem to make it work. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Xenobiologist Posted November 26, 2006 Posted November 26, 2006 Hi, post the complete script or replace this line GUISetState () by the one mentioned and you'll not see the GUI So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
James Posted November 26, 2006 Author Posted November 26, 2006 Thanks th.meger its now working. But as it hides the window and runs it like a service, how do I make it show the window again? Hotkeys: HotKeySet ("^+w", "Show") ; Key to show Opt("TrayIconHide", 1) ; Hide icon from tray $hidden = "no" ; Set name for keys oÝ÷ Ø[§rبƮ¶s`¤gVæ2FR b33c¶FFVâÒgV÷C·W2gV÷C° bväW7G2gV÷C²gV÷C²fײb33c·FFÆRFVà vå6WE7FFRgV÷C²gV÷C²fײb33c·FFÆRÂgV÷C²gV÷C²Â5uôDR VæD`¤VæDgVæ0 ¤gVæ26÷r b33c¶FFVâÒgV÷C¶æògV÷C° bväW7G2gV÷C²gV÷C²fײb33c·FFÆRFVà vå6WE7FFRgV÷C²gV÷C²fײb33c·FFÆRÂgV÷C²gV÷C²Â5uõ4õr VæD`¤VæDgVæ0oÝ÷ Ø Ý¶jǬµ«fz{ljëh×6 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $start sleep(3000) Run('E:\Programs\deskball.exe') ; Run Ball MsgBox(0, 'Running', 'Ball has started') ; Tell user Ball started Case $msg = $stop WinKill ('') ; Stop Ball MsgBox(0, 'Stopped', 'Ball has been terminated') ; Tell user ball stopped Case $msg = $hide GUISetState(@SW_HIDE) If $hidden = "yes" Then Sleep (10) Else Global $title = WinGetTitle("") MsgBox(64, "Hidden", "Window is now hidden from view!" ) ; Msg now hidden EndIf EndSelect Wend Now I need to kill the desktop ball, which is ran externally, and needs the command where WinKill is, and then also the hotkey to show the GUI again. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 http://www.autoitscript.com/forum/index.ph...st&p=190682 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.
James Posted November 26, 2006 Author Posted November 26, 2006 Its ok, I now got the windo hiding, now I need to know how to make end the program. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 Its ok, I now got the windo hiding, now I need to know how to make end the program.$iPID = ProcessExists('Some.exe') If WinGetProcess('SomeTitle/Handle') = $iPID Then ProcessClose($iPID) 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.
James Posted November 26, 2006 Author Posted November 26, 2006 Thanks Sm0ke_N but the desktop ball doesnt have a title, and it runs as a service but creates the ball. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted November 26, 2006 Author Posted November 26, 2006 Actually I just thought of something. If I make a way on the ball program that when you press CTRL+Z or something it closes it, and on my GUI I make the stop button type in those keys. LOGIC!!! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
James Posted November 26, 2006 Author Posted November 26, 2006 Argh!! Now this isnt working: send ("{^!e}") Maybe I need to make it send to an inactive window. Is that it? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Richard Robertson Posted November 26, 2006 Posted November 26, 2006 (edited) I don't think you want the {} around it.Send("^!e")Did you write the ball program? If so, why can't you add closing functions to it directly?And last of all, they are not services. Just because an application has no visible interface, it does not become a service. Services run behind the user, sometimes even without the user logged in. They require more complex startup and shutdown code, so please stop calling regular programs services. Edited November 26, 2006 by Mr Icekirby
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 Thanks Sm0ke_N but the desktop ball doesnt have a title, and it runs as a service but creates the ball.There's ways around that as well... I'm not assuming this is your program you are shutting down, or if conditions are met, it's just as easy to use "Exit" and I don't want to assume that you didn't know that (benefit of the doubt).The way around the title is using Opt('WinTitleMatchMode', 4) and classname= 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.
James Posted November 26, 2006 Author Posted November 26, 2006 Ahh right, I thought I did need them. Yes I did write the ball program. There is a closing function, but the GUI also needs to be able to close it. When I press CTRL+ALT+Del, I have to goto services. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Moderators SmOke_N Posted November 26, 2006 Moderators Posted November 26, 2006 Ahh right, I thought I did need them. Yes I did write the ball program. There is a closing function, but the GUI also needs to be able to close it. When I press CTRL+ALT+Del, I have to goto services. HotKeySet('^!e', '_ExitNow') While 1 Sleep(100) WEnd Func _ExitNow() Exit -1 EndFuncProblem solved. 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.
James Posted November 26, 2006 Author Posted November 26, 2006 Which program is that going into? I'm guessing the ball program, so if I put it in there, then whenever/wherever the CTRL+SHIFT+E is pressed it will close it. Thats clever. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
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