|
-
May 30th, 1999, 12:56 AM
#1
Disabling/Enabling all controls
Does somebody knows a way to enable/disable all the controls in a dialog at the same time?.
I have done it with a for :
for(int i = ID_FIRST_CONTROL; i<=LAST_CONTROL;i++)
{
GetDlgItem()->EnableWindow(FALSE);
}
but i hate to number secuencially all the resources in the Resource.h every time i add a new control, despite i have a macro that does it.
I've tried the CWnd::GetWindow(GW_CHILD) function, but I haven't had it to work.
I hope you could point me in the right direction.
Tank you very much.
-
May 30th, 1999, 01:15 PM
#2
Re: Disabling/Enabling all controls
Try this
CWnd* wnd = GetTopWindow( );
while(wnd){
wnd->EnableWindow(FALSE);
wnd = wnd->GetNextWindow();
}
-
May 30th, 1999, 03:33 PM
#3
Re: Disabling/Enabling all controls
Tank you very much, it worked great. I only had tried with GetWindow(GW_CHILD) and GetWindow(GW_HWNDNEXT) but I had never tried what you suggested.
By the way, I missed an ´i´ in the GetDlgItem(i) in my question, for those who were wondering how the heck it worked 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|