Jump to content
Sign in to follow this  
jaganshankar

Get Coordinates of an Selected item from Window Explorer

Recommended Posts

jaganshankar

hi ,

I have a open a window explorer with a specific path say c:\ and i hav selected a file while opening the folder itself.Now i like to get coordinates of that selected file.Urgent.........

Now what i have got is a folder has been opened witha selected file.How to get the coordinates of the selected file......

I am using Run(explorer.exe /select,C:\test.txt)

What next to get the coordinates of the test.txt file?????????????????????..................

Thanks in Advance.....

- S.J

Share this post


Link to post
Share on other sites
Siao

Make use of AutoIt Window Info tool when automating.

#include <GUIListView.au3>

Run("explorer.exe /select," & @ScriptFullPath)
WinWaitActive("[Class:CabinetWClass]","",5000)
$hLV = ControlGetHandle("","","[Class:SysListView32;Instance:1]")
$aRect = _GUICtrlListView_GetItemRect($hLV, _GUICtrlListView_GetSelectedIndices($hLV))
MsgBox(0, '', $aRect[0] & "," & $aRect[1] & "; " & $aRect[2] & "," & $aRect[3])

Exit

"be smart, drink your wine"

Share this post


Link to post
Share on other sites
jaganshankar

Make use of AutoIt Window Info tool when automating.

#include <GUIListView.au3>

Run("explorer.exe /select," & @ScriptFullPath)
WinWaitActive("[Class:CabinetWClass]","",5000)
$hLV = ControlGetHandle("","","[Class:SysListView32;Instance:1]")
$aRect = _GUICtrlListView_GetItemRect($hLV, _GUICtrlListView_GetSelectedIndices($hLV))
MsgBox(0, '', $aRect[0] & "," & $aRect[1] & "; " & $aRect[2] & "," & $aRect[3])

Exit

Hi ,

it gives me some coordiantes but not the selected file coordinates.Can u please help me out .

urgent .....

Share this post


Link to post
Share on other sites
Siao

You are not even trying.

It gives coordinates of the selected item rectangle. Relative to the listview window. What you would see in Window Info tool under Control tab as "ControlClick coords".


"be smart, drink your wine"

Share this post


Link to post
Share on other sites
jaganshankar

I m really sorry , i m newbie and i m unaware of the auto winodw info tool theni found it gives those coordinates .

I m trying to set Opt("MouseCoordMode",0)

Sets the way coords are used in the mouse functions, either absolute coords or coords relative to the current active window:

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

I tried to set the same above command but still it takes the screen size only.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.