How to disable all controls in the dialog box
-
I have a modeless dialog with some controls. How to disable this dialog with all controls? Best regards, Eugene Pustovoyt
ICQ UIN: 161325180
-
I have a modeless dialog with some controls. How to disable this dialog with all controls? Best regards, Eugene Pustovoyt
ICQ UIN: 161325180
Do something like this:
BOOL b = EnumChildWindows( hWndDlg, EnumFunc, NULL );
BOOL CALLBACK EnumFunc( HWND hwnd, LPARAM lParam )
{
EnableWindow( hwnd, FALSE );
}Andy Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
-
I have a modeless dialog with some controls. How to disable this dialog with all controls? Best regards, Eugene Pustovoyt
ICQ UIN: 161325180
Are you wanting to disable all of the controls on the dialog, or the dialog itself?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
I have a modeless dialog with some controls. How to disable this dialog with all controls? Best regards, Eugene Pustovoyt
ICQ UIN: 161325180
Try this:
HWND hwnd = ::GetTopWindow(this->GetSafeHwnd());
// while we have a valid hwnd,
// loop through all child windows
while (hwnd)
{
// do something with the hwnd
// and get the next child control's hwnd
hwnd = ::GetNextWindow(hwnd, GW_HWNDNEXT);
::EnableWindow(hwnd, FALSE);
}------- sig starts "I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
-
I have a modeless dialog with some controls. How to disable this dialog with all controls? Best regards, Eugene Pustovoyt
ICQ UIN: 161325180
If you want to disable the control on this dialog, the MFC-way of doing it would be creating a variable
bool ControlsEnabled;
and use OnCmdUI-Handler on each Control to dopCmdUI->Enable( ControlsEnabled /*&& other conditions*/);
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation." -- Caius Petronius, Roman Consul, 66 A.D.