找回密码
 加入
搜索
查看: 2981|回复: 3

[原创] 我自己做的显示和隐藏子菜单窗口,谁能帮我完善一下

[复制链接]
发表于 2010-3-6 15:06:37 | 显示全部楼层 |阅读模式
下面是代码,保存后打开,按f9以后,显示子菜单,我如何能设置成再按一下f9又把它隐藏呢?
如何用一个热键就能实现呢?


#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
HotKeySet("{F9}", "showorhid")
$Form1 = GUICreate("AutoIt ", 309, 171, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_BORDER,$WS_CLIPSIBLINGS), $WS_EX_TOPMOST)
GUISetState(@SW_SHOW,$Form1)

$childwin = GUICreate("Child", 200, 100, 10, 50, $WS_POPUP )
GUISetBkColor(0xfffaf0, $childwin)
$Group1 = GUICtrlCreateGroup("Group1", 0, 0, 201, 105)
$Input1 = GUICtrlCreateInput("Input1", 104, 80, 169, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_HIDE , $childwin)
DllCall("user32.dll", "int", "SetParent", "hwnd", WinGetHandle($childwin), "hwnd", WinGetHandle($Form1))



While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
WEnd
;;;;;;;;

Func showorhid()
      GUISetState(@SW_SHOW , $childwin)
EndFunc
发表于 2010-3-6 17:33:44 | 显示全部楼层
这个贴不知道能不能帮到你
http://www.autoitx.com/forum.php ... B%B8%F6%C8%C8%BC%FC
发表于 2010-3-6 17:34:18 | 显示全部楼层
对了,你怎么发到作品展览了,应该发到求助区吧
 楼主| 发表于 2010-3-6 22:32:34 | 显示全部楼层
奥,对哦。。 我做出来了,加个if语句就行了。
guisetstate() 是有返回值的。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 02:02 , Processed in 0.071473 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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