Amanda wrote: ↑27 Nov 2018, 10:38
Yeah,
CyL0N.
It worked on Windows 7 Ultimate 64 bits.
But...
In Windows 10 64 bits it is not working.
I am using the latest version 1809 of Windows 10.
Fixed.
Code: Select all
~F2::
~NumLock::
if GetKeyState(LTrim(A_ThisHotkey,"~"),"T"){
Menu, Tray, Icon, C:\Windows\System32\shell32.dll, 100
ShowShell32Icon(100)
}else{
Menu, Tray, Icon, C:\Windows\System32\shell32.dll, 3
ShowShell32Icon(3)
}
return
ShowShell32Icon(iconIndex,xx:="", yy:=""){
Static
Global icIndex := iconIndex
If (!xx || !yy){
IniRead, xNy, %A_Temp%\persistentPos.ini, pPos, posLog%iconIndex%
( xNy = "ERROR" || xNy = "|"? (xx:=100) & (yy:=100) : (xx:=StrSplit(xNy,"|")[1]) & (yy:=StrSplit(xNy,"|")[2]) )
}
Gui Destroy ;using it for least hastle...
Gui +AlwaysOnTop -Caption +LastFound +ToolWindow
Gui Color, Grey
Gui Add, Picture, Icon%iconIndex%, %A_WinDir%\system32\SHELL32.dll
WinSet, TransColor, Grey ;set gui transparency offscreen
gui, show, x%xx% y%yy%, shell32iconGui
OnMessage(0x201, "WM_LBUTTONDOWN") ;to allow mouse to drag gui
Return
}
WM_LBUTTONDOWN(){ ;to allow dragging icon
Global icIndex
PostMessage, 0xA1, 2
While GetKeyState("LButton")
sleep 10
SoundBeep
WinGetPos wX, wY,,, shell32iconGui
IniWrite, % wX "|" wY, %A_Temp%\persistentPos.ini, pPos, posLog%icIndex%
}
Here's a script to select the icons from within the system,you really just need icon number it generates,plug that into the script as you need to...
Code: Select all
iconPath = %A_WinDir%\System32\shell32.dll
MsgBox % clipboard := iconPath . ", " . PickIconDlg() "`n`n COPIED TO CLIPBOARD!"
PickIconDlg(IconPath:=""){ ;gives dialog box to select icon and returns icon number upon selection
shell32path = %A_WinDir%\System32\Shell32.dll
IconPath := IconPath ? IconPath : shell32path ;Path to any Dll
;Index := 1 ;Pre-selected icon number
Dlg := DllCall("Shell32.dll\PickIconDlg", "UInt", hWnd, "UInt*", "IconPath", "UInt", "PathSize", "Int*", Index)
Return % Index += 1
}