找回密码
 加入
搜索
查看: 1913|回复: 1

[GUI管理] 当没有鼠标或键盘动作时如何隐藏窗口?(已解决)

[复制链接]
发表于 2011-1-31 08:44:58 | 显示全部楼层 |阅读模式
本帖最后由 qq342252004 于 2011-1-31 12:58 编辑
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate('Video',@DesktopWidth,@DesktopHeight,0,0,0x80000000)
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
$Form2 = GUICreate('Menu', 430, 430,@DesktopWidth-430,0,$WS_POPUP,-1,WinGetHandle(AutoItWinGetTitle()))
WinSetOnTop($Form2,"",1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd
一定时间内没有鼠标或键盘动作时如何隐藏$Form2窗口,当有鼠标或键盘动作时又显示$Form2窗口?
发表于 2011-1-31 10:35:47 | 显示全部楼层
回复 1# qq342252004
设置10秒无动作就隐藏form2窗口
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate('Video',@DesktopWidth,@DesktopHeight,0,0,0x80000000)
GUISetBkColor(0x000000)
GUISetState(@SW_SHOW)
$Form2 = GUICreate('Menu', 430, 430,@DesktopWidth-430,0,$WS_POPUP,-1,WinGetHandle(AutoItWinGetTitle()))
WinSetOnTop($Form2,"",1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###




While 1
        $nMsg = GUIGetMsg()
    Switch $nMsg
         Case $GUI_EVENT_CLOSE
          Exit
  EndSwitch
  If _Timer_GetIdleTime()>10000 Then 

GUISetState(@SW_HIDE,$Form2)
Sleep (100)
Else
        GUISetState(@SW_SHOW,$Form2)
EndIf
WEnd

评分

参与人数 1金钱 +40 收起 理由
qq342252004 + 40 非常感谢

查看全部评分

您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-11 20:13 , Processed in 0.084319 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表