Hi, I'm a newbie trying to use this script.
When I ran beardboys Icon Browser on the .exe file with the icon, I got: IconFileName = C:\Program Files\TeamScope\Linker for Windows\Linker for Windows.exeIL_Add(ImageListID1, IconFileName, 1)
Gui,add, pic, Icon1, C:\Program Files\TeamScope\Linker for Windows\Linker for Windows.exe
So the icon number is: 1
And the file name that contained the icon is: C:\Program Files\TeamScope\Linker for Windows\Linker for Windows.exe
Correct?
I made #I be the hotkey for the script. So my script is as follows:
Code:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#I::
; the number of the tray icon that you need to click, followed by a space and then the filename containing the icon :
iconstr = 1 C:\Program Files\TeamScope\Linker for Windows\Linker for Windows.exe
;replace this with your filename. I used beardboys Icon Browser - http://www.autohotkey.com/forum/viewtopic.php?t=5587&highlight=iconviewer - to find the icon inside the dll
coordmode, mouse, screen
MouseGetPos, mouseX, mouseY
coordmode, pixel, screen
WinGetPos, trayX, trayY, trayWidth, trayHeight, ahk_class Shell_TrayWnd
ImageSearch, imageX, imageY, trayX, trayY, trayX+trayWidth, trayY+trayHeight, *Icon%iconstr%
MouseMove,%imageX%,%imageY%,0
MouseClick,left,%imageX%,%imageY%,1,0
MouseMove,%mouseX%,%mouseY%,0
Return
But when I run it by pressing #I, nothing seems to happen.
What am I doing wrong?