Sign in to follow this  
Followers 0
RobertBedrosian

Name of Manually Selected File in Directory

6 posts in this topic

I have a really awful way of getting the name of a selected file in a directory.

Surely, there's a better way, but I can't find it in Help. Help, please.

Func GetFileName()

Send("{APPSKEY}")

Sleep(200)

Send("m")

Sleep(200)

Send("^{c}")

Send("{ESC}")

$filename = ClipGet()

; MsgBox(0, "", $filename)

EndFunc ;==>GetFileName

Share this post


Link to post
Share on other sites



You haven't explained the circumstances, but would FileOpenDialog help?

William

Share this post


Link to post
Share on other sites

If you're using Win XP ( unsure about Vista ), your explorer and desktop are SysListview32's.

Which means you can access them via the _GUICtrlListView_* functions. And ultimately find which were highlighted and get the text from that.

On Win 7 ( the machine I have access to now ), my desktop is SysListview32, however, explorer is DirectUIHWND.

I'm unsure off hand how to automate that, maybe if you did some research into it, you could find a cleaner method than what you're using now along the lines of what I said about the _GUICtrlListview* functions.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Check out the combined function KaFu made called '_WindowsExplorer_ExtractSelectedDirAndFiles' in

Share this post


Link to post
Share on other sites

Hi

I made a gui for registering ocx/dll files.

The File Open dialogue box opens up giving only extension names *.ocx or *.dll

Is this of any help/idea?

rgds

test Registering file .au3

Share this post


Link to post
Share on other sites

Check out the combined function KaFu made called '_WindowsExplorer_ExtractSelectedDirAndFiles' in

Thanks Ascend4nt for your kindness. That was JUST what I was looking for.

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  
Followers 0