Aero Glass Button

  • Wenn ich fologendes verwende kann man den Button nicht mehr lesen. Wa kann ich machen das der Button nicht im Aero "verschwindet"?
    #include <StructureConstants.au3>
    #include <GUIConstants.au3>

    [autoit]

    $GUI = GUICreate("Windows 7 DWM", 243, 243)
    $Apply = GUICtrlCreateButton("Apply", 80, 104, 83, 25, 0)
    GUISetState(@SW_SHOW)

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

    While 1
    $iMsg = GUIGetMsg()
    Switch $iMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Apply
    $Ret = ApplyGlass($GUI,243,243,243,243,0x000000); produces full glass window, the glass is red colored
    EndSwitch
    WEnd

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

    Func ApplyGlass($hWnd,$leftw,$rightw,$toph,$bottomh,$glasscolor = "0x000000")
    $struct=DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;")
    DllStructSetData($struct,"cxLeftWidth",$leftw)
    DllStructSetData($struct,"cxRightWidth",$rightw)
    DllStructSetData($struct,"cyTopHeight",$toph)
    DllStructSetData($struct,"cyBottomHeight",$bottomh)
    GUISetBkColor($glasscolor)
    Return DllCall("dwmapi.dll", "int", "DwmExtendFrameIntoClientArea", "hwnd", $hWnd, "ptr", DllStructGetPtr($struct))
    EndFunc

    [/autoit]

  • Du musst den Button selbst mit zeichnen, entweder muss es GDI+ oder DrawThemeText sein, sodass die DWM-Api das Schwarz nicht als transparent einstuft. Am besten solltest du dazu eine DLL erstellen, da AutoIt dazu etwas zu langsam ist.

    PS: Ich würde gerne mehr helfen, aber ohne Testumgebung ist das schwierig ...