Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ShellExecute

Status
Not open for further replies.

Casbah

Programmer
May 18, 2004
31
0
0
IE
What must I #include in my .cpp code to use ShellExecute?
And do I need to link Shell32.lib? or anything like that? If so how do I do that?
Thanks
 
include windows.h. You don't have to add additional linker deppendencies to use ShellExecute.

Ion Filipski
1c.bmp
 
nice one thanks. dont suppose anyone has anyideas why this isnt working for me?

void main(int argc, char *argv[])
{
ShellExecute(0,
"open", // Operation to perform
"C:\Program Files\TextPad 4\textpad.exe", //Application name
NULL, // Additional parameters
NULL, // Default directory
SW_SHOW);
return;
}
 
use \\ instead of "C:\\Program Files\\TextPad 4\\textpad.exe",

Ion Filipski
1c.bmp
 
I used the shell execute command in a program i just made lol! the file you need to include is:

#include "shellapi.h"

and an example shell execute syntax is:

void CNTACCOUNTFINDERDlg::OnEditpass()
{
HINSTANCE hReturn;
hReturn = ShellExecute( HWND_DESKTOP, "open", "ipc_pass.dic", "", "C:\\GNAF\\conf", SW_SHOW );
}
 
Can anyone recomend a good tutorial on creating DLL files with a veiw to using the functions in the contained within the files

IE making a call to a function within a compiled dll file

or does anyone know the basics of what is involved ?
 
>Killa
with your question you should start another thread

Ion Filipski
1c.bmp
 
I Did this by accident i have started a new thread
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top