This commit is contained in:
Vulpovile
2021-03-05 01:22:44 -08:00
parent f8dd5470da
commit f11bfa1536
2 changed files with 7 additions and 7 deletions

View File

@@ -24,5 +24,5 @@ class IEBrowser {
unsigned int FAR* puArgErr); unsigned int FAR* puArgErr);
private: private:
IWebBrowser2* webBrowser; IWebBrowser2* webBrowser;
HWND hwnd; HWND parentHwnd;
}; };

View File

@@ -65,7 +65,7 @@ HRESULT IEBrowser::doExternal(std::wstring funcName,
DWORD rgbCurrent = 0xFFFFFFFF; //Will be dynamic later DWORD rgbCurrent = 0xFFFFFFFF; //Will be dynamic later
ZeroMemory(&color, sizeof(CHOOSECOLOR)); ZeroMemory(&color, sizeof(CHOOSECOLOR));
color.lStructSize = sizeof(color); color.lStructSize = sizeof(color);
color.hwndOwner = hwnd; color.hwndOwner = parentHwnd;
color.lpCustColors = (LPDWORD) g_acrCustClr; color.lpCustColors = (LPDWORD) g_acrCustClr;
color.rgbResult = rgbCurrent; color.rgbResult = rgbCurrent;
color.Flags = CC_FULLOPEN | CC_RGBINIT; color.Flags = CC_FULLOPEN | CC_RGBINIT;
@@ -91,19 +91,19 @@ HRESULT IEBrowser::doExternal(std::wstring funcName,
} }
IEBrowser::IEBrowser(HWND attachHWnd) { IEBrowser::IEBrowser(HWND attachHWnd) {
webBrowser = 0;
parentHwnd = attachHWnd;
MSG messages; MSG messages;
while (PeekMessage (&messages, NULL, 0, 0,PM_REMOVE)) while (PeekMessage (&messages, NULL, 0, 0,PM_REMOVE))
{ {
if (IsDialogMessage(hwnd, &messages) == 0) if (IsDialogMessage(parentHwnd, &messages) == 0)
{ {
TranslateMessage(&messages); TranslateMessage(&messages);
DispatchMessage(&messages); DispatchMessage(&messages);
} }
} }
hwnd = attachHWnd; SendMessage(parentHwnd,AX_INPLACE,1,0);
webBrowser = 0; SendMessage(parentHwnd,AX_QUERYINTERFACE,(WPARAM)&IID_IWebBrowser2,(LPARAM)&webBrowser);
SendMessage(hwnd,AX_INPLACE,1,0);
SendMessage(hwnd,AX_QUERYINTERFACE,(WPARAM)&IID_IWebBrowser2,(LPARAM)&webBrowser);
} }
IEBrowser::~IEBrowser(void) { IEBrowser::~IEBrowser(void) {