#include <WinAPI.au3>
Global $Struct = DllStructCreate($tagPoint)
Global $WindowsWidth = _WinAPI_GetSystemMetrics(0)
Global $WindowsHeight = _WinAPI_GetSystemMetrics(1)
Local $array = _WinAPI_EnumWindows(True), $hDesktop
For $i = 1 To $array[0][0]
If _WinAPI_GetClassName(_WinAPI_GetParent($array[$i][0])) = 'SHELLDLL_DefView' Then
$hDesktop = _WinAPI_GetParent(_WinAPI_GetParent($array[$i][0]))
ExitLoop
EndIf
Next
While 1
Sleep(100)
If IsFullWindow() Then ;全屏
MsgBox(0, "", "有全屏")
EndIf
WEnd
Func IsFullWindow() ;检测当前窗口是否全屏,是:返回1,否则返回0
Pos()
$hwnd = _WinAPI_WindowFromPoint($Struct)
;~ If $hwnd = _WinAPI_GetDesktopWindow() Then Return 0 ;不检测资源管理器
If $hwnd = $hDesktop Then Return 0 ;不检测资源管理器
$tRect = _WinAPI_GetWindowRect($hwnd)
$iLeft = DllStructGetData($tRect, "Left")
$iTop = DllStructGetData($tRect, "Top")
$iRight = DllStructGetData($tRect, "Right")
$iBottom = DllStructGetData($tRect, "Bottom")
If $WindowsWidth < $iRight - $iLeft And $WindowsHeight < $iBottom - $iTop Then Return 1
Return 0
EndFunc ;==>IsFullWindow
Func Pos()
DllStructSetData($Struct, "x", MouseGetPos(0))
DllStructSetData($Struct, "y", MouseGetPos(1))
EndFunc ;==>Pos
|