1 定义数组,并初始化:
TCHAR Description[MAX_PATH]={0};
2 转自 http://blog.csdn.net/xiaobai1593/article/details/6593602
如果是在對話框內操作:直接SetWindowText((LPCTSTR)RetryCaption);就可以了。
如果是在外部操作對話框:::SetWindowText(dlg.m_hWnd,(LPCTSTR)RetryCaption);
示例:
说实话,不太明白,为什么CDialog重命名时,要分内部操作和外部操作;而CButton却不分也可以?
BOOL CHotkeyScheme::OnInitDialog()
{
CDialog::OnInitDialog();
//添加想要初始化的内容
TCHAR CDialogName[MAX_PATH]={0};
CString Hdvalue=_T("Hotkeys");
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,Hdvalue, SSN_AUTO_SELECT_LOCALE,NULL,Hdvalue,CDialogName,MAX_PATH,Hdvalue);
SetWindowText(CDialogName); //修改对话框的名
TCHAR HSName[MAX_PATH]={0};
CString HSvalue=_T("Scheme(S)");
CStatic* static1 = (CStatic*)GetDlgItem(IDC_STATIC1);
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,HSvalue, SSN_AUTO_SELECT_LOCALE,NULL,HSvalue,HSName,MAX_PATH,HSvalue);
static1->SetWindowText(HSName); //修改静态文本的名
TCHAR SMName[MAX_PATH]={0};
CString SMvalue=_T("Module(M)");
CStatic* static2 = (CStatic*)GetDlgItem(IDC_STATIC2);
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,SMvalue, SSN_AUTO_SELECT_LOCALE,NULL,SMvalue,SMName,MAX_PATH,SMvalue);
static2->SetWindowText(SMName);
TCHAR HFName[MAX_PATH]={0};
CString HFvalue=_T("Find(M)");
CButton* button1 = (CButton*)GetDlgItem(IDC_FIND);
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,HFvalue, SSN_AUTO_SELECT_LOCALE,NULL,HFvalue,HFName,MAX_PATH,HFvalue);
button1->SetWindowText(HFName); //修改按钮的名
TCHAR HOName[MAX_PATH]={0};
CString HOvalue=_T("OK(O)");
CButton* button2 = (CButton*)GetDlgItem(IDOK);
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,HOvalue, SSN_AUTO_SELECT_LOCALE,NULL,HOvalue,HOName,MAX_PATH,HOvalue);
button2->SetWindowText(HOName);
TCHAR HCName[MAX_PATH]={0};
CString HCvalue=_T("Cancel(C)");
CButton* button3 = (CButton*)GetDlgItem(IDCANCEL);
SsnGetLocaleString(SSN_PLUGIN_ID_ANY,HCvalue, SSN_AUTO_SELECT_LOCALE,NULL,HCvalue,HCName,MAX_PATH,HCvalue);
button3->SetWindowText(HCName);
}
在OnInitDialog()函数里实现;
3