|
本帖最后由 mshuking 于 2014-12-17 14:33 编辑
[求助]托盘问题 托盘菜单 点了没反应 应该怎么写?
最小化到 托盘 不显示在任务栏 怎么写?
最小化后 点 显示窗口 又如何写?#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("TrayMenuMode",3)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("测试", 313, 241, 349, 249)
$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 297, 193)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("确定(&O)", 70, 203, 75, 25)
$Button2 = GUICtrlCreateButton("取消(&C)", 149, 204, 75, 25)
$Button3 = GUICtrlCreateButton("帮助(&H)", 229, 204, 75, 25)
$Start = TrayCreateItem("显示窗口(&A)")
TrayItemSetOnEvent($Start,"TrayMsg")
TrayCreateItem("")
$About = TrayCreateItem("关于(&H)")
TrayItemSetOnEvent($About,"TrayMsg")
TrayCreateItem("")
$Quit = TrayCreateItem("退出(&Q)")
TrayItemSetOnEvent($Quit,"TrayMsg")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE,$Button2,$Quit
Exit
Case $About
MsgBox(48, '关于', '程序开发中。。。。')
Case $Start
MsgBox(48, '这个怎么写', '显示窗口怎么写')
EndSwitch
WEnd
正解 感谢user3000的大力帮助! #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("TrayMenuMode", 3)
#region ### START Koda GUI section ### Form=
$Form2 = GUICreate("测试", 313, 241, 349, 249)
$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 297, 193)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("确定(&O)", 70, 203, 75, 25)
$Button2 = GUICtrlCreateButton("取消(&C)", 149, 204, 75, 25)
$Button3 = GUICtrlCreateButton("帮助(&H)", 229, 204, 75, 25)
$Start = TrayCreateItem("显示窗口(&A)")
;TrayItemSetOnEvent($Start,"TrayMsg")
TrayCreateItem("")
$About = TrayCreateItem("关于(&H)")
;TrayItemSetOnEvent($About,"TrayMsg")
TrayCreateItem("")
$Quit = TrayCreateItem("退出(&Q)")
;TrayItemSetOnEvent($Quit,"TrayMsg")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $Button2
Exit
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE, $Form2)
EndSwitch
$nMsg2 = TrayGetMsg()
Switch $nMsg2
Case $About
MsgBox(48, '关于', '程序开发中。。。。')
Case $Start
GUISetState(@SW_SHOW, $Form2)
GUISetState(@SW_RESTORE, $Form2)
WinActivate($Form2)
Case $Quit
Exit
EndSwitch
WEnd
|
|