本帖最后由 lixiaolong 于 2012-2-29 15:33 编辑
回复 1# sanmoking
XP,Win7测试成功.
Global Const $WM_MOVE = 0x0003
Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG'
$Width = 500
$Hight = 300
$WinHight = @DesktopHeight - 60 - $Hight
$hGui = GUICreate('窗口非置顶显示但永久覆盖桌面任务栏 by lixiaolong', $Width, $Hight, -1, -1)
GUISetState()
GUIRegisterMsg($WM_MOVE, "WM_MOVE")
Do
Until GUIGetMsg() = -3
Func WM_MOVE($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam, $ilParam
$pos = WinGetPos($hGui)
;~ ConsoleWrite($pos[0] & 'x ' & $pos[1] & @CRLF)
If $pos[1] > $WinHight Then
GUISetStyle(-1, 0x00000008, $hGui)
WinSetOnTop($hGui, '', 1)
Else
GUISetStyle(-1, -1, $hGui)
WinSetOnTop($hGui, '', 0)
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_MOVE
|