Comment on page
👨💻 Scriptler
AutoHotkey (AHK) ile ilgili script örnekleri ve açıklamalar
Exe
Class
WinGet, id, list, ahk_exe %ahk_exe%
Loop, %id%
{
this_ID := id%A_Index%
WinGetTitle, title, ahk_id %this_ID%
If (title = "")
continue
; İşlem
}
IfWinExist, ahk_class CabinetWClass
{
IfWinNotActive, ahk_class CabinetWClass
WinActivate, ahk_class CabinetWClass
Else
{
WinMinimize
WinHide
}
}
Görev Çubuğuna Alma
İkon Kısmına Alma
İkon Kısmına Alma
ToggleWindow(windowName)
{
WinGet, WinState, MinMax, %windowName%
if (WinState == -1)
{
WinRestore
WinActivate
}
else
{
WinMinimize
WinMinimize ; Tureng için 2 tane pencere açılıyor
}
return
}
ToogleTray(windowName, mode=3)
{
SetTitleMatchMode, %mode%
DetectHiddenWindows, Off
IfWinNotExist, %windowName%
{
WinRestore
WinShow
WinActivate
}
else
{
WinHide
}
return
}
ToogleTrayWithId(ahkId, mode=3)
{
SetTitleMatchMode, %mode%
DetectHiddenWindows, Off
IfWinNotExist, ahk_id %ahkId%
{
WinRestore
WinShow
WinActivate
}
else
{
WinHide
}
return
}
Görev Çubuğu
İkon
İkon 2
ShowWin(windowName, url, mode=3)
{
SetTitleMatchMode, %mode%
IfWinExist, %windowName%
ToggleWindow(windowName)
else
Run, %url%
return
}
ShowTray(windowName, url, mode=3)
{
SetTitleMatchMode, %mode%
DetectHiddenWindows, On
IfWinExist, %windowName%
ToogleTray(windowName, mode)
else
Run, %url%
return
}
ShowTrayWithClass(className, url, mode=3)
{
SetTitleMatchMode, %mode%
DetectHiddenWindows, On
found := False
WinGet, id, list, ahk_class %className%
Loop, %id%
{
this_ID := id%A_Index%
IfWinExist ahk_id %this_ID%
{
WinGetTitle, title
If (title = "")
continue
ToogleTrayWithId(this_ID, mode)
found := True
}
}
If (!found)
Run, %url%
return
}
#Persistent
Menu, Tray,Icon, Calc.exe, 1
Menu, Tray, NoStandard
Menu, Tray, Add, &Calculator, Calc
Menu, Tray, Add,
Menu, Tray, Standard
Menu, Tray, Default, &Calculator
Return
Calc:
If WinExist("Calculator")
WinClose, Calculator
else
Run, Calc.exe
Return
WinSet, ExStyle, ^0x80, ahk_id %ahkID%
WinGet, WindowID, List
Loop, % WindowID {
cWindow = % WindowID%A_Index%
WinGetTitle, Title, ahk_id %cWindow%
WinGetClass, Class, ahk_id %cWindow%
Message=% Message "`n" Class "`t`t" Title
}
MsgBox, 64, List of Visible Windows, %Message%
ExitApp
Last modified 1mo ago