Hello, I was wondering how to change the style of a button once the program running?

Lets say I have a button on a dialog box (made with a resource editor), and I want to have the button be Disabled (grey'd out) until a certain condition is met, at which point I want the button to be usable again.

Something like

SendMessage(hButton, BS_DISABLE, 0, 0);

or something like it (what I wrote isn't real to my knowledge).

Any idea how to change the Disable flag on buttons? Thanks.