修改MessageDlg窗口Ok/Cancel为“确定/取消”是提示错误
参考妖哥的一个程序,我现在想把MessageDlg对话框的Ok/Cancel修改为汉字“确定/取消”,但是会出现如何提示:
//修改Ok/Cancel按钮显示为中文HANDLE hBtnOk = FindWindowEx(Form1 -> Handle, NULL, "TButton", "OK");HANDLE hBtnCancel = FindWindowEx(Form1 -> Handle, NULL, "TButton", "Cancel");if(hBtnOk) { SetWindowText(hBtnOk, "确定(&O)"); }if(hBtnCancel) { SetWindowText(hBtnCancel, "取消(&C)"); }
[BCC32 Error] Unit1.cpp(350): E2034 Cannot convert 'void *' to 'HWND__ *'[BCC32 Error] Unit1.cpp(350): E2342 Type mismatch in parameter 'hWnd' (wanted 'HWND__ *', got 'void *')
BOOL WINAPI SetWindowText( __in HWND hWnd, __in_opt LPCTSTR lpString);