Answer the question
In order to leave comments, you need to log in
How to get enumerations of controls when creating or initializing a dialog?
Interested in the CWnd* object for the IDC_STATIC resources of a particular dialog.
In principle, you can use the ON_WM_CTLCOLOR message for CTLCOLOR_STATIC and catch them there when redrawing, but I need to change the property for all IDC_STATIC when initializing the dialog.
How can I do that?
Answer the question
In order to leave comments, you need to log in
In OnInitDialog(), loop through all the elements, select those that are IDC_STATIC and do what you need with them.
CWnd* pwndChild = GetWindow(GW_CHILD);
while (pwndChild)
{
if(pWndChild->GetDlgCtrlID() == IDC_STATIC)
{
// делаем что надо
}
pwndChild = pwndChild->GetNextWindow();
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question