|
下面是代码,保存后打开,按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 |
|