如何给我创建的标题菜单添加功能
看图,看图,是标题菜单,而不是窗体菜单,不要误会,请问如何加功能呢?
#Include <GuiMenu.au3>
$ck=GUICreate("88",999,86)
GUISetState()
$meau=_GUICtrlMenu_GetSystemMenu($ck,False)
_GUICtrlMenu_DeleteMenu($meau,2,true)
_GUICtrlMenu_DeleteMenu($meau,1,true)
_GUICtrlMenu_InsertMenuItem($meau,0,"&Test.")
_GUICtrlMenu_AddMenuItem($meau,"")
_GUICtrlMenu_AddMenuItem($meau,"&About this tool.")
While 765
WEnd 我也想知道 怎么做
#include <GUIConstants.au3>
#Include <GuiMenu.au3>
Global Const $WM_SYSCOMMAND = 0x0112
Dim $hGUI = GUICreate("System Menu")
GUISetState()
GUIRegisterMsg($WM_SYSCOMMAND, "_WM_SYSCOMMAND")
$nItem = _CreateSystemMenuItem("Hit me strongly...", -1, False, 0)
_CreateSystemMenuItem("", -1, False, 1)
While True
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func _WM_SYSCOMMAND($hWnd, $Msg, $wParam, $lParam)
Local $nID = BitAND($wParam, 0x0000FFFF)
Switch $nID
Case $nItem
MsgBox(0, "My System Menu", "Your penis is very vigorous")
EndSwitch
EndFunc
Func _InsertMenu($hMenu, $nPosition, $nFlags, $nIDNewItem, $lpNewItem)
Local $nResult = DllCall("user32.dll", "int", "InsertMenu", "hwnd", $hMenu, "int", $nPosition, "int", $nFlags, "int", $nIDNewItem, "str", $lpNewItem)
Return $nResult
EndFunc
Func _CreateSystemMenuItem($sText, $hMenu = -1, $bIsPopup = False, $nPos = 0xFFFFFFFF)
If $hMenu = -1 Then $hMenu = _GUICtrlMenu_GetSystemMenu($hGUI, 0)
Local $nID = GUICtrlCreateDummy(), $nFlags = 0
If $sText = "" Then
$nFlags = $MF_SEPARATOR
ElseIf $bIsPopup Then
$nID = _GUICtrlMenu_CreatePopup()
$nFlags = $MF_POPUP
EndIf
$nFlags = BitOR($MF_BYPOSITION, $nFlags)
$nResult = _InsertMenu($hMenu, $nPos, $nFlags, $nID, $sText)
Return $nID
EndFunc
顶 happytc, you rock!—— 处理系统命令 $WM_SYSCOMMAND
英语也强得让人无语~~ l| 本帖最后由 xiehuahere 于 2012-8-7 20:54 编辑
回复 6# Windows8
这不算的。
我说出了要点——处理系统命令 $WM_SYSCOMMAND
只是顺带多说了点,论坛也需要活跃气氛的啊。
如果我这个也算,那论坛的水贴就太多啦~~版主们要忙疯了
说实在的,我在论坛闲逛和顶贴的时候还真不多,如果你能看到我的发帖纪录的话。 为什么要扣我分??不借 学习菜单中....
页:
[1]