Author |
Topic |
|
ms08233
17 Posts |
Posted - 02 Oct 2003 : 17:09:59
|
The previous thread by this name (on 08/08/2002) was locked, so this is a continuation.
I want to boot up directly to my application, without the CE desktop or taskbar, and I know how to do that (as discussed in the previous thread). But then I want to be able to push a button on my application that exits the application and brings up the desktop. The previous thread mentioned using CreateProcess to accomplish this, but I've never used it before, so I have some questions:
1) If I start explorer.exe with CreateProcess, and then exit my application, will explorer keep running?
2) If I then restart my application using an icon on the desktop, and exit it again (calling CreateProcess again), will I then have 2 copies of explorer running? If so, how do I prevent that?
3) CreateProcess has a lot of parameters, but it looks like I can set most of them to NULL. I don't need to pass parameters, so can I set lpszCmdLine to NULL? Do I need any of the flags in fdwCreate? Do I have to create a PROCESS_INFORMATION structure and pass it in lppiProcInfo or can that be NULL? Do I have to use CloseHandle on something before my application exits? I guess I'm saying I need some sample code to illustrate this function!
Thanks, Michael Schwab
|
|
ctacke
877 Posts |
Posted - 02 Oct 2003 : 17:26:15
|
#LaunchingExplorer
Launching Explorer Programmatically
1. Yes. It is an entirely separate process and running CreateProcess is no different than if you double-tapped the app.
2. Yes. Explorer is somewhat unique. The first instance that runs shows up as the desktop. Each instance after that is the familiar Windows Explorer that shows directories, files, etc. Probably the simplest way to prevent a second instance of explorer from coming up is to keep some sort of "flag" to determine if it's been run already. Creating a temp file when you create the first one would work - just simply check for the file's existence when your app exists, if it's there, don't start explorer again.
3. You can pass NULL or 0 to everything, including the PROCESS_INFORMATION structure.
CreateProcess(_T("explorer.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);
|
|
|
|
Topic |
|
|
|