#include #include HMODULE IEProcessHelper::_hmoduleIEProcess = NULL; bool IEProcessHelper::_checkedIEProcess = false; const IETabWindowExports* IEProcessHelper::_TabWindowExports = NULL; const IETabWindowExports IEProcessHelper::_TabWindowExportsNotImpl = { IEProcessHelper::WaitForTabWindowNotImpl, IEProcessHelper::AcquireModalDialogLockAndParentNotImpl, IEProcessHelper::ReleaseModalDialogLockAndParentNotImpl, }; bool IEProcessHelper::IsIEProcess() { if (!_checkedIEProcess) { _hmoduleIEProcess = IEProcess::GetProcessModule(); _checkedIEProcess = true; } return _hmoduleIEProcess != NULL; } // NOTE: we don't care about race conditions here, because the result is immutable const IETabWindowExports* IEProcessHelper::TabWindow() { if (_TabWindowExports == NULL) { // try to load them if (IsIEProcess()) { _TabWindowExports = IEProcess::GetTabWindowExports(_hmoduleIEProcess); } else { _TabWindowExports = &IEProcessHelper::_TabWindowExportsNotImpl; } } return _TabWindowExports; } // these are dummy Exports that implement pass through logic for the real thing. HRESULT IEProcessHelper::WaitForTabWindowNotImpl( __in bool allowUnknownThread, __in HWND hwndParentProposed, __out HWND* phwndParentActual) { *phwndParentActual = hwndParentProposed; return S_OK; } HRESULT IEProcessHelper::AcquireModalDialogLockAndParentNotImpl( __in HWND hwndParentProposed, // proposed parent window for CreateWindow(), DialogBoxParam(), ShellExecute(), etc __out HWND* phwndParentActual, __out HANDLE* phModalDialogLock) { *phwndParentActual = hwndParentProposed; *phModalDialogLock = NULL; return S_OK; } void IEProcessHelper::ReleaseModalDialogLockAndParentNotImpl( __in_opt HANDLE hModalDialogLock) { }