WM_SETTEXT An application sends a WM_SETTEXT message to set the text of a window. To send this message, call the SendMessage function with the following parameters. SendMessage( (HWND) hWnd, // handle to destination window WM_SETTEXT, // message to send (WPARAM) wParam, // not used; must be zero (LPARAM) lParam // window-text string (LPCTSTR) );
An application sends a WM_SETTEXT message to set the text of a window. To send this message, call the SendMessage function with the following parameters. SendMessage(
(HWND) hWnd, // handle to destination window
WM_SETTEXT, // message to send
(WPARAM) wParam, // not used; must be zero
(LPARAM) lParam // window-text string (LPCTSTR)
);
{
GetDlgItem(IDC_MYBTN)->SetWindowText(_T("YES"));
....
}CXXXDlg::OnButtonMyBtn()
{
CString str;
GetDlgItem(IDC_MYBTN)->SetWindowText(str);
if ( str == _T("YES") )
GetDlgItem(IDC_MYBTN)->SetWindowText(_T("NO"));
else
GetDlgItem(IDC_MYBTN)->SetWindowText(_T("YES"));
}