2 Guis, innere Gui mitverschieben

  • Hallo Forum,

    habe folgendes Problem, sobald ich die erste Gui verschiebe, verschiebe ich nur Gui1, GUI2 wird nicht mit verschoben.
    Da ich lange pause gemacht habe fällt mir leider nicht der Befehl ein wie ich die Gui verankern kann, danke für die Hilfe...

    Beispiel:

    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ScrollBarConstants.au3>
    #include <GuiScrollBars.au3>
    #include <WindowsConstants.au3>
    $gui = GUICreate("Forum ", 633, 447, 190, 220)
    $acalabeltop = GUICtrlCreateLabel("Forum", 240, 8, 200)
    GUICtrlSetFont($acalabeltop, 18, "", "", "Copperplate Gothic Bold")
    GUISetBkColor(0xFFFFFF)
    $weiter = GUICtrlCreateButton("Weiter", 448, 410, 100, 25)
    $abbrechen = GUICtrlCreateButton("Beenden", 264, 410, 100, 25)
    $zurueck = GUICtrlCreateButton("Zurück", 72, 410, 100, 25)
    GUICtrlCreateGroup("Bereich zum scrollen", 16, 73, 601, 286)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlSetFont(-1, 10, 400, 4, "MS Sans Serif")
    GUICtrlCreateLabel("Telefonnummer:", 200, 376, 80, 17)
    $telefon = GUICtrlCreateInput("", 304, 374, 121, 21)
    ;~ $Pic1 = GUICtrlCreatePic($inifilepath & "logo.jpg", 485, 0,"","", "")
    GUISetState(@SW_SHOW,$gui)

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

    $hChild = GUICreate("Scrollbereich",581,263,26,88,$WS_POPUP,$WS_EX_MDICHILD,$gui)
    _GUIScrollBars_Init($hChild)
    _GUIScrollBars_ShowScrollBar($hChild, $SB_HORZ,False) ; horizontale Scrollbar verstecken
    GUICtrlCreateButton("test",100,100,100,20)
    GUISetState(@SW_SHOW,$hChild)
    GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL")

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

    While 1
    ;~ danke
    WEnd

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

    Func WM_VSCROLL($hWnd, $Msg, $wParam, $lParam)
    #forceref $Msg, $wParam, $lParam
    Local $nScrollCode = BitAND($wParam, 0x0000FFFF)
    Local $index = -1, $yChar, $yPos
    Local $Min, $Max, $Page, $Pos, $TrackPos

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

    For $x = 0 To UBound($aSB_WindowInfo) - 1
    If $aSB_WindowInfo[$x][0] = $hWnd Then
    $index = $x
    $yChar = $aSB_WindowInfo[$index][3]
    ExitLoop
    EndIf
    Next
    If $index = -1 Then Return 0

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

    ; Get all the vertial scroll bar information
    Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT)
    $Min = DllStructGetData($tSCROLLINFO, "nMin")
    $Max = DllStructGetData($tSCROLLINFO, "nMax")
    $Page = DllStructGetData($tSCROLLINFO, "nPage")
    ; Save the position for comparison later on
    $yPos = DllStructGetData($tSCROLLINFO, "nPos")
    $Pos = $yPos
    $TrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos")

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

    Switch $nScrollCode
    Case $SB_TOP ; user clicked the HOME keyboard key
    DllStructSetData($tSCROLLINFO, "nPos", $Min)

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

    Case $SB_BOTTOM ; user clicked the END keyboard key
    DllStructSetData($tSCROLLINFO, "nPos", $Max)

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

    Case $SB_LINEUP ; user clicked the top arrow
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - 1)

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

    Case $SB_LINEDOWN ; user clicked the bottom arrow
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + 1)

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

    Case $SB_PAGEUP ; user clicked the scroll bar shaft above the scroll box
    DllStructSetData($tSCROLLINFO, "nPos", $Pos - $Page)

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

    Case $SB_PAGEDOWN ; user clicked the scroll bar shaft below the scroll box
    DllStructSetData($tSCROLLINFO, "nPos", $Pos + $Page)

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

    Case $SB_THUMBTRACK ; user dragged the scroll box
    DllStructSetData($tSCROLLINFO, "nPos", $TrackPos)
    EndSwitch

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

    ;~ // Set the position and then retrieve it. Due to adjustments
    ;~ // by Windows it may not be the same as the value set.

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

    DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS)
    _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO)
    ;// If the position has changed, scroll the window and update it
    $Pos = DllStructGetData($tSCROLLINFO, "nPos")

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

    If ($Pos <> $yPos) Then
    _GUIScrollBars_ScrollWindow($hWnd, 0, $yChar * ($yPos - $Pos))
    $yPos = $Pos
    EndIf

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

    Return $GUI_RUNDEFMSG

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

    EndFunc ;==>WM_VSCROLL

    [/autoit]
  • habt ihr das Fenster verschoben?
    bei wird alles verschoben bis auf den Inhalt (graue Fläsche mit dem Testbutton bleibt auf gleicher Position)

  • Hi,

    bei mir wird ebenfalls alles verschoben: verschiebe Gui + Inhalt (graue Fläche mit Button) wandert mit.
    XP Prof SP3 32Bit, AutoIt 3.3.6.1

    ;-))
    Stefan

  • Danke euch!


    Problem besteht bei allen Rechnern meiner Firma, muss also ein Grafikkartentreiberproblem sein, was meint ihr?


    Hab das Problem nun so gelöst, unschön aber das hilft (Minimieren, Restore)

    [autoit]


    $pos_gui = WinGetPos("ACA")
    If $pos_gui2[1] <> $pos_gui[1] or $pos_gui2[2] <> $pos_gui[2] or $pos_gui2[3] <> $pos_gui[3] or $pos_gui2[0] <> $pos_gui[0] Then
    $pos_gui2[1] = $pos_gui[1]
    $pos_gui2[2] = $pos_gui[2]
    $pos_gui2[3] = $pos_gui[3]
    $pos_gui2[0] = $pos_gui[0]
    WinSetState("ACA","",@SW_MINIMIZE )
    WinSetState("ACA","",@SW_RESTORE)
    EndIf

    [/autoit]