How to identify class of dialog control
-
Hello, I want to change the font of all the Frame Static controls on my dialog. The following code will loop through all the dialog's controls and change all their fonts. CWnd* pwndChild = GetWindow(GW_CHILD); while (pwndChild) { pwndChild->SetFont( &MyNewFont, FALSE ); pwndChild = pwndChild->GetNextWindow(); } Could somebody tell me how I can identify if the window is a static frame type. Thanks, John
-
Hello, I want to change the font of all the Frame Static controls on my dialog. The following code will loop through all the dialog's controls and change all their fonts. CWnd* pwndChild = GetWindow(GW_CHILD); while (pwndChild) { pwndChild->SetFont( &MyNewFont, FALSE ); pwndChild = pwndChild->GetNextWindow(); } Could somebody tell me how I can identify if the window is a static frame type. Thanks, John
You can do this so:
TCHAR buf[50];
GetClassName(pwndChild->GetSafeHwnd(),buf,50);
if(strcmp(buf,"Static")==0)
{
...
}But I don't think it's a good practice. Pavel Sonork 100.15206
-
You can do this so:
TCHAR buf[50];
GetClassName(pwndChild->GetSafeHwnd(),buf,50);
if(strcmp(buf,"Static")==0)
{
...
}But I don't think it's a good practice. Pavel Sonork 100.15206
Thanks Pavel, The Static Frame control's ClassName is 'Button' so now I have to work out how to differentiate between it and other Button types.