|
From: Kevin W. <ke...@me...> - 2003-08-11 13:05:16
|
Hi everyone, At 01:53 11/08/03, Chris Sroka wrote: >I have created an OK pushbutton in a dialog box via a resource script (see >code below): > >**** > > DEFPUSHBUTTON "Start", ID_START_CALC, 255, 7, 50, 14 > DEFPUSHBUTTON "OK", ID_OK, 255, 27, 50, 14 > DEFPUSHBUTTON "Cancel", ID_CANCEL, 255, 47, 50, 14 >**** There should only be one default button in a dialog box. Use PUSHBUTTON for the rest. >I am trying to grey it out and disable it, from within a callback >function, while I carry out some calculations, and then enable it again >when the calcs are complete. Buttons are windows, so you can send a message to the button to disable it, via the EnableWindow function: EnableWindow(HWND hWnd, BOOL bEnable) where hWnd is the window handle, and bEnable is set to FALSE to disable the window. >Does anyone know how to do this? I have tried SendDlgItemMessage with the >dialog's handle, the pushbutton's ID and various LPARAMs and WPARAMs but >with no success. I have also trawled www.msdn.microsoft.com but found no >suggestions. Do you have the Win32 SDK? Regards, Kev. |