To disable or enable input to a control, use the EnableWindow function.
When you disable a control, it does not respond to user input. Windows “grays” the control (displays it dimly) so that the user can tell that the control is disabled. To disable a control, use EnableWindow; specify the value FALSE, as follows:
EnableWindow(hButton, FALSE);
To restore input to the disabled control, enable it using the EnableWindow function with the value TRUE, as follows:
EnableWindow(hButton, TRUE);