Hey,
Ich möchte die Fenstergröße eines bestimmten Programmes verändern z.b auf 1x1 pixel.
Mit welcher funktion geht das?
MfG
Becks
Fenstergröße ändern
-
- [ gelöst ]
-
oOBecksOo1337 -
2. Juni 2010 um 22:35 -
Geschlossen -
Erledigt
-
-
[autoit]
WinMove
[/autoit] -
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. -
Dann benutze StringSplit und teile den Rückgabewert der Inputbox in X und Y auf. Danach benutzt du WinMove mit diesen Werten.
-
Würd ich aber eher 2 InputBoxen empfehlen, macht das ganze etwas einfacher
-
Und vergess GuiCtrlRead() beim Auslesen nicht
-
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 anpassenLange rede kurzer Sinn, hier das Script
Spoiler anzeigen
[autoit]#include <ButtonConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$gui = GUICreate("Remover", 0x00F5, 0x0109, 0x01DD, 0x00FD, 0x10C60000,
$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 ###While 1
[/autoit] [autoit][/autoit] [autoit]
$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))EndSwitch
[/autoit] [autoit][/autoit] [autoit]
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
EndFuncFunc getclient()
[/autoit]
Local $x = StringSplit(GUICtrlRead($clientlist), " - ")
Local $list = WinList("[CLASS:Notepad]")
Return $list[$x[1]+1][1]
EndFunc -
Danke tuttifrutti du hast gleich 4 fragen von mir aufeinmal gelöst ohne sie zu kennen