How to launch internet explorer within a Metro application ?
-
Friday, October 14, 2011 9:51 AM
Hi,
I am trying to launch internet explorer from a Metro apps in C++. Nothing is appearing :/
I doing it with the following code sample:
STARTUPINFO siStartupInfo; PROCESS_INFORMATION piProcessInfo;memset(&siStartupInfo,0,sizeof(siStartupInfo));memset(&piProcessInfo,0,sizeof(piProcessInfo)); siStartupInfo.cb=sizeof(siStartupInfo);if(CreateProcess(NULL,"C:\\Program Files\\Internet Explorer\\iexplore.exe",0,0,FALSE, CREATE_DEFAULT_ERROR_MODE,0,0,&siStartupInfo,&piProcessInfo)==FALSE){//error}Can anyone help me to figure out what's wrong ?
Thanks
Christophe
All Replies
-
Friday, October 14, 2011 10:42 AM
-
Friday, October 14, 2011 11:08 AM
You cannot launch non-Metro apps from a Metro app. I'm sure there is a way to launch the Metro version of IE though.
I think the first statement is not exactly right. I have been able to launch a basic mfc windows application from Metro.
I found in the documentation (http://msdn.microsoft.com/en-us/library/windows/apps/hh464912%28v=VS.85%29.aspx) that from a Metro apps the resource i want to access must be:
"Base-trust, isolated in individual app containers with brokered access to protected resources (those affecting user data, identity, and privacy), and no access to system-critical resources."
If i run within a Desktop application way a web url ShellExecute, the Metro version of IE is launching.
Using this Desktop application as a pass-through doesn't work :/
I just don't care about IE Metro or Desktop style. I would like to be able to launch it in Metro. I am not able to find an example for :/
- Edited by Christophe H RICARD Friday, October 14, 2011 11:14 AM
-
Friday, October 14, 2011 2:40 PM
Would Launcher.LaunchDefaultProgram(Uri, LaunchingOptions) be a good alternative?
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
Friday, October 14, 2011 10:38 PMModerator
You cannot launch specific applications from a Metro style app. As Sheng Jiang says, you can use Launcher::LauncherDefaultProgram to launch whichever application is registered to handle a given document type or protocol. If you call LauncherDefautlProgram on a URL, it will open in the user's default browser.
CreateProcess is not available to Metro style apps. If you look in winbase.h you will see that it is in the desktop partition. See http://msdn.microsoft.com/en-us/library/windows/apps/br205757(v=VS.85).aspx for information on the Win32 API available to Metro style apps.
--Rob
- Proposed As Answer by DavidLambMicrosoft Employee, Moderator Tuesday, October 18, 2011 12:31 AM
- Marked As Answer by DavidLambMicrosoft Employee, Moderator Wednesday, November 02, 2011 12:48 AM


