Abfragen von Positionen von Fenstern Topic is solved

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

GamerG1rl
Posts: 48
Joined: 23 Nov 2017, 04:44

Abfragen von Positionen von Fenstern

15 Oct 2018, 03:27

Hallöchen,

ich würde gerne ein kleine Snippet machen, welches die Position von Fenstern beim drücken eines buttons in die Ini schreibt, sodass quasi jeder seine fenster selbst anordnen kann.

Code: Select all

iniread, x1, %A_ScriptDir%\myfile.ini, 1, xpos
iniread, y1, %A_ScriptDir%\myfile.ini, 1, ypos

iniread, x2, %A_ScriptDir%\myfile.ini, 2, xpos
iniread, y2, %A_ScriptDir%\myfile.ini, 2, ypos


}
Gui, 2:Destroy
Gui, 2:Add, DropDownList, x43 y39 w100 gHauptmenu vBenutzer,Benutzer1|Benutzer2|

Gui, 2:Font, s8 Bold, Verdana

Gui, 2:Add, Text, x25 y9 w300 h20 , Bitte Benutzer wählen

Gui, 2:Show, x%x2% y%y2% h94 w191,
Gui, 3:Destroy
Return

2GuiClose:
ExitApp
vermutlich ist das aber nicht so ohne weiteres möglich oder ?
GamerG1rl
Posts: 48
Joined: 23 Nov 2017, 04:44

Re: Abfragen von Positionen von Fenstern  Topic is solved

15 Oct 2018, 06:20

#Closed

hab eine Möglichkeit gefunden.

Code: Select all

iniread, x1, %A_ScriptDir%\myfile.ini, 1, xpos
iniread, y1, %A_ScriptDir%\myfile.ini, 1, ypos

Goto, Benutzer_Auswahl
; ###########################################

Ini1:
WinGetPos, Xpos1, Ypos1, , , Gui 1
iniwrite, x%Xpos1%, %A_ScriptDir%\myfile.ini, 1, xpos
iniwrite, y%Ypos1%, %A_ScriptDir%\myfile.ini, 1, ypos
return
somit hab ich meine x und y positionen in die Ini geschrieben und kann diese mit %x1% und %y1% wieder auslesen und einfügen :)

Return to “Ich brauche Hilfe”

Who is online

Users browsing this forum: No registered users and 61 guests