Skip to content

Commit

Permalink
update _isValidWindow(); #37
Browse files Browse the repository at this point in the history
  • Loading branch information
FuPeiJiang committed May 4, 2023
1 parent 21a2c6f commit 8b32165
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions _VD.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -925,23 +925,25 @@ class VD {
returnValue:=false
breakToReturnFalse:
loop 1 {
; WinGetTitle, title, ahk_id %hWnd%
WinGetTitle, title, % "ahk_id " hwnd
if (!title) {
break breakToReturnFalse
}

WinGet, dwStyle, Style, ahk_id %hWnd%
if ((dwStyle&0x08000000) || !(dwStyle&0x10000000)) {
if ((dwStyle&0x08000000) || !(dwStyle&0x10000000)) { ;0x08000000=WS_DISABLED, 0x10000000=WS_VISIBLE
break breakToReturnFalse
}
WinGet, dwExStyle, ExStyle, ahk_id %hWnd%
if (dwExStyle & 0x00000080) {
break breakToReturnFalse
}
WinGetClass, szClass, ahk_id %hWnd%
if (szClass = "TApplication") {
break breakToReturnFalse
if (!(dwExStyle&0x00040000)) { ;0x00040000=WS_EX_APPWINDOW
if (dwExStyle&0x00000080 || dwExStyle&0x08000000) { ;0x00000080=WS_EX_TOOLWINDOW, 0x08000000=WS_EX_NOACTIVATE
break breakToReturnFalse
}
owner_hWnd:=DllCall("GetWindow","Ptr",hWnd,"Uint",4) ;4=GW_OWNER
desktop_hWnd:=DllCall("GetDesktopWindow","Ptr") ;also known as:className:#32769
if (owner_hWnd==desktop_hWnd) {
break breakToReturnFalse
}
}

pView:=this._view_from_Hwnd(hWnd)
Expand Down

0 comments on commit 8b32165

Please sign in to comment.