| View previous topic :: View next topic |
| Author |
Message |
SKAN
Joined: 26 Dec 2005 Posts: 7159
|
Posted: Sat Nov 07, 2009 11:04 am Post subject: uTorrent :: WM_COMMAND > wParam values for Menu items |
|
|
Killing the process is a pretty bad idea with uTorrent and the you may use uTorrent_Exit() which exits uTorrent by simulating File > Exit through WM_COMMAND.
Though the tray icon disappears immediately, the process ( utorrent.exe ) will persist until it notifies the trackers, which would typically take around 10 seconds.
The return value will be Seconds taken if successful or the PID itself if the process was not closed within 20 seconds.
| Code: | uTorrent_Exit( ahk_class="µTorrent4823DF041B09" ) {
; by SKAN www.autohotkey.com/forum/viewtopic.php?t=50732
hWnd := DllCall( "FindWindowA", Str,ahk_class, Int,0 ), TC := A_TickCount
DllCall( "PostMessageA", UInt,hWnd, UInt,0x111, UInt,64, Int,0 ) ; Alt+FX = File > Exit
Process, WaitClose, utorrent.exe, 20
Return ErrorLevel ? ErrorLevel : Round( (A_TickCount-TC)/1000,2 )
} |
Other PostMessage > wParam values for taming uTorrent
Tray Menu
- 60 Hide/Show uTorrent
- 61 Resume All Torrents
- 62 Pause All Torrents
- 63 Exit uTorrent
File Menu
- 65 Add Torrent
- 67 Add Torrent
- 73 Add Torrent from URL
- 72 Create New Torrent
- 64 Exit
Options Menu
- 68 Preferences
- 80 RSS Downloader
- 82 Speed Guide Dialog
- 76 Show Toolbar
- 75 Show Detailed Info
- 77 Show Status Bar
- 78 Show Category List
- 84 Icons on Tabs
Help Menu
- 83 uTorrent Help
- 70 uTorrent Webpage
- 99 uTorrent Foums
- 71 Check for Updates
- 81 Show Statistics
- 69 About uTorrent
Last edited by SKAN on Tue Nov 17, 2009 1:22 pm; edited 3 times in total |
|
| Back to top |
|
 |
jackieku
Joined: 30 Nov 2008 Posts: 64
|
Posted: Mon Nov 09, 2009 1:54 pm Post subject: |
|
|
| Do you really need the DllCall()s? I think "DetectHiddenWindows on" and the builtin PostMessage should be enough to do the same job. |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7159
|
Posted: Mon Nov 09, 2009 2:12 pm Post subject: |
|
|
| jackieku wrote: | | "DetectHiddenWindows on" and the builtin PostMessage should be enough to do the same job. |
Exactly!. I learnt this alternative from corrupt.
| Quote: | | Do you really need the DllCall()s? |
I prefer functions over a subroutine for the sake of avoiding Global variables,
and I avoid using the following inside functions:
DetectHiddenWindows
SetFormat, Integer, Hex
Gui
Just a matter of preference. |
|
| Back to top |
|
 |
neh neh pork Guest
|
Posted: Wed Nov 11, 2009 2:02 pm Post subject: |
|
|
thanx, this is useful  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7159
|
Posted: Tue Nov 17, 2009 1:21 pm Post subject: |
|
|
| I discovered more wParam values with brute force.. Titles post updated. |
|
| Back to top |
|
 |
Vade
Joined: 14 Jun 2008 Posts: 5
|
Posted: Thu Nov 19, 2009 1:40 pm Post subject: |
|
|
Thanks SKAN !
This is just what I've been looking for. Now I don't have to recheck my torrents .
I tried finding those wParams with WinSpector, but had no luck. |
|
| Back to top |
|
 |
shajul
Joined: 15 Sep 2006 Posts: 99
|
Posted: Thu Nov 19, 2009 3:22 pm Post subject: |
|
|
| Great work!! |
|
| Back to top |
|
 |
|