[Frage] Zusätzlichen Button im System-Menü

  • eine kleine Antwort: ja ;)

    Beispiel:
    [autoit]

    #include <GUIConstants.au3>
    #include <ButtonConstants.au3>
    #include <WindowsConstants.au3>
    #include <WinAPI.au3>
    #include <Constants.au3>
    #region - GUI Create
    DllCall("UxTheme.dll","int","SetThemeAppProperties","dword",0)
    $GUI = GUICreate('PopUp',16,14,-1,1,$WS_POPUP,$WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
    GUISetBkColor(_WinAPI_GetSysColor($COLOR_ACTIVEBORDER))
    $Button = GUICtrlCreateButton("2",0,0,16,14,$BS_CENTER)
    GUICtrlSetFont(-1,12,400,0,"Wingdings")
    DllCall("UxTheme.dll","int","SetThemeAppProperties","dword",3)
    GUISetState(@SW_SHOWNOACTIVATE)
    #endregion
    $hwnd = -1
    $w = 0
    CheckWin()
    AdlibRegister("CheckWin",100)
    #region - GUI SelectLoop
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    Case $msg = $Button
    MsgBox(0, '', "hi")
    WinActivate($hwnd)
    Case $hwnd <> $GUI And WinExists($hwnd)
    $pos = WinGetPos($hwnd)
    WinMove($GUI,"",$pos[0]+$pos[2]-$w,$pos[1]+6)
    EndSelect
    WEnd
    #endregion
    Func CheckWin()
    Local $hwnd1 = WinGetHandle("")
    If $hwnd1 <> $GUI And $hwnd <> $hwnd1 Then
    Global $hwnd = $hwnd1
    $Style = _WinAPI_GetWindowLong($hwnd,$GWL_STYLE)
    $w = 5
    If BitAND($Style,$WS_MINIMIZEBOX) Then $w += 30
    If BitAND($Style,$WS_SYSMENU) Then $w += 70
    If BitAND($Style,$WS_MAXIMIZEBOX) Then $w += 30
    EndIf
    EndFunc

    [/autoit]

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    über mich...

    ich habe meine Erfahrungen hauptsächlich gesammelt in (grobe Übersicht):

    - RibbonBar Automation
    - MySQL Nutzung
    - GUIs in vielerlei Ausprägung
    - Nutzung von Powershell / Batch in AutoIt
    - Windows Automatisierung

    außerhalb von AutoIt:

    - Sprachen: PS, Batch, php, html(5), javascript, (perl eingeschränkt), vbs
    - Powershell (AD, WPF inkl. Multi-Threading, ...)
    - Deployment-Automatisierung ohne SCCM
    - Office-Nutzung mit COM-Object (AutoIt, PowerShell)
    - ActiveDirectory und alles was damit zusammenhängt
    - Hyper-V Clustering (Converged / Hyper Converged)
    - Serverhardware (Konfiguration, Aufbau, Architektur, Betrieb)

    Lieblingsthema:

    günstige Automatisierung von Vorgängen, für die andere Firmen viel Geld nehmen

    more to come ...