工作线程中创建非模态对话框
UINT ShowThread(void * pParam)
{
CDlgAnother* p_dlg=new CDlgAnother;
p_dlg->Create(IDD_DIALOG1,NULL);
p_dlg->ShowWindow(SW_SHOW);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
void CThreadWindowDlg::OnButton1()
{
AfxBeginThread( ShowThread, NULL);
}
UINT ShowThread(void * pParam)
{
CDlgAnother* p_dlg=new CDlgAnother;
p_dlg->Create(IDD_DIALOG1,NULL);
p_dlg->ShowWindow(SW_SHOW);
Sleep(10000);
return 0;
}
void CThreadWindowDlg::OnButton1()
{
AfxBeginThread( ShowThread, NULL);
}