ShellExecute command

Hi all,
What is the use of ShellExecute command in mfc programming ?
What kind of files can it execute?
Can we use this for executing an installation msi?
Pls help...
[192 byte] By [sundareveryours] at [2007-11-19 6:07:15]
# 1 Re: ShellExecute command
It can execute all files. It opens the file with the registered application.

So if you execute a word document, it will open word and word will open you document. You can also execute executables (applications).

See MSDN for more details. And here on dev-archive are a lot of examples how to use ShellExecute, but you can better use ShellExecuteEx.
Tischnoetentoet at 2007-11-11 0:32:35 >
# 2 Re: ShellExecute command
Using ShellExecute() is almost equivalent to double clicking a file in Windows Explorer. For example, if the file externsion is bmp, it would launch the associated Paint program to open the file. As long as the Windows Registry stores the association of the application to a file extension, you can use ShellExecution().
Kheun at 2007-11-11 0:33:35 >
# 3 Re: ShellExecute command
Have a look at this FAQ ( http://www.dev-archive.com/forum/showthread.php?t=302501)
Ejaz at 2007-11-11 0:34:30 >
# 4 Re: ShellExecute command
Here is a sample code:

#ifndef _WIN32_WCE
CString strPATH;
if (GetAutoLaunchPATH() && OverPATH(PointCellRelative, strPATH))
ShellExecute(NULL, _T("open"), strPATH, NULL,NULL, SW_SHOWMAXIMIZED);
#endif

strPATH is the path of the file that you try to execute.
If you know the path the if test is not necesary...This it's a sample from my code. So, you can ignore it.
All the best! :rolleyes:
Maximus_X at 2007-11-11 0:35:35 >
# 5 Re: ShellExecute command
well mate try and look up this link
Processes: How can I start a process? ( http://dev-archive.com//FAQ)
Inteligent link... :D Have you try it?
Maximus_X at 2007-11-11 0:36:32 >
# 6 Re: ShellExecute command
sorry mate messed up that link.
here now try this one. and well yes i did try it and well i really can't stop giving my back a pat. :D
Processes: How can I start a process? (http://www.dev-archive.com//forums//Visual C++ & C++ Programming// Visual C++ FAQs//)

i do hope i got the url right this time.

sam
techsam at 2007-11-11 0:37:32 >
# 7 Re: ShellExecute command
sorry mate messed up that link.
here now try this one. and well yes i did try it and well i really can't stop giving my back a pat. :D
Processes: How can I start a process? (http://www.dev-archive.com//forums//Visual C++ & C++ Programming// Visual C++ FAQs//)

i do hope i got the url right this time.

sam
Why don't you test the link first? The link that you said is wrong... :sick:
Maximus_X at 2007-11-11 0:38:35 >
# 8 Re: ShellExecute command
http://www.dev-archive.com/forum/showthread.php?t=302501
Mick at 2007-11-11 0:39:42 >