WinLaucher启动
生活随笔
收集整理的這篇文章主要介紹了
WinLaucher启动
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(HINSTANCE, HINSTANCE, LPTSTR, int nCmdShow)
{
? ??MyRegisterClass(hInst); 注冊Main窗口類
? ? hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
? ? ? ? ? ? ? ? ? ? ? ?CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInst, 0); 創建Main窗口
? ? hURLBarWnd = CreateWindow(L"EDIT", 0,
? ? ? ? ? ? ? ? ? ? WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL,?
? ? ? ? ? ? ? ? ? ? 0, 0, 0, 0,
? ? ? ? ? ? ? ? ? ? hMainWnd,
? ? ? ? ? ? ? ? ? ? 0,
? ? ? ? ? ? ? ? ? ? hInst, 0); 創建地址欄
? ? ShowWindow(hMainWnd, nCmdShow);
? ? UpdateWindow(hMainWnd);
? ? HRESULT hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, reinterpret_cast<void**>(&gWebView)); ?創建WebView
? ? gWebHost = new WinLauncherWebHost(); ?創建FrameLoadDelegate
? ? hr = gWebView->setFrameLoadDelegate(gWebHost);
? ? gPrintDelegate = new PrintWebUIDelegate; 創建UIDelegate
? ? hr = gWebView->setUIDelegate(gPrintDelegate);
? ? hr = gWebView->setHostWindow(reinterpret_cast<OLE_HANDLE>(hMainWnd));
? ? hr = gWebView->initWithFrame(clientRect, 0, 0); WebView初始化
? ? ? ? ? ??registerWebViewWindowClass();
? ? ? ? ? ? m_viewWindow = CreateWindowEx(0, kWebViewWindowClassName); 創建ViewWindow
? ? ? ? ? ? ? ? ? ?ViewWindow窗口過程函數(WebView::WebViewWndProc)
? ? ? ? ? ??m_page = new Page(pageClients);? 創建Page
? ? ? ? ? ??WebFrame* webFrame = WebFrame::createInstance();創建WebFrame?
? ? ? ? ? ??SetWindowLongPtr(m_viewWindow, 0, (LONG_PTR)this);將WebView指針保持在窗口里
? ?
? ? resizeSubViews(); 調整ViewWindow和地址欄位置
? ? ShowWindow(gViewWindow, nCmdShow);
? ? UpdateWindow(gViewWindow);
? ? while (GetMessage(&msg, NULL, 0, 0)) { 主窗口消息循環
? ? ? ? if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
? ? ? ? ? ? TranslateMessage(&msg);
? ? ? ? ? ? DispatchMessage(&msg);
? ? ? ? }
? ? }
}
?
?
?
? ?
? ?
}
{
? ??MyRegisterClass(hInst); 注冊Main窗口類
? ? hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
? ? ? ? ? ? ? ? ? ? ? ?CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInst, 0); 創建Main窗口
? ? hURLBarWnd = CreateWindow(L"EDIT", 0,
? ? ? ? ? ? ? ? ? ? WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL,?
? ? ? ? ? ? ? ? ? ? 0, 0, 0, 0,
? ? ? ? ? ? ? ? ? ? hMainWnd,
? ? ? ? ? ? ? ? ? ? 0,
? ? ? ? ? ? ? ? ? ? hInst, 0); 創建地址欄
? ? ShowWindow(hMainWnd, nCmdShow);
? ? UpdateWindow(hMainWnd);
? ? HRESULT hr = WebKitCreateInstance(CLSID_WebView, 0, IID_IWebView, reinterpret_cast<void**>(&gWebView)); ?創建WebView
? ? gWebHost = new WinLauncherWebHost(); ?創建FrameLoadDelegate
? ? hr = gWebView->setFrameLoadDelegate(gWebHost);
? ? gPrintDelegate = new PrintWebUIDelegate; 創建UIDelegate
? ? hr = gWebView->setUIDelegate(gPrintDelegate);
? ? hr = gWebView->setHostWindow(reinterpret_cast<OLE_HANDLE>(hMainWnd));
? ? hr = gWebView->initWithFrame(clientRect, 0, 0); WebView初始化
? ? ? ? ? ??registerWebViewWindowClass();
? ? ? ? ? ? m_viewWindow = CreateWindowEx(0, kWebViewWindowClassName); 創建ViewWindow
? ? ? ? ? ? ? ? ? ?ViewWindow窗口過程函數(WebView::WebViewWndProc)
? ? ? ? ? ??m_page = new Page(pageClients);? 創建Page
? ? ? ? ? ??WebFrame* webFrame = WebFrame::createInstance();創建WebFrame?
? ? ? ? ? ??SetWindowLongPtr(m_viewWindow, 0, (LONG_PTR)this);將WebView指針保持在窗口里
? ?
? ? resizeSubViews(); 調整ViewWindow和地址欄位置
? ? ShowWindow(gViewWindow, nCmdShow);
? ? UpdateWindow(gViewWindow);
? ? while (GetMessage(&msg, NULL, 0, 0)) { 主窗口消息循環
? ? ? ? if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
? ? ? ? ? ? TranslateMessage(&msg);
? ? ? ? ? ? DispatchMessage(&msg);
? ? ? ? }
? ? }
}
?
?
?
? ?
? ?
}
總結
以上是生活随笔為你收集整理的WinLaucher启动的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: css float(脱离正常流:向左/右
- 下一篇: Typeface 字体样式