 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jtuttle
Joined: 06 Nov 2008 Posts: 26
|
Posted: Tue Jun 09, 2009 10:06 am Post subject: WinClose vs. Process, Close |
|
|
I'm trying to close a program via WinClose, but the program in question, by default, minimizes to systray so WinClose, windowname doesn't work - as there is no window. I don't want to just nuke the process via Process, Close but I don't know what exactly to do here. If the icon was at a reliable position in the systray I could just doubleclick it and then WinClose the window, but it isn't.
Program in question is uTorrent - I'm working on a script to automatically start it when the computer goes idle and close it when the computer stops being idle. The whole rest of the script works, just hung on this. x.x |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Jun 09, 2009 10:17 am Post subject: Re: WinClose vs. Process, Close |
|
|
| jtuttle wrote: | | Program in question is uTorrent |
| Code: | DetectHiddenWindows, On
Process, Exist, utorrent.exe
WinGet, W, List, ahk_pid %ErrorLevel%
Loop %W%
{
WinGetClass, Class, % "ahk_id" W%A_Index%
If InStr( Class, "µTorrent" ) {
hWnd := W%A_Index%
Break
}}
MouseGetPos, X, Y
MouseMove, A_ScreenWidth, A_ScreenHeight, 0
PostMessage, 0x8001, 0,0x204,, ahk_id %hWnd% ; Right Click down
PostMessage, 0x8001, 0,0x205,, ahk_id %hWnd% ; Right Click Up
ControlSend,,{Up 1}{Enter},ahk_id %hWnd%
MouseMove, X, Y, 0 |
http://www.autohotkey.com/forum/viewtopic.php?t=41097 _________________ URLGet - Internet Explorer based Downloader |
|
| Back to top |
|
 |
jtuttle
Joined: 06 Nov 2008 Posts: 26
|
Posted: Tue Jun 09, 2009 10:36 am Post subject: |
|
|
| Not exactly what I was hoping for, but it does exactly what I needed, thanks! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|