Using ShellExecute() go online 
Author Message
 Using ShellExecute() go online

Hi all,

I used ShellExecute() go online,the problem is how can I launch an new IE
window(and keep previous one)?
Thanks for help

Heppy New Year!

Xiang



Mon, 17 Jun 2002 03:00:00 GMT  
 Using ShellExecute() go online
You could use something like this which will wait for the process to end.
Remove the part after ExitCode if you don't want to wait for the process to
end. You will also want to change the StartupInfo.wShowWindow value to a
value which doesn't hide the window.

Good Luck
Chris

STARTUPINFO StartupInfo;
GetStartupInfo(&StartupInfo);
PROCESS_INFORMATION ProcessInformation;
CString CommandLine;
BOOL retval;
DWORD ExitCode;
StartupInfo.dwFlags = 1;
StartupInfo.wShowWindow = 0;

BeginWaitCursor();

CommandLine = "Your.exe";

retval=CreateProcess(NULL, CommandLine.GetBuffer(CommandLine.GetLength()),
      NULL, NULL, 0, 0, NULL, NULL, &StartupInfo, &ProcessInformation);

  if (retval==FALSE)
  {
    AfxMessageBox("Error running "+ CString(CommandLine));
    return;
  }

  ExitCode;

  // wait until Your.exe is complete
  do
  {
    retval = GetExitCodeProcess(ProcessInformation.hProcess, &ExitCode);
    if (retval==FALSE)
    {
      CString errmsg="Error waiting for "+ CString(CommandLine) +" to end";
      AfxMessageBox(errmsg);
      return;
    }
  } while (ExitCode==STILL_ACTIVE);

EndWaitCursor();



Thu, 20 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. going from createprocess to shellexecute

2. Microsoft Systems Journal is going online !?

3. Clickable text -link to go online

4. PrintDlg when using ShellExecute

5. debugger detects memory leak after using shellexecute

6. ShellExecute fails when using SHGetSpecialFolderLocation?

7. Using ShellExecute in VC++

8. PrintDlg when using ShellExecute

9. Using shellexecute to invoke Direct:Connect (Sterling Software)

10. Need help using ShellExecute()

11. Memory Leaks when using Shellexecute

12. Printng Power Point documents using ShellExecute

 

 
Powered by phpBB® Forum Software