From cac3d39fa193723c21c11e8f3e7df4d5b6704488 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 30 Oct 2017 19:12:16 +0100 Subject: [PATCH] Don't explicitly attach progress dialog thread input This is actually completely unnecessary because this is done implicitly by Windows itself anyhow when we create the dialog with the owner window belonging to a different thread. Notice that this also explains why the thread input can't be detached later. --- src/msw/progdlg.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 2ef1d5c9d4..6c6e6e0bfe 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -1028,26 +1028,6 @@ void* wxProgressDialogTaskRunner::Entry() parent = m_sharedData.m_parent; } - if ( parent ) - { - // Force the creation of the message queue for this thread. - MSG msg; - ::PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); - - // Attach its message queue to the main thread in order to allow using - // the parent window created by the main thread as task dialog parent. - if ( !::AttachThreadInput(::GetCurrentThreadId(), - wxThread::GetMainId(), - TRUE) ) - { - wxLogLastError(wxT("AttachThreadInput")); - - // Don't even try using the parent window from another thread, this - // won't work. - parent = NULL; - } - } - WinStruct tdc; wxMSWTaskDialogConfig wxTdc;