summaryrefslogtreecommitdiffstats
path: root/src/activeqt/control/qaxserverbase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/activeqt/control/qaxserverbase.cpp')
-rw-r--r--src/activeqt/control/qaxserverbase.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index d11fbeb..4d277b6 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -1644,12 +1644,25 @@ HWND QAxServerBase::create(HWND hWndParent, RECT& rcPos)
}
Q_ASSERT(!m_hWnd);
+ // will fail if parent window belongs to a higher integrity level process
HWND hWnd = ::CreateWindow(reinterpret_cast<const wchar_t *>(cn.utf16()), 0,
WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
rcPos.left, rcPos.top, rcPos.right - rcPos.left,
rcPos.bottom - rcPos.top, hWndParent, 0, hInst, this);
// m_hWnd is assigned in reponse to WM_CREATE
if (!hWnd) {
+ DWORD err = GetLastError();
+ if (err == ERROR_ACCESS_DENIED) {
+ // retry without parent window
+ // the window will now need to be re-parented in the container process
+ hWnd = ::CreateWindow(reinterpret_cast<const wchar_t *>(cn.utf16()), 0,
+ WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ rcPos.left, rcPos.top, rcPos.right - rcPos.left,
+ rcPos.bottom - rcPos.top, nullptr, 0, hInst, this);
+ }
+ }
+
+ if (!hWnd) {
qErrnoWarning("%s: CreateWindow() failed", __FUNCTION__);
return nullptr;
}