Gui-Menü Schriftgröße vergrößern

  • Hallo zusammen,
    kennt jemand eine Möglichkeit, die Schriftgröße des Menüs zu vergrößern?
    Habe schon alles mögliche versucht, kriegs aber nicht hin:

    Spoiler anzeigen
    [autoit]


    #include <GuiMenu.au3>
    #include <GuiConstantsEx.au3>

    [/autoit] [autoit][/autoit] [autoit]

    _Main()

    [/autoit] [autoit][/autoit] [autoit]

    Func _Main()
    Local $hGUI, $hFile, $hHelp, $hMain

    $hGUI = GUICreate("Menu", 400, 300)

    [/autoit] [autoit][/autoit] [autoit]

    MsgBox(0,"GUISetFont", GUISetFont(14) ) ;Rückgabe: 1=succes

    $hMain = _GUICtrlMenu_CreateMenu ()
    MsgBox(0,"GUICTRLSetFont 1.", GUICtrlSetFont(-1, 14) ) ;Rückgabe: 0=failure

    _GUICtrlMenu_AddMenuItem ($hMain, "&File", 0, $hFile)
    MsgBox(0,"GUISetFont 2.", GUICtrlSetFont(-1, 14) ) ;Rückgabe: 0=failure

    _GUICtrlMenu_AddMenuItem ($hMain, "&Help", 0, $hHelp)
    GUICtrlSetFont(-1, 14)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICtrlMenu_SetMenu ($hGUI, $hMain)
    ;GUISetFont(-1, 14)
    ;GUICtrlSetFont(-1, 14)

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    EndFunc ;==>_Main

    [/autoit]


    Ich bin für jeden Rat dankbar. ?(

    MfG ThPfund

    "Es könnte alles so einfach sein..."

    Einmal editiert, zuletzt von ThPfund (20. November 2009 um 09:57)

  • Ich hätte da eine Lösung gebastelt, aber es gibt bestimmt auch eine bessere. ;)

    Spoiler anzeigen
    [autoit]

    #cs **************************************************************************

    [/autoit] [autoit][/autoit] [autoit]

    Menü überall platzieren

    [/autoit] [autoit][/autoit] [autoit]

    http://www.autoit.de/index.php?page…0614#post110614

    [/autoit] [autoit][/autoit] [autoit]

    #ce **************************************************************************

    [/autoit] [autoit][/autoit] [autoit]

    Opt('GUIOnEventMode', 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGui = GUICreate("Mein eigenes Menü", 270, 140, -1, -1);, 0x80000000)
    GUISetOnEvent(-3, '_Exit')

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $MenueDatei = GUICtrlCreateLabel('&Datei', 0, 0, 80, 30, 0x201)
    GUICtrlSetOnEvent(-1, '_MenuPressed')
    GUICtrlSetFont(-1, 20)

    [/autoit] [autoit][/autoit] [autoit]

    $DateiContext = GUICtrlCreateContextMenu(GUICtrlCreateDummy())
    $OptionsOpen = GUICtrlCreateMenuItem("Ö&ffnen", $DateiContext)
    $OptionsClose = GUICtrlCreateMenuItem("S&chließen", $DateiContext)
    GUICtrlCreateMenuItem("", $DateiContext)
    $OptionsExit = GUICtrlCreateMenuItem("B&eenden", $DateiContext)
    GUICtrlSetOnEvent(-1, '_Exit')

    [/autoit] [autoit][/autoit] [autoit]

    $MenueHelp = GUICtrlCreateLabel("&Hilfe", 80, 0, 80, 30, 0x201)
    GUICtrlSetOnEvent(-1, '_MenuPressed')
    GUICtrlSetFont(-1, 20)

    [/autoit] [autoit][/autoit] [autoit]

    $HelpContext = GUICtrlCreateContextMenu(GUICtrlCreateDummy())
    $HelpWWW = GUICtrlCreateMenuItem("&Website", $HelpContext)
    GUICtrlSetOnEvent(-1, '_Website')
    GUICtrlCreateMenuItem("", $HelpContext)
    $HelpAbout = GUICtrlCreateMenuItem("Ü&ber...", $HelpContext)
    GUICtrlSetOnEvent(-1, '_About')

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlCreateLabel('', 0, 30, 270, 2, 0x1000)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Global $AccelKeys[2][2]=[["!d", $MenueDatei], ["!h", $MenueHelp]]
    GUISetAccelerators($AccelKeys)

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(10000)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    Exit
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _MenuPressed()
    Switch @GUI_CtrlId
    Case $MenueDatei
    ShowMenu($hGui, $MenueDatei, $DateiContext)
    Case $MenueHelp
    ShowMenu($hGui, $MenueHelp, $HelpContext)
    EndSwitch
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _About()
    MsgBox(64, "About...", "Beispiel für ein eigenes Menü")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Website()
    MsgBox(64, "Website...", "www.autoit.de")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Show a menu in a given GUI window which belongs to a given GUI ctrl
    Func ShowMenu($hWnd, $CtrlID, $nContextID)
    Local $arPos, $x, $y
    Local $hMenu = GUICtrlGetHandle($nContextID)

    [/autoit] [autoit][/autoit] [autoit]

    $arPos = ControlGetPos($hWnd, "", $CtrlID)

    [/autoit] [autoit][/autoit] [autoit]

    $x = $arPos[0]
    $y = $arPos[1] + $arPos[3]

    [/autoit] [autoit][/autoit] [autoit]

    ClientToScreen($hWnd, $x, $y)
    TrackPopupMenu($hWnd, $hMenu, $x, $y)
    EndFunc ;==>ShowMenu

    [/autoit] [autoit][/autoit] [autoit]

    ; Convert the client (GUI) coordinates to screen (desktop) coordinates
    Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
    Local $stPoint = DllStructCreate("int;int")

    [/autoit] [autoit][/autoit] [autoit]

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $y)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    [/autoit] [autoit][/autoit] [autoit]

    $x = DllStructGetData($stPoint, 1)
    $y = DllStructGetData($stPoint, 2)
    ; release Struct not really needed as it is a local
    $stPoint = 0
    EndFunc ;==>ClientToScreen

    [/autoit] [autoit][/autoit] [autoit]

    ; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd)
    Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
    DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
    EndFunc ;==>TrackPopupMenu

    [/autoit]
  • Danke, funky für Deinen Lösungsvorschlag. Das hilft mir gut weiter.
    Ich sehe schon, dass ich mich in nächster Zeit mal mehr mit den DLLCalls beschäftigen werde.
    Ideal wäre es natürlich, wenn für das Vergrößern der Menü-Schriftgröße ein DLLCall an die WinApi genügen würde. Kann aber natürlich auch sein, dass dieses Control von Windows zentral verwaltet wird und eine Veränderung auf die Anzeige aller anderen Programme durchschlagen würde. Das muss ich natürlich vermeiden... :)

    MfG ThPfund

    "Es könnte alles so einfach sein..."