I use static controls or read only edit controls to display simple text info like this.
//button's BN_CLICKED handler
//clear previous result
SetDlgItemText(hWnd, IDC_RESULT_EDIT, "Processing....");
//do processing and report success/failure
if(SomeFunction() == SUCCESS)
SetDlgItemText(hWnd, IDC_RESULT_EDIT, "Success!");
else SetDlgItemText(hWnd, IDC_RESULT_EDIT, "Failure!");
You should also check the TYPE of incomming msg is a BN_CLICKED (not one of the other button msgs send thru WM_COMMAND).
Originally Posted by Niara
ie (HIWORD(wParam) == BN_CLICKED)
For example, you probably do not want to run that code if a user is using the TAB key to select a control / cycle thru the controls (generatating both a BN_SETFOCUS msg and a BN_KILLFOCUS msg).