How to move a control? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
adrian88888888
Posts: 84
Joined: 13 Mar 2020, 22:51

How to move a control?

Post by adrian88888888 » 14 Oct 2021, 19:12

I have this program:
Image
I want to move the window that is on the middle
Is not a window, is actually a control
So my question is, how do I get the pointer to the control and then how do I move it?
This is my best try:

Code: Select all

GetPointerToControl(){
    ControlGetFocus, activeControl, ahk_class TFruityLoopsMainForm
    return %activeControl%
}
The active control returned is "TStepSeqForm1"
Then I move the control with:

Code: Select all

ControlMove, ahk_class TStepSeqForm1, 0, 0
But it does not move, what i'm doing wrong?
Thanks in advance

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: How to move a control?  Topic is solved

Post by mikeyww » 15 Oct 2021, 06:23

Control: Can be either ClassNN (the classname and instance number of the control) or the control's text, both of which can be determined via Window Spy. When using text, the matching behavior is determined by SetTitleMatchMode. If this parameter is blank, the target window's topmost control will be used.
Example

It might work (no guarantee) if you remove ahk_class from the control name, and add the WinTitle.

Code: Select all

ControlMove, TStepSeqForm1, 0, 0,,, ahk_class TFruityLoopsMainForm

adrian88888888
Posts: 84
Joined: 13 Mar 2020, 22:51

Re: How to move a control?

Post by adrian88888888 » 15 Oct 2021, 13:33

mikeyww wrote:
15 Oct 2021, 06:23
Control: Can be either ClassNN (the classname and instance number of the control) or the control's text, both of which can be determined via Window Spy. When using text, the matching behavior is determined by SetTitleMatchMode. If this parameter is blank, the target window's topmost control will be used.
Example

It might work (no guarantee) if you remove ahk_class from the control name, and add the WinTitle.

Code: Select all

ControlMove, TStepSeqForm1, 0, 0,,, ahk_class TFruityLoopsMainForm
It works now, thanks a lot man!!!!!!

Post Reply

Return to “Ask for Help (v1)”