CDialogTest *g_pSetModeless2=NULL;
DWORD WINAPI TestThreadFun(LPVOID lpParam)
{
if(g_pSetModeless2==NULL)
{
//在线程中,创建非模态对话框失败,应该通过发消息给主对话框
//例如:::SendMessage(hWnd,USER_MSG,(WPARAM)hMinWnd,CREATE_TASKBAR_MSG);
g_pSetModeless2 = new CDialogTest(this);
g_pSetModeless2->Create(CDialogTest::IDD,GetDesktopWindow());
g_pSetModeless2->ShowWindow(SW_SHOW);
}
return 0;
}
void CTestMyplayerDlg::OnBnClickedButton()
{
int dwThreadId=NULL;
//工作线程
HANDLE hGetCurThread = CreateThread(NULL,
0,
TestThreadFun,
0,
0,
(LPDWORD)&dwThreadId);
}