Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grab and move a window to specific coordinates?
#1
Hi,
Can you please tell me how to grab a window from a random location and move it to specific coordinates? (i.e. the window pops up in random locations and I need to grab it and move it to specific coordinates with a hotkey).
Thanks,
Mark
#2
mark10 Wrote:Hi,
Can you please tell me how to grab a window from a random location and move it to specific coordinates? (i.e. the window pops up in random locations and I need to grab it and move it to specific coordinates with a hotkey).
Thanks,
Mark

Use the window as a trigger, than put this code in that function.
Code:
Copy      Help
int hwnd=val(_command)
act hwnd
mov 25 25 hwnd

Or if you dont want the macro to do it automatically and you want to hit F8 to move that window, than use F8 as trigger, and this code
Code:
Copy      Help
int hwnd=win("Mozilla Firefox")
act hwnd
mov 25 25 hwnd
#3
Well... I like using a hotkey better, but what if the window in named something different every time it pops up? (It always seems to be the same class, though).
Thanks



leaffan_99 Wrote:
mark10 Wrote:Hi,
Can you please tell me how to grab a window from a random location and move it to specific coordinates? (i.e. the window pops up in random locations and I need to grab it and move it to specific coordinates with a hotkey).
Thanks,
Mark

Use the window as a trigger, than put this code in that function.
Code:
Copy      Help
int hwnd=val(_command)
act hwnd
mov 25 25 hwnd

Or if you dont want the macro to do it automatically and you want to hit F8 to move that window, than use F8 as trigger, and this code
Code:
Copy      Help
int hwnd=win("Mozilla Firefox")
act hwnd
mov 25 25 hwnd
#4
Than in the trigger properties, remove the window name but keep the class


Forum Jump:


Users browsing this thread: 1 Guest(s)