Click here to Skip to main content
15,883,904 members
Please Sign up or sign in to vote.
4.33/5 (3 votes)

Hi,

I want to write some code which will double-click a desktop shortcut. Or the alternate way is, how can I run a desktop shurtcut using Createprocess() API.

Which EXE is responsible to launch Start->Run window?

Thanks in advance.

Posted
Updated 25-Aug-09 10:19am
v2

birajendu wrote:
I want to write some code which will double click a desktop shortcut. or the alternate way is how can i run a desktop shurtcut using Createprocess() api.


If you know the path to the desktop shortcut, then you should be able to use ShellExecute to open it. If you need a process handle (the only reason I can think that you might want to use CreateProcess for this), then ShellExecuteEx will let you do that.

birajendu wrote:
Which exe is responsible to lunch Start->Run window?


Windows Explorer.

 
Share this answer
 

Don't start processes by simulating behaviors of the user, such as double clicking shortcuts. You never know what the shortcut points to!

Also, insanity lives down that road. Sooner or later you'll be opening the control panel applet by simulating mouse clicks on the start menu...

 
Share this answer
 
This question is not answered. Windows Explorer (explorer.exe) is indeed responsible, but how can one call it problematically as if the user double clicked an application's icon?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900