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. add WM_SETFONT message handle in MFC

add WM_SETFONT message handle in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
7 Posts 5 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.
  • I Offline
    I Offline
    includeh10
    wrote on last edited by
    #1

    MFC doesn't have WM_SETFONT message handle, such as OnSetFont(...), how to add it as standard MFC handle? I mean, not use WindowProc(...) etc. .

    D V M 3 Replies Last reply
    0
    • I includeh10

      MFC doesn't have WM_SETFONT message handle, such as OnSetFont(...), how to add it as standard MFC handle? I mean, not use WindowProc(...) etc. .

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Are you wanting to intercept the WM_SETFONT message? Do you have a custom control that has a WndProc() function?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

      1 Reply Last reply
      0
      • I includeh10

        MFC doesn't have WM_SETFONT message handle, such as OnSetFont(...), how to add it as standard MFC handle? I mean, not use WindowProc(...) etc. .

        V Offline
        V Offline
        venkatmakam
        wrote on last edited by
        #3

        I think you can use ON_MESSAGE 0N_MESSAGE(WM_SETFONT, OnSetFont)... where OnSetFont is declared as afx_msg LRESULT OnSetFont(WPARAM, LPARAM). and WPARAM contains HFONT.

        http://www.mono-project.com/Main\_Page

        D 1 Reply Last reply
        0
        • V venkatmakam

          I think you can use ON_MESSAGE 0N_MESSAGE(WM_SETFONT, OnSetFont)... where OnSetFont is declared as afx_msg LRESULT OnSetFont(WPARAM, LPARAM). and WPARAM contains HFONT.

          http://www.mono-project.com/Main\_Page

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          venkatmakam wrote:

          0N_MESSAGE(WM_SETFONT, OnSetFont)...

          While you probably meant ON_MESSAGE(), isn't that for user-defined messages and less-common Windows messages?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

          L 1 Reply Last reply
          0
          • D David Crow

            venkatmakam wrote:

            0N_MESSAGE(WM_SETFONT, OnSetFont)...

            While you probably meant ON_MESSAGE(), isn't that for user-defined messages and less-common Windows messages?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            you do ask a lot of questions, don't you? :)

            Luc Pattyn [My Articles] Nil Volentibus Arduum

            The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
            Please use <PRE> tags for code snippets, they improve readability.
            CP Vanity has been updated to V2.3

            D 1 Reply Last reply
            0
            • I includeh10

              MFC doesn't have WM_SETFONT message handle, such as OnSetFont(...), how to add it as standard MFC handle? I mean, not use WindowProc(...) etc. .

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              WM_SETFONT is a message sent TO a window (control). That's why it doesn't have a handler macro.

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              1 Reply Last reply
              0
              • L Luc Pattyn

                you do ask a lot of questions, don't you? :)

                Luc Pattyn [My Articles] Nil Volentibus Arduum

                The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
                Please use <PRE> tags for code snippets, they improve readability.
                CP Vanity has been updated to V2.3

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Um, yeah.

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                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