I'm still not sure what the exact problem you are having is but, using your example you can pass the parent dialog all the way through to the winThread and onto the dialog, this then stops clicking behide loosing the window.
so:
Starting the dialog passing in the parent which is this
::PostThreadMessage (mMyThread->m_nThreadID, RUNDLGMSG, (WPARAM)mRunDLLDialogs, (LPARAM)this);
Changed your function to accept the parent
_declspec(dllexport) void runDLLDlg (CWnd*);
Passed the parent through in lParam
void MyThread::RunDlg(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0)
{
runDLLDlg ((CWnd*)lParam);
} else {
Dlg1 dlg1((CWnd*)lParam);
dlg1.DoModal();
}
}
pass all the way through
void runDLLDlg (CWnd* pParent)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
DLLDlg1 dlg1(pParent);
dlg1.DoModal();
}