Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CMFCMenuBar, cleartype? [Solved]

CMFCMenuBar, cleartype? [Solved]

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestionannouncementlounge
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bob16972
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • B bob16972

      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

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2

      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 Software]

      B 2 Replies Last reply
      0
      • H Hans Dietrich

        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 Software]

        B Offline
        B Offline
        bob16972
        wrote on last edited by
        #3

        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.

        H 1 Reply Last reply
        0
        • H Hans Dietrich

          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 Software]

          B Offline
          B Offline
          bob16972
          wrote on last edited by
          #4

          Didn't have the secret API but something in the BCGSoft FAQ made a neuron fire. Thanks for the assistance.

          1 Reply Last reply
          0
          • B bob16972

            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.

            H Offline
            H Offline
            Hans Dietrich
            wrote on last edited by
            #5

            Post a question on the BCGSoft forums.

            Best wishes, Hans


            [Hans Dietrich Software]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups