CMFCMenuBar, cleartype? [Solved]
-
I've noticed that every new porject I create that utilizes the menu class from the MFC Feature Pack appears to utilize cleartype (or some form of font smoothing) regardless of my system settings. I've looked for some way to disable it but so far have not found anything. Does anyone know how to manipulate the settings for whether a CMFCMenuBar uses ClearType (or any type of font smoothing in general)? UPDATE: This might do the trick (Appears to work so far) and it appears to carry over to status bar, view tabs, etc...
void CMainFrame::DisableClearType(BOOL bDisable)
{
/*
This method provides a way to switch clear type font
quality on or off from the OnApplicationLook method.NOTE: The quality flag for PROOF\_QUALITY remains set. \*/ LOGFONT logFont = {0}; CFont& font = (CFont&)CMFCMenuBar::GetMenuFont(); font.GetLogFont(&logFont); if (bDisable) { // Remove the antialiasing flag logFont.lfQuality &= (~ANTIALIASED\_QUALITY); } else { // Set the antialiasing flag logFont.lfQuality |= ANTIALIASED\_QUALITY; } CMFCMenuBar::SetMenuFont(&logFont);
}
void CMainFrame::OnApplicationLook(UINT id)
{
CWaitCursor wait;theApp.m\_nAppLook = id; switch (theApp.m\_nAppLook) { case ID\_VIEW\_APPLOOK\_WIN\_2000: CMFCVisualManager::SetDefaultManager(RUNTIME\_CLASS(CMFCVisualManager)); DisableClearType(TRUE); break; case ID\_VIEW\_APPLOOK\_OFF\_XP: CMFCVisualManager::SetDefaultManager(RUNTIME\_CLASS(CMFCVisualManagerOfficeXP)); DisableClearType(FALSE); break;
...
modified on Monday, April 11, 2011 3:53 PM
-
I've noticed that every new porject I create that utilizes the menu class from the MFC Feature Pack appears to utilize cleartype (or some form of font smoothing) regardless of my system settings. I've looked for some way to disable it but so far have not found anything. Does anyone know how to manipulate the settings for whether a CMFCMenuBar uses ClearType (or any type of font smoothing in general)? UPDATE: This might do the trick (Appears to work so far) and it appears to carry over to status bar, view tabs, etc...
void CMainFrame::DisableClearType(BOOL bDisable)
{
/*
This method provides a way to switch clear type font
quality on or off from the OnApplicationLook method.NOTE: The quality flag for PROOF\_QUALITY remains set. \*/ LOGFONT logFont = {0}; CFont& font = (CFont&)CMFCMenuBar::GetMenuFont(); font.GetLogFont(&logFont); if (bDisable) { // Remove the antialiasing flag logFont.lfQuality &= (~ANTIALIASED\_QUALITY); } else { // Set the antialiasing flag logFont.lfQuality |= ANTIALIASED\_QUALITY; } CMFCMenuBar::SetMenuFont(&logFont);
}
void CMainFrame::OnApplicationLook(UINT id)
{
CWaitCursor wait;theApp.m\_nAppLook = id; switch (theApp.m\_nAppLook) { case ID\_VIEW\_APPLOOK\_WIN\_2000: CMFCVisualManager::SetDefaultManager(RUNTIME\_CLASS(CMFCVisualManager)); DisableClearType(TRUE); break; case ID\_VIEW\_APPLOOK\_OFF\_XP: CMFCVisualManager::SetDefaultManager(RUNTIME\_CLASS(CMFCVisualManagerOfficeXP)); DisableClearType(FALSE); break;
...
modified on Monday, April 11, 2011 3:53 PM
You can do it for the entire system, but I don't know of any way to do it for just one app. You might check the BCGSoft forums, they might have a secret API.
Best wishes, Hans
-
You can do it for the entire system, but I don't know of any way to do it for just one app. You might check the BCGSoft forums, they might have a secret API.
Best wishes, Hans
Hans Dietrich wrote:
You can do it for the entire system, but I don't know of any way to do it for just one app
The single MFC Feature Pack application is ignoring my system settings so I thought there might be a way to force it to behave and pay attention to the system settings but so far, I've dug around in the BCGSoft/Microsoft source code for CMFCVisualManager and the label/caption drawing code simply uses the DC passed in so I guess I need to see where that DC comes from and see if it can be modified. I'll dig around the BCGSoft site. I have to say, by the time I figure out how to use this Feature Pack stuff, they'll have moved on to something new again.
-
You can do it for the entire system, but I don't know of any way to do it for just one app. You might check the BCGSoft forums, they might have a secret API.
Best wishes, Hans
-
Hans Dietrich wrote:
You can do it for the entire system, but I don't know of any way to do it for just one app
The single MFC Feature Pack application is ignoring my system settings so I thought there might be a way to force it to behave and pay attention to the system settings but so far, I've dug around in the BCGSoft/Microsoft source code for CMFCVisualManager and the label/caption drawing code simply uses the DC passed in so I guess I need to see where that DC comes from and see if it can be modified. I'll dig around the BCGSoft site. I have to say, by the time I figure out how to use this Feature Pack stuff, they'll have moved on to something new again.