Fenstergröße ändern

  • Hey,
    Ich möchte die Fenstergröße eines bestimmten Programmes verändern z.b auf 1x1 pixel.
    Mit welcher funktion geht das?
    MfG
    Becks

    Einmal editiert, zuletzt von oOBecksOo1337 (3. Juni 2010 um 00:10)

  • Ok das hab ich schonmal, jetzt möchte ich folgendes
    wenn man auf den button drückt soll eine inputbox erscheinen in der ich z.b 50x50 eingebe und dann wird das fenster auf 50x50 pixel gesetzt.

  • Hallo.

    Ich habe mal ein Bsp script für dich :)

    Öffne einfach mal dein Notepad (Windows Editor) und starte das Programm+ Scannen drücken.
    Dort kannst du nämlich die Größe des Fensterns dann anpassen :)

    Lange rede kurzer Sinn, hier das Script :)

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $gui = GUICreate("Remover", 0x00F5, 0x0109, 0x01DD, 0x00FD, 0x10C60000, 8)
    $scan = GUICtrlCreateButton("Scan", 5, 5, 0x0051, 0x001F)
    $resize = GUICtrlCreateButton("Resize", 5, 0x00C5, 0x0051, 0x001F)
    $clientlist = GUICtrlCreateList("", 0x005F, 5, 0x008D, 0x00C2)
    $size = GUICtrlCreateCombo("100", 0x005F, 0x00CC, 0x008D, 0x0019)
    GUICtrlSetData(-1, "50|30|10")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $scan
    update()
    Case $resize
    $p = WinGetPos(getclient())
    WinMove(getclient(), "", @DesktopWidth / 2 - ((@DesktopWidth / 100) * GUICtrlRead($size)) / 2, @DesktopHeight / 2 - ((@DesktopHeight / 100) * GUICtrlRead($size)) / 2, (@DesktopWidth / 100) * GUICtrlRead($size), (@DesktopHeight / 100) * GUICtrlRead($size))

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

    EndSwitch
    WEnd
    Func update()
    GUICtrlSetData($clientlist, "")
    Local $list = WinList("[CLASS:Notepad]")
    For $i=1 To $list[0][0]
    GUICtrlSetData($clientlist, $i-1 & " - " & $list[$i][0], $i-1 & " - " & $list[$i][0])
    Next
    EndFunc

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

    Func getclient()
    Local $x = StringSplit(GUICtrlRead($clientlist), " - ")
    Local $list = WinList("[CLASS:Notepad]")
    Return $list[$x[1]+1][1]
    EndFunc

    [/autoit]
  • Danke tuttifrutti du hast gleich 4 fragen von mir aufeinmal gelöst ohne sie zu kennen :D