Kein maximieren unter windows 7?

  • Hallo, ich habe ein Problem was diese Funktion, bei der man lediglich das fenster gegen den oberen Rand des Bildschirms ziehen muss um es zu maximieren...
    Irgendwie klappt es nicht... (Genausowenig an den Seiten...)
    Die Funktion, ein Fesnter zu schütteln um alle anderen zu minimieren geht allerdings ?(

    Raupi meint bei ihr geht es mit autoit script einwandfrei...

    Naja, hier ist der Code, vieleicht findet ihr ja n Fehler...
    Danke schonmal, Das Schwert!

    Spoiler anzeigen
    [autoit]

    #include <WIndowsConstants.au3>
    #include <GuiConstants.au3>
    #include<EditConstants.au3>
    #include <Array.au3>
    #include <ButtonConstants.au3>
    $GUI = GUICreate ("Binary Converter", IniRead (@ScriptDir & "\options.ini", "gui", "width", 300), IniRead (@ScriptDir & "\options.ini", "gui", "height", 125), IniRead (@ScriptDir & "\options.ini", "gui", "PosLeft", 100), IniRead (@ScriptDir & "\options.ini", "gui", "PosTop", 100), BitOr ($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX))
    $convert = GUICtrlCreateButton ("Convert (B2Z)", 10, 28, 90, 20)
    $zahl = GUICtrlCreateInput ("", 10, 52, 270, 16)
    GUICtrlSetStyle (-1, $ES_NUMBER)
    $conv2 = GUICtrlCreateButton ("Convert (Z2B)", 10, 70, 90, 20)
    $10 = GUICtrlCreateInput ("", 10, 10, 270, 16)
    GUICtrlSetStyle (-1, $ES_NUMBER)
    GUISetState ()
    $msg = GUIGetMsg ()
    $Maxed = False
    While 1
    If $msg = -3 Then
    $pos = WinGetPos ("Binary Converter")
    Exit
    EndIf
    $msg = GUIGetMsg ()
    If $msg = $Convert Then ;Convert B2Z
    $splt = StringSplit (GUiCtrlRead($10), "")
    If GUICtrlRead ($10) == "" Then
    MsgBox (16, "Error!", "Please enter at least 1 number", Default, $GUI)
    ContinueLoop
    EndIf
    $i = $splt[0]
    $x = 1
    $count = $splt[0]
    Dim $splt2[$count +1]
    Do
    $splt2[$i] = $x
    $i -= 1
    $x *= 2
    Until $i +1 = 1
    $i = 1
    Do
    If $splt[$i] <> 0 Then
    $splt[$i] = $splt2[$i]
    EndIf
    $i += 1
    UNtil $i -1 = $splt[0]
    $ergebnis = 0
    $i = 1
    Do
    $ergebnis += $splt[$i]
    $i += 1
    Until $i -1 = $splt[0]
    MsgBox (0, "", $ergebnis, Default, $GUI)
    EndIf ;==> Convert B2Z
    If $msg = $conv2 Then ;Convert Z2B
    $zahl1 = GUICtrlRead ($zahl)
    If $zahl1 <= 255 Then
    Dim $01[9]
    $01[1] = 128
    $01[2] = 64
    $01[3] = 32
    $01[4] = 16
    $01[5] = 8
    $01[6] = 4
    $01[7] = 2
    $01[8] = 1
    ElseIf $zahl1 > 255 Then
    $zahl2 = $zahl1
    $true = False
    Do
    $f = 1
    Do
    $f *= 2
    Until $f >= $zahl2
    If $f = $zahl2 Then
    $true = True
    Else
    $zahl2 -= 1
    EndIf
    Until $true = True
    Dim $01[2]
    $01[1] = $zahl2
    Do
    $y = $01[UBound ($01)-1] /2
    _ArrayAdd ($01, $y)
    Until $01[UBound ($01)-1] = 1
    EndIf
    $ergebnis = ""
    $ergebnis2 = 0
    $i = 1
    Do
    If $ergebnis2 + $01[$i] < $zahl1 Or $ergebnis2 + $01[$i] = $zahl1 Then
    $ergebnis &= 1
    $ergebnis2 += $01[$i]
    ElseIf $ergebnis2 + $01[$i] >= $zahl1 Then
    $ergebnis &= 0
    EndIf
    $i += 1
    Until $i -1 = UBound ($01) -1
    MsgBox (0, "", $ergebnis, Default, $GUI)
    EndIf
    If $msg = $GUI_EVENT_MAXIMIZE Then
    GUICtrlSetPos($10, 0, 0, 1361, 289)
    GUICtrlSetPos($convert, 0, 296, 1363, 57)
    GUICtrlSetPos($zahl, 0, 360, 1361, 289)
    GUICtrlSetPos($conv2, 0, 656, 1363, 57)
    GUISetState(@SW_SHOW)
    EndIf
    If $msg = $GUI_EVENT_RESTORE Then
    GUICtrlSetPos($convert, 10, 28, 90, 20)
    GUICtrlSetPos($zahl, 10, 52, 270, 16)
    GUICtrlSetPos($conv2, 10, 70, 90, 20)
    GUICtrlSetPos($10, 10, 10, 270, 16)
    EndIf
    WEnd
    Func OnAutoItExit ()
    IniWrite (@ScriptDir & "\options.ini", "gui", "PosLeft", $pos[0])
    IniWrite (@ScriptDir & "\options.ini", "gui", "PosTop", $pos[1])
    EndFunc

    [/autoit]

    Theorie ist wenn man weiß wie's geht, aber nichts klappt.
    Praxis ist wenn's klappt aber man weiß nicht weiso.

    Bei Microsoft sind Theorie und Praxis vereint: Nichts klappt und keiner weiß wieso ;)

    Einmal editiert, zuletzt von Das Schwert (22. November 2009 um 19:33)

    • Offizieller Beitrag

    Probier das:

    Spoiler anzeigen
    [autoit]

    #include <WIndowsConstants.au3>
    #include <GuiConstants.au3>
    #include<EditConstants.au3>
    #include <Array.au3>
    #include <ButtonConstants.au3>
    $GUI = GUICreate ("Binary Converter", IniRead (@ScriptDir & "\options.ini", "gui", "width", 300), IniRead (@ScriptDir & "\options.ini", "gui", "height", 125), IniRead (@ScriptDir & "\options.ini", "gui", "PosLeft", 100), IniRead (@ScriptDir & "\options.ini", "gui", "PosTop", 100),BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS))
    $convert = GUICtrlCreateButton ("Convert (B2Z)", 10, 28, 90, 20)
    $zahl = GUICtrlCreateInput ("", 10, 52, 270, 16)
    GUICtrlSetStyle (-1, $ES_NUMBER)
    $conv2 = GUICtrlCreateButton ("Convert (Z2B)", 10, 70, 90, 20)
    $10 = GUICtrlCreateInput ("", 10, 10, 270, 16)
    GUICtrlSetStyle (-1, $ES_NUMBER)
    GUISetState ()
    $msg = GUIGetMsg ()
    $Maxed = False
    While 1
    If $msg = -3 Then
    $pos = WinGetPos ("Binary Converter")
    Exit
    EndIf
    $msg = GUIGetMsg ()
    If $msg = $Convert Then ;Convert B2Z
    $splt = StringSplit (GUiCtrlRead($10), "")
    If GUICtrlRead ($10) == "" Then
    MsgBox (16, "Error!", "Please enter at least 1 number", Default, $GUI)
    ContinueLoop
    EndIf
    $i = $splt[0]
    $x = 1
    $count = $splt[0]
    Dim $splt2[$count +1]
    Do
    $splt2[$i] = $x
    $i -= 1
    $x *= 2
    Until $i +1 = 1
    $i = 1
    Do
    If $splt[$i] <> 0 Then
    $splt[$i] = $splt2[$i]
    EndIf
    $i += 1
    UNtil $i -1 = $splt[0]
    $ergebnis = 0
    $i = 1
    Do
    $ergebnis += $splt[$i]
    $i += 1
    Until $i -1 = $splt[0]
    MsgBox (0, "", $ergebnis, Default, $GUI)
    EndIf ;==> Convert B2Z
    If $msg = $conv2 Then ;Convert Z2B
    $zahl1 = GUICtrlRead ($zahl)
    If $zahl1 <= 255 Then
    Dim $01[9]
    $01[1] = 128
    $01[2] = 64
    $01[3] = 32
    $01[4] = 16
    $01[5] = 8
    $01[6] = 4
    $01[7] = 2
    $01[8] = 1
    ElseIf $zahl1 > 255 Then
    $zahl2 = $zahl1
    $true = False
    Do
    $f = 1
    Do
    $f *= 2
    Until $f >= $zahl2
    If $f = $zahl2 Then
    $true = True
    Else
    $zahl2 -= 1
    EndIf
    Until $true = True
    Dim $01[2]
    $01[1] = $zahl2
    Do
    $y = $01[UBound ($01)-1] /2
    _ArrayAdd ($01, $y)
    Until $01[UBound ($01)-1] = 1
    EndIf
    $ergebnis = ""
    $ergebnis2 = 0
    $i = 1
    Do
    If $ergebnis2 + $01[$i] < $zahl1 Or $ergebnis2 + $01[$i] = $zahl1 Then
    $ergebnis &= 1
    $ergebnis2 += $01[$i]
    ElseIf $ergebnis2 + $01[$i] >= $zahl1 Then
    $ergebnis &= 0
    EndIf
    $i += 1
    Until $i -1 = UBound ($01) -1
    MsgBox (0, "", $ergebnis, Default, $GUI)
    EndIf
    If $msg = $GUI_EVENT_MAXIMIZE Then
    GUICtrlSetPos($10, 0, 0, 1361, 289)
    GUICtrlSetPos($convert, 0, 296, 1363, 57)
    GUICtrlSetPos($zahl, 0, 360, 1361, 289)
    GUICtrlSetPos($conv2, 0, 656, 1363, 57)
    GUISetState(@SW_SHOW)
    EndIf
    If $msg = $GUI_EVENT_RESTORE Then
    GUICtrlSetPos($convert, 10, 28, 90, 20)
    GUICtrlSetPos($zahl, 10, 52, 270, 16)
    GUICtrlSetPos($conv2, 10, 70, 90, 20)
    GUICtrlSetPos($10, 10, 10, 270, 16)
    EndIf
    WEnd
    Func OnAutoItExit ()
    IniWrite (@ScriptDir & "\options.ini", "gui", "PosLeft", $pos[0])
    IniWrite (@ScriptDir & "\options.ini", "gui", "PosTop", $pos[1])
    EndFunc

    [/autoit]
  • Wow, Danke, ich hab zwar nicht gefunden was anders ist, aber es geht... :D

    Nur das zur seitenwand des Desktops ziehen zerschießt das Programm noch total, aber ich nehm mal an das werd ich auch alleine schaffen... ;)

    Danke!

    Theorie ist wenn man weiß wie's geht, aber nichts klappt.
    Praxis ist wenn's klappt aber man weiß nicht weiso.

    Bei Microsoft sind Theorie und Praxis vereint: Nichts klappt und keiner weiß wieso ;)

    • Offizieller Beitrag

    Was sich geändert hat, ist der GUIStyle ;)