ダイアログボックスの背景色はシステムの設定なのでGetSysColorで取得します。
1 | DWORD bkColor=GetSysColor(COLOR_BTNFACE); |
CFileDialogメンバ変数:m_ofnのlpstrTitleに表示したいタイトルを入れます。
1 2 3 4 5 | CString setting=_T("実行ファイル(*.exe)|*.exe|全て(*.*)|*.*||"); CFileDialog dlg(TRUE,_T("*.exe"),_T(""),OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,setting,this); dlg.m_ofn.lpstrTitle=_T("ここがタイトルになる。"); dlg.DoModal(); |
GetWindowTextで取得できます。
1 2 3 4 | // CDialog m_Dialog; CString str; m_Dialog.GetWindowText(str); TRACE(str); |
1 2 3 4 5 6 | BOOLCTestDlg::OnInitDialog() { ・ ・ // TODO: 初期化をここに追加します。 SetWindowText("test"); // タイトルが「test」になる。 |
1 2 3 4 5 | CButton *pOkbutton=(CButton*)GetDlgItem(IDOK); pOkbutton->EnableWindow(FALSE);// 使用禁止 CButton *pCabutton=(CButton*)GetDlgItem(IDCANCEL); pCabutton->EnableWindow(FALSE);// 使用禁止 |