我想在CWXSMSDlg的(97,5)处创建 CMsgDlg* pmsgDlg, 通过 SetWindowsPos指定了位置,不过怎么不条,pmsgDlg总是在CWXSMSDlg的左上角。这是怎么回事?BOOL CWXSMSDlg::OnInitDialog()
{
...
CMsgDlg* pmsgDlg = new CMsgDlg();
if(pmsgDlg != NULL)
{
BOOL ret = pmsgDlg->Create(IDD_MSG_DIALOG,this);
if(!ret) //Create failed.
AfxMessageBox("Error creating Dialog");
::SetWindowPos( pmsgDlg->GetSafeHwnd(), HWND_TOP, 300, 50, 256, 211, SWP_NOMOVE);
pmsgDlg->ShowWindow(SW_SHOW);
}
else
AfxMessageBox("Error Creating Dialog Object");
...
}
{
...
CMsgDlg* pmsgDlg = new CMsgDlg();
if(pmsgDlg != NULL)
{
BOOL ret = pmsgDlg->Create(IDD_MSG_DIALOG,this);
if(!ret) //Create failed.
AfxMessageBox("Error creating Dialog");
::SetWindowPos( pmsgDlg->GetSafeHwnd(), HWND_TOP, 300, 50, 256, 211, SWP_NOMOVE);
pmsgDlg->ShowWindow(SW_SHOW);
}
else
AfxMessageBox("Error Creating Dialog Object");
...
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货