I'm new to Windows programming... I started with the sample dialog based program from the Pelles project Wizzard.
What I'm trying to do is disabling a button when it's clicked and enabling (and activating) an other one.
I modified the sample code as follows:
case WM_COMMAND:
switch (GET_WM_COMMAND_ID(wParam, lParam))
{
/*
* TODO: Add more control ID's, when needed.
*/
case IDOK:
EnableWindow(GetDlgItem (hwndDlg, 4001),1);
EnableWindow(GetDlgItem (hwndDlg, IDOK),0);
SetFocus(GetDlgItem (hwndDlg, 4001));
return TRUE;
case 4001:
EnableWindow(GetDlgItem (hwndDlg, 4001),0);
EnableWindow(GetDlgItem (hwndDlg, IDOK),1);
SetFocus(GetDlgItem (hwndDlg, IDOK));
return TRUE;
}
break;
The problem is that the border around the button isn't updated... so a disabled button can still have a black border... this makes it confusing as the button is disabled.
How can I fix this? Do I need to redraw something and how can I implement this in my program?