C++ MFC CTASKDALOG:修改对话框窗口的位置和高度

C++ MFC CTASKDALOG:修改对话框窗口的位置和高度,c++,windows,mfc,dialog,position,C++,Windows,Mfc,Dialog,Position,是否有一种简单的方法来修改对话框窗口的位置?我想把它放在屏幕的右边,有固定的高度和宽度。但是CTaskDialog类只提供更改窗口宽度的功能。下面是我想修改的msdn中的一些示例代码: // TODO: Replace the strings below with the appropriate message, // main instruction, and dialog title CString message("This is an important message to the

是否有一种简单的方法来修改对话框窗口的位置?我想把它放在屏幕的右边,有固定的高度和宽度。但是CTaskDialog类只提供更改窗口宽度的功能。下面是我想修改的msdn中的一些示例代码:

// TODO: Replace the strings below with the appropriate message,  
// main instruction, and dialog title
CString message("This is an important message to the user.");
CString mainInstruction("Important!\nPlease read!");
CString title("Alert Dialog");

CTaskDialog taskDialog(message, mainInstruction, title, 
    TDCBF_YES_BUTTON | TDCBF_NO_BUTTON | TDCBF_CANCEL_BUTTON );

// Setting new information to be able to reuse the dialog resource
taskDialog.SetWindowTitle(L"New title for the task dialog");
taskDialog.SetContent(L"New message to show the user.");
taskDialog.SetMainInstruction(L"Even more important!");
taskDialog.SetMainIcon(TD_ERROR_ICON);
taskDialog.SetDialogWidth(300);

// Add a footer
taskDialog.SetFooterText(L"Footer information for the dialog.");
taskDialog.SetFooterIcon(TD_INFORMATION_ICON);

// Add expansion information
taskDialog.SetExpansionArea(L"Additional information\non two lines.",
    L"Click here for more information.",
    L"Click here to hide the extra information.");

// Change the options to show the expanded information by default. 
// It is necessary to retrieve the current options first. 
int options = taskDialog.GetOptions();
options |= TDF_EXPANDED_BY_DEFAULT;
taskDialog.SetOptions(options);

taskDialog.DoModal();

您可以在CDDialog::OnInitDialog()中对其调用MoveWindow,当我这样做时,只有主窗口的位置会改变。在该窗口中有一个onclickbutton事件,它动态打开始终居中的对话框。但我希望他们去别的地方。也许我错过了OnInitDialog()的某些功能?