tags:

views:

145

answers:

2

I'm trying to get the position of a window. So I can write a script to double click to that.Is there any ways to do this :D

A: 

You might be better off getting a handle to the window and using SendMessage() (or whatever the equivalent is on whatever platform you're on) to send a double-click message.

Drew Hall
A: 

The question has autohotkey tag, so I assume it's about autohotkey, right? If yes, all you need is WinGetPos command, allowing you to get x,y coordinates of the upper left corner of the window.

WinGetPos [, X, Y, Width, Height, WinTitle, WinText, ExcludeTitle, ExcludeText]

First four parameters are the names of variables, that will get info about the window. Last four parameters are standard for almost all autohotkey Win-commands, they identify the window.

Simple example:

SetTitleMatchMode 2        ; so that IfWinExist match window title not only from the start
IfWinExist, Notepad
    WinGetPos, Xpos, Ypos  ; Uses the window found above.

This will put the Notepad window position into Xpos, Ypos variables.

stansult