找回密码
 加入
搜索
查看: 2486|回复: 5

[GUI管理] 能不能在标题栏加入菜单

  [复制链接]
发表于 2011-2-17 01:44:36 | 显示全部楼层 |阅读模式
请问下各位大侠 能不能在标题栏处加入菜单。
发表于 2011-2-17 14:10:26 | 显示全部楼层
专业的门外汉会。
发表于 2011-2-17 16:18:24 | 显示全部楼层
要自己做皮肤才行吧
发表于 2011-2-17 16:53:24 | 显示全部楼层
skin_H皮肤可以实现之
;DllCall($__SkinH_DLL, "int", "SkinH_SetTitleMenuBar", "hwnd", $hWnd, "BOOLEAN", $bEnable, "int", $nTMenuY, "int", $nTopOffs, "int", $nRightOffs)
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

    Local $defaultstatus = "Ready", $status, $filemenu, $fileitem
    Local $helpmenu, $saveitem, $infoitem, $exititem, $recentfilesmenu
    Local $separator1, $viewmenu, $viewstatusitem, $okbutton, $cancelbutton
    Local $statuslabel, $msg, $file,$Form1
    
    $Form1=GUICreate("My GUI menu", 300, 200)


    $filemenu = GUICtrlCreateMenu("&File")
    $fileitem = GUICtrlCreateMenuItem("Open", $filemenu)
    GUICtrlSetState(-1, $GUI_DEFBUTTON)
    $helpmenu = GUICtrlCreateMenu("?")
    $saveitem = GUICtrlCreateMenuItem("Save", $filemenu)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu)
    $exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
    $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1)

    $separator1 = GUICtrlCreateMenuItem("", $filemenu, 2)     ; create a separator line

    $viewmenu = GUICtrlCreateMenu("View", -1, 1)     ; is created before "?" menu
    $viewstatusitem = GUICtrlCreateMenuItem("Statusbar", $viewmenu)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $okbutton = GUICtrlCreateButton("OK", 50, 130, 70, 20)
    GUICtrlSetState(-1, $GUI_FOCUS)
    $cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20)

    $statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN))
    skin()
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        
        If $msg = $fileitem Then
            $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
            If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)
        EndIf
        If $msg = $viewstatusitem Then
            If BitAND(GUICtrlRead($viewstatusitem), $GUI_CHECKED) = $GUI_CHECKED Then
                GUICtrlSetState($viewstatusitem, $GUI_UNCHECKED)
                GUICtrlSetState($statuslabel, $GUI_HIDE)
            Else
                GUICtrlSetState($viewstatusitem, $GUI_CHECKED)
                GUICtrlSetState($statuslabel, $GUI_SHOW)
            EndIf
        EndIf
        If $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton Or $msg = $exititem Then ExitLoop
        If $msg = $infoitem Then MsgBox(0, "Info", "Only a test...")
    WEnd
    GUIDelete()
    
Func Skin()
    $Dll = DllOpen("SkinH_EL.dll")
    DllCall($Dll, "int", "SkinH_AttachEx", "str", "QQ2009.she", "str", "benkel")
    DllCall($DLL, "int", "SkinH_SetTitleMenuBar", "hwnd", $Form1, "BOOLEAN", True, "int", 0, "int", 0, "int", 100)
;~     DllCall($Dll, "int", "SkinH_AttachEx", "str", $She, "str", "benkel")
;~     DllCall($Dll, "int", "SkinH_SetWindowAlpha", "int", $Form1, "int", 255)
;~     DllCall($Dll, "int", "SkinH_AdjustAero", "int", 100, "int", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", 100, "int", 100)
;~     DllCall($Dll, "int", "SkinH_SetWindowAlpha", "int", $Form1, "int", 220);设置控件透明?GUICtrlGetHandle($Button1)
EndFunc   ;==>Skin

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2011-2-18 17:32:19 | 显示全部楼层
不错!!!!!!!
顶一个
发表于 2011-2-18 17:32:23 | 显示全部楼层
不错!!!!!!!
顶一个
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-21 03:33 , Processed in 0.079801 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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