Hab da mal eine Frage zur GUI.

    • Offizieller Beitrag

    Servus.
    Gib es eigentlich eine Möglichkeit in einer GUI nur den Hintergrund zu 100% transparent zu machen . Die Schaltflächen, Label usw sollten natürlich nicht transparent sein. Wäre cool wenn das ginge . Buttons freischwebend sozusagen.

  • Moin,

    sieh dir mal das Beispiel aus GUICtrlCreatePic () an ...
    GuiCtrlCreatePic ()

    Die GUI mit Merlin als Bild solltest Du dir genauer ansehen. ;)


    LG
    Greenhorn

    EDIT:
    Moment mal, ich hatte da doch irgendwo noch dieses Skript ... *Kram* *Schnüffel* *Wurschtel*

    Ah, da ist es ja. :)
    Voilá

    Spoiler anzeigen
    [autoit]


    #include <WindowsConstants.au3>
    #include <GUIConstantsEx.au3>

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

    HotKeySet("{ESC}", "QuitApp")
    $BG = GUICreate("back window",400,400,0,0)
    WinSetTrans("back window","",0)
    $Main_Gui = GUICreate("", 400, 400,0,0, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)

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

    $But1 = GUICtrlCreateButton(" Exit ", 100, 100, 80, 21)
    $Info_Edit = GUICtrlCreateEdit("A few words to start off with", 80, 150, 300, 220)
    GUISetControlsVisible($Main_Gui)
    ;$wp = WinGetPos(WinGetHandle("Untitled"))

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

    GUISetState(@SW_SHOW,$BG)
    GUISetState(@SW_SHOW,$Main_Gui)
    GUIRegisterMsg($WM_ACTIVATE, "WM_ACTIVATE")
    GUIRegisterMsg($WM_MOVE, "WM_MOVE")
    GUISwitch($BG)
    $n = 100
    $way = 1
    While 1
    $Msg = GUIGetMsg()
    if $Msg = $But1 Then Exitloop

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

    ;WinSetTrans($BG,"",$n)
    ;WinSetTrans($Main_Gui,"",$n);<--------choose this line instead of one above to make the components fade rather than the window

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

    if $n > 253 or $n < 40 then $way *= -1
    Sleep(20);<-------------------------adjust for speed of fade
    $n += $way
    WEnd

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

    Func GUISetControlsVisible($hWnd)
    Local $aClassList, $aM_Mask, $aCtrlPos, $aMask

    ;Set $WS_POPUP style part:
    Local Const $GWL_STYLE = -16
    Local Const $GWL_EXSTYLE = -20
    Local Const $SWP_NOMOVE = 0x2
    Local Const $SWP_NOSIZE = 0x1
    Local Const $SWP_SHOWWINDOW = 0x40
    Local Const $SWP_NOZORDER = 0x4

    Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOMOVE, $SWP_NOZORDER)
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $WS_POPUP)
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", 0, "int", 0, "int", 0, "int", 0, "int", $iFlags)
    ;End Set $WS_POPUP style part

    $aClassList = StringSplit(_WinGetClassListEx($hWnd), @LF)
    $aM_Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)

    For $i = 1 To UBound($aClassList) - 1
    $aCtrlPos = ControlGetPos($hWnd, '', $aClassList[$i])
    If Not IsArray($aCtrlPos) Then ContinueLoop

    $aMask = DllCall("gdi32.dll", "long", "CreateRectRgn", _
    "long", $aCtrlPos[0], _
    "long", $aCtrlPos[1], _
    "long", $aCtrlPos[0] + $aCtrlPos[2], _
    "long", $aCtrlPos[1] + $aCtrlPos[3])
    DllCall("gdi32.dll", "long", "CombineRgn", "long", $aM_Mask[0], "long", $aMask[0], "long", $aM_Mask[0], "int", 2)
    Next
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aM_Mask[0], "int", 1)
    EndFunc

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

    Func _WinGetClassListEx($sTitle)
    Local $sClassList = WinGetClassList($sTitle)
    Local $aClassList = StringSplit($sClassList, @LF)
    Local $sRetClassList = "", $sHold_List = "|"
    Local $aiInHold, $iInHold

    For $i = 1 To UBound($aClassList) - 1
    If $aClassList[$i] = "" Then ContinueLoop

    If StringRegExp($sHold_List, "\|" & $aClassList[$i] & "~(\d+)\|") Then
    $aiInHold = StringRegExp($sHold_List, ".*\|" & $aClassList[$i] & "~(\d+)\|.*", 1)
    $iInHold = Number($aiInHold[UBound($aiInHold)-1])

    If $iInHold = 0 Then $iInHold += 1

    $aClassList[$i] &= "~" & $iInHold + 1
    $sHold_List &= $aClassList[$i] & "|"

    $sRetClassList &= $aClassList[$i] & @LF
    Else
    $aClassList[$i] &= "~1"
    $sHold_List &= $aClassList[$i] & "|"
    $sRetClassList &= $aClassList[$i] & @LF
    EndIf
    Next

    Return StringReplace(StringStripWS($sRetClassList, 3), "~", "")
    EndFunc

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

    Func QuitApp()
    Exit
    EndFunc

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

    Func WM_MOVE($hWndGUI)
    If $hWndGUI <> $BG Then Return $GUI_RUNDEFMSG
    Local $ParentPosArr = WinGetPos($hWndGUI)
    WinMove($Main_Gui, "", $ParentPosArr[0], $ParentPosArr[1])
    EndFunc

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

    Func WM_ACTIVATE($hWndGUI)
    If $hWndGUI = $BG Then WinActivate($Main_Gui)
    EndFunc

    [/autoit]


    2 Mal editiert, zuletzt von Greenhorn (27. November 2008 um 19:59)

    • Offizieller Beitrag

    Cool dein Beispielscript hat alles was ich brauche, danke dir . :thumbup::thumbup:

  • hier auch noch ein Beispiel:

    Ebay Widget

    Zur Nutzung dieses Forum's, ist ein Übersetzer für folgende Begriffe unerlässlich:

    "On-Bort, weier, verscheiden, schädliges, Butten steyling, näckstet, Parr, Porblem, scripe, Kompletenz, harken, manuel zu extramieren, geckukt, würglich, excell, acces oder Compilevorgeng"

    • Offizieller Beitrag

    Auch ein gutes Beispiel danke Micha_he. :thumbup: