Disabling a button using ATL
-
Is there a way to enable/disable a button whitout using MFC ? I am not really familliar with this type of operation. I've done it successfully for edit control :
// Enable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, TRUE, 0); // Disable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, FALSE, 0);
and was expectiong something similar for buttons but everything I tried was unsuccessfull. Thanks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/ -
Is there a way to enable/disable a button whitout using MFC ? I am not really familliar with this type of operation. I've done it successfully for edit control :
// Enable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, TRUE, 0); // Disable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, FALSE, 0);
and was expectiong something similar for buttons but everything I tried was unsuccessfull. Thanks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/I going to show you a way to solve all you problems Get WTL, in it there is a AtlCtrls.h file, in that there are all the standard controls like CButton Not only is it easy to use but if you look at the code it wraps the SendMessage stuff. Also has a CString class and Arrays which allows you not to use MFC and it makes things smaller. Once you've used WTL you'll never go back to MFC WTL is hard to find and I dont have the MSDN site, ask the ATL newsgroup they will know LostGolfBall
-
Is there a way to enable/disable a button whitout using MFC ? I am not really familliar with this type of operation. I've done it successfully for edit control :
// Enable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, TRUE, 0); // Disable ::SendDlgItemMessage(hwndDlg, IDC_KEYPAIRNEWFILENAME, WM_ENABLE, FALSE, 0);
and was expectiong something similar for buttons but everything I tried was unsuccessfull. Thanks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/See the FAQ 4.6 How do I enable or disable a dialog control (button, edit box, etc.)?[^] --Mike-- Latest blog entry: *drool* (Alyson) [May 10] Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber "You have Erica on the brain" - Jon Sagara to me
-
See the FAQ 4.6 How do I enable or disable a dialog control (button, edit box, etc.)?[^] --Mike-- Latest blog entry: *drool* (Alyson) [May 10] Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber "You have Erica on the brain" - Jon Sagara to me
Excellent ! This is exactly what I was looking for :-D Thanks for your input. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= J.-C. Gauthier - http://www.grandmenhir.com/