Moving a window

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Madison01
Posts: 2
Joined: 14 May 2024, 12:41

Moving a window

14 May 2024, 12:56

Hello everybody!
I'm using the ChatGPT AutoHotkey Utility and loving it. Sometimes I have to work with just one screen, so it would be great if I could move de window of the answer tray.
Is that possible? How should I include in the .ahk file?
I'm sorry if I'm asking something basic, but I'm a total beginner.
Thanks in advance,

Jorge
WKen
Posts: 188
Joined: 21 Feb 2023, 00:01

Re: Moving a window

15 May 2024, 16:28

This was created when I was just learning AutoHotkey, not sure if it will be helpful to you.

Code: Select all

#Requires AutoHotkey v2
CoordMode "Mouse"

^m::      ; Ctrl+M
{
    MouseGetPos , , &id
	WinGetPos , , &WW, &WH, 'ahk_id ' id
    while getKeyState("m", "P") {
       MouseGetPos &x, &y
	   winMove x-(WW/2), y-(WH/2), , , 'ahk_id ' id
	   sleep 10
	}
}
Madison01
Posts: 2
Joined: 14 May 2024, 12:41

Re: Moving a window

03 Jun 2024, 09:01

Thank you for your help. I couldn't solve my problem with that solution, but I'll keep trying!
User avatar
kunkel321
Posts: 1172
Joined: 30 Nov 2015, 21:19

Re: Moving a window

03 Jun 2024, 09:51

Maybe try this: In your editor, press Ctrl+F and search for this line of code:

Code: Select all

Response_Window.Show("AutoSize Center")
Change Center to some x y values. For example

Code: Select all

Response_Window.Show("AutoSize x600 y400")
Experiment to get the right values. Also have h and w values if you want.

EDIT: Actually, height and width values might contradict Autosize. I'm not sure. Maybe take out Autosize if you assign values to all four (x y h w).

EDIT AGAIN: It occurred to me that you may simply want the ability to drag the window to a different location. If that is the case, find

Code: Select all

Response_Window := Gui("-Caption", "Response")
and change it to

Code: Select all

Response_Window := Gui(, "Response")
Don't remove that comma. :)
ste(phen|ve) kunkel

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: ntepa and 39 guests