matteoathen

Hi All,

I need help.

Does anyone knows how to open an exe file using ShellExecuteEx.

I would appreciate it if you could include the sample codes here.

Many thanks in advance.

Regards,

Matteoathen



Re: Smart Devices Native C++ Development ShellExecuteEx to open exe file

Smartdev75

SHELLEXECUTEINFO info;
memset(&info, 0, sizeof(SHELLEXECUTEINFO));

info.cbSize = sizeof(SHELLEXECUTEINFO);
info.fMask = SEE_MASK_FLAG_NO_UI;
info.lpVerb = _T ("open");
info.lpFile = sLink;
info.nShow = SW_SHOW;

return :Tongue TiedhellExecuteEx( &info );




Re: Smart Devices Native C++ Development ShellExecuteEx to open exe file

matteoathen

Hi Smartdev,

Thanks for the reply.

However, where do I put the link of the file to open Is it in sLink

Many thanks in advance.

Regards,

Matteoathen





Re: Smart Devices Native C++ Development ShellExecuteEx to open exe file

Guang-Ming Bian - MSFT

Hi Matteoathen,

lpFile

The address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include "open" for executable files and document files and "print" for document files for which a print handler has been registered. Other applications might have added Shell verbs through the system registry, such as "play" for .avi and .wav files. To specify a Shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter.

Note If the SEE_MASK_INVOKEIDLIST flag is set, you can use either lpFile or lpIDList to identify the item by its file system path or its PIDL respectively.

Note If the path is not included with the name, the current directory is assumed.

For more information, click the link below:

http://msdn2.microsoft.com/en-us/library/ms538315.aspx






Re: Smart Devices Native C++ Development ShellExecuteEx to open exe file

matteoathen

Hi Guang-Ming,

Thanks for your reply.

Regards,

Matteoathen