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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shellexecute() not work...

Status
Not open for further replies.

LoneRanger123

Programmer
Dec 19, 2000
62
GB
I have this code...

ShellExecute(0,"open","C:\\Program Files\\Internet Explorer\\iexplore.exe",NULL,NULL,0);

now, that compiles okay, but when i run it it doesnt do anything... iexplore.exe doesnt run.

I have XP, and my m8 has 2k, and it dont work for him either, is that why? and if so what other commands can I use, I want it to run seperate from my program, and I dont want my program to wait for a response or anything.

its set after a button click so I know it is ran :)
 
1. Check if the IE location (c:\\progra..) is correct.

2. Try to call the function with "Handle" parameter (I assume you are using BCB!!!). Like this:
Code:
ShellExecute(Handle,"open","C:\\Program Files\\Internet   Explorer\\iexplore.exe",NULL,NULL,SW_SHOWDEFAULT);

3. Check the eventual error
Code:
ShellExecute
returns (the return value is integer, if that value is > 0 then error ocurred). Bye, Rolandfg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top