|
-
May 2nd, 2008, 03:09 PM
#1
[RESOLVED] Emulating an Explorer double click from within my own app
Hi all. I am writing an application in wxWidgets for XP and Vista. Part of this application includes a tree control listing some files on the drive.
What I want to be able to do is when I trap a double click event on one of my tree items, I want to "open" that file in the same fashion that Explorer would use if the user dbl clicked on the same file.
My background is in UNIX so I'm slow with Windows-specific stuff. So far all I've figured out how to do is lookup in the registry the PersistentHandler for my file based on the extension.
The PersistentHandler is some ID I guess. How can I get the actual executable fullpathname from this ID?
Edit: Is there an easier way (some unknown Win func call?) for me to just have Windows sort all this out for me or is all this lookup in the registry the best way? E.g., ExplorerExecute(myFile)? That would be too easy.
-gw
Last edited by spartygw; May 2nd, 2008 at 03:12 PM.
Reason: Add more info
-
May 2nd, 2008, 03:19 PM
#2
Re: Emulating an Explorer double click from within my own app
ShellExecute is what you're looking for.
Viggy
-
May 2nd, 2008, 03:30 PM
#3
Re: Emulating an Explorer double click from within my own app
Good gosh, that is amazing! It took me longer to compose the question than for you to respond with the exact answer I had been googling for for hours.
I just implemented it in my code and it works beautifully! Thanks a ton!
-gw
-
May 2nd, 2008, 04:07 PM
#4
Re: Emulating an Explorer double click from within my own app
No prob. If you're going to be doing more Windows specific things, you might consider a good Windows API reference book.
The MSDN is pretty good, but sometimes you have to kinda know what your looking for, more specifically then your original question. 
Vig.
-
May 2nd, 2008, 04:14 PM
#5
Re: Emulating an Explorer double click from within my own app
Mr Viggy, thanks.
Yeah I'm finding the MSDN documentation is surprisingly good, it's just a matter of drilling down to the actual page I need! Grrr.
Tons of thanks again. I'm new to the website but will definitely contribute where there's a topic I can actually answer!
-gw
-
May 2nd, 2008, 09:05 PM
#6
Re: Emulating an Explorer double click from within my own app
 Originally Posted by spartygw
i had been googling for for hours.
???
ShellExecute() is a Usenet FAQ, that everyone knows as it returns 78 700 hits (!) in Google Groups
-
May 2nd, 2008, 09:22 PM
#7
Re: Emulating an Explorer double click from within my own app
Sure it returns all those hits if you know to search on the string "ShellExecute".
That was my point about MSDN. The documentation is there, it's just finding the proper search phrase to find it.
-gw
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|