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. Need to change the Default Font of Control in my win32 code

Need to change the Default Font of Control in my win32 code

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
5 Posts 4 Posters 1 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.
  • Z Offline
    Z Offline
    zakkas2483
    wrote on last edited by
    #1

    Hello all, I working on one win32 application. I need to change the font of my controls. This can be done by sending WM_SETFONT message to the control. but it need hFont as WPARAM. and to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.

    C D 2 Replies Last reply
    0
    • Z zakkas2483

      Hello all, I working on one win32 application. I need to change the font of my controls. This can be done by sending WM_SETFONT message to the control. but it need hFont as WPARAM. and to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      I believe you are wrong with that, CreateFont, CreateFontIndirect and such API calls can be used without MFC.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

      1 Reply Last reply
      0
      • Z zakkas2483

        Hello all, I working on one win32 application. I need to change the font of my controls. This can be done by sending WM_SETFONT message to the control. but it need hFont as WPARAM. and to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.

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

        zakkas2483 wrote:

        ...to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.

        See here.

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "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

        Z 1 Reply Last reply
        0
        • D David Crow

          zakkas2483 wrote:

          ...to create hFont we need CreateFont() function but it is only available in MFC not in win32. so what is alternative of this.

          See here.

          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

          "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

          Z Offline
          Z Offline
          zakkas2483
          wrote on last edited by
          #4

          I m getting Error Message "CreateFont: identifier not found".

          I 1 Reply Last reply
          0
          • Z zakkas2483

            I m getting Error Message "CreateFont: identifier not found".

            I Offline
            I Offline
            I am BATMAN
            wrote on last edited by
            #5

            Sounds like you're not including the right files. Check the dependencies for that function.

            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