The following code works to my knowledge fully as expected. Is there something I still could improve?
Code: Select all
CheckDetailsView() {
oWin := ""
WinGet, hWnd, ID, A
for oWin in ComObjCreate("Shell.Application").Windows
if (oWin.Document.CurrentViewMode == 4) ;Details View is equivalent to 4
return true
return false
}
F1::
if (CheckDetailsView())
MsgBox, 'Details View' is active.
else
MsgBox, Other View currently selected.
return
I would really like to get this also working in #If-directives for better maintainability down the road:
Code: Select all
;Is this somehow possible to achieve?
#If (CheckDetailsView()) && WinActive("ahk_class CabinetWClass")
F2::MsgBox, 'Details View' is active.
#If