int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prev, WCHAR *cmdline, int show) { static const WCHAR regserverW[] = {'r','e','g','s','e','r','v','e','r',0}; static const WCHAR unregserverW[] = {'u','n','r','e','g','s','e','r','v','e','r',0}; if(*cmdline == '-' || *cmdline == '/') { if(!strcmpiW(cmdline+1, regserverW)) return register_iexplore(TRUE); if(!strcmpiW(cmdline+1, unregserverW)) return register_iexplore(FALSE); } return IEWinMain(cmdline, show); }
/****************************************************************** * IEWinMain (SHDOCVW.101) * * Only returns on error. */ DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow) { IWebBrowser2 *wb = NULL; MSG msg; HRESULT hres; TRACE("%s %d\n", debugstr_a(szCommandLine), nShowWindow); if(*szCommandLine == '-' || *szCommandLine == '/') { if(!strcasecmp(szCommandLine+1, "regserver")) return register_iexplore(TRUE); if(!strcasecmp(szCommandLine+1, "unregserver")) return register_iexplore(FALSE); } CoInitialize(NULL); hres = register_class_object(TRUE); if(FAILED(hres)) { CoUninitialize(); ExitProcess(1); } if(strcasecmp(szCommandLine, "-embedding")) wb = create_ie_window(szCommandLine); /* run the message loop for this thread */ while (GetMessageW(&msg, 0, 0, 0)) { TranslateMessage(&msg); DispatchMessageW(&msg); } if(wb) IWebBrowser2_Release(wb); register_class_object(FALSE); CoUninitialize(); ExitProcess(0); return 0; }