How to disable button?

Hi! I wrote a program in the initialization time implementation:
1
2
Butt [0] = CreateWindow (" BUTTON ", TEXT (" at the beginning of time "), WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 0, 0, 0,,0,80,30 HWND);
Butt [1] = CreateWindow (" BUTTON ", TEXT (" stop the clock "), WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 80,0,80,30, HWND, (HMENU), 1, 0);

Now, I hope to press the "start timing", disable the button, and enable "stop the clock". I use: EnableWindow (butt [0], FALSE);
But "start timing" not grey. How do I let button grey?
That can't be the actual code you wrote - because it would not compile- because it is so wrong.

Why not post your actual code??
If you have a valid handle to a button control then calling EnableWindow(hControlWnd,FALSE) would indeed disable it (as you say, it will be grey).

For a static dialog with controls it is much easier to create a resource file and then call GetDlgItem(hDialogMain,CTRL_ID) to get the handle to the button you want than the way you seem to be going about it.
Topic archived. No new replies allowed.