; AHKv2可用
!q::
{
; 获取FolderView的id
HWorkerW := WinGetID("ahk_class WorkerW")
HDefView := DllCall("FindWindowEx", "UInt", HWorkerW, "UInt", 0, "Str", "SHELLDLL_DefView", "UInt", 0)
HListView := DllCall("FindWindowEx", "UInt", HDefView, "UInt", 0, "Str", "SysListView32", "UInt", 0)
; 检查显隐状态
if DllCall("IsWindowVisible", "UInt", HListView) {
DllCall("ShowWindow", "UInt", HListView, "UInt", 0)
}
else {
DllCall("ShowWindow", "UInt", HListView, "UInt", 5)
}
}
; AHKvL可用
!q::
{
ControlGet, class, Hwnd, , SysListView321, ahk_class Progman
If (class = "")
ControlGet, class, Hwnd, , SysListView321, ahk_class WorkerW
If DllCall("IsWindowVisible", UInt, class)
WinHide, ahk_id%class%
Else
WinShow, ahk_id%class%
}