Opens a URL in an Windows Internet Explorer process with an appropriate integrity level, and returns information about the new process.
Syntax
HRESULT IELaunchURL(
LPCWSTR pszUrl,
LPPROCESS_INFORMATION pProcInfo,
LPIELAUNCHURL lpInfo
);
Parameters
- pszUrl
-
[in] A pointer to a NULL-terminated string containing the URL to be opened. If this parameter is NULL, the user's home page is opened.
- pProcInfo
-
[in] A pointer to a PROCESS_INFORMATION structure that receives information about the process.
- lpInfo
-
[in] A pointer to an IELAUNCHURLINFO structure; can be NULL.
Return Value
Returns S_OK if the URL is sucessfully opened in a new Internet Explorer process, or an error value otherwise.
Example
The following example shows a function that opens Internet Explorer processes with an appropriate integrity level.
HRESULT LaunchIE(LPCWSTR pszURL)
{
PROCESS_INFORMATION procInfo;
procInfo.cbSize = sizeof(PROCESS_INFORMATION);
procInfo.dwCreationFlags = NULL;
IELAUNCHURLINFO launchInfo;
launchInfo.cbSize = sizeof(IELAUNCHURLINFO);
launchInfo.dwCreationFlags = NULL;
HRESULT hr = IELaunchURL(pszURL, &procInfo, &launchInfo);
if (SUCCEEDED(hr))
{
WaitForInputIdle(procInfo.hProcess, 2000);
CloseHandle(procInfo.hProcess);
CloseHandle(procInfo.hThread);
}
return hr;
}
Function Information
| Stock Implementation | ieframe.dll |
|---|
| Custom Implementation | No |
|---|
| Header | iepmapi.h |
|---|
| Import library | iepmapi.lib |
|---|
| Minimum availability | Internet Explorer
7 |
|---|
| Minimum operating systems |
Windows Vista |
|---|