I have created an MFC EXE and I have added a button. Now I want IExplorer.exe to open when I click the button. The same as Shell("IExplorer.exe") in VB.
void CTestDlg::OnOpenButton()
{
// open iexplorer.exe code
}
How can I do this?
Printable View
I have created an MFC EXE and I have added a button. Now I want IExplorer.exe to open when I click the button. The same as Shell("IExplorer.exe") in VB.
void CTestDlg::OnOpenButton()
{
// open iexplorer.exe code
}
How can I do this?
try this...
PHP Code:ShellExecute(hDlg, "open", "IExplorer.exe", NULL, NULL, SW_SHOWNORMAL);
Hmm that didn't work. It gave me a error at the Dlg parameter. I don't have that identifier identified. I tried to NULL and it compiled successfully but nothing happend in the program.
What shall I do :(
well if you're trying to run Internet Explorer, you need to execute iexplore.exe .. you may also have to supply the path.
additionally, if the return value of ShellExecute is <32 there was an error...
What do you mean I have to execute it? Thats the problem I'm having :)
I want to be able to execute other programs from my program.
ShellExecute doesn't seem to work, hmm..
Let's say I want to execute test.exe from my program and test.exe is in the same directory as my program, how would I do?
Try:
However it is a lot better to use the ShellExecute API.Code:WinExec("test.exe",SW_SHOW);
ShellExecute(hwnd, "test.exe", 0, 0, SW_SHOW)
don't use WinExec() ... it's kept for 16-bit compatibility only...
for more information check out the MSDN Library @ msdn.microsoft.com
Ahh thanks alot guys! It works now.
Thanks again.