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. AfxSetAppName( )?

AfxSetAppName( )?

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • L Offline
    L Offline
    lucy 0
    wrote on last edited by
    #1

    I have an SDI application. The title bar text is: FileName - AppName My question is: how can I change AppName on the fly? I have a menu item to swtich between two options. I want the application title bar to reflect which option is currently selected. So I want the title bar text to be something as: FileName - AppName option1 or FileName - AppName option2 I searched MSDN, and found there is a function AfxGetAppName( ), but it is to get CWinApp.m_pszAppName. Is there a function to set the m_pszAppName? Thank you very much for any hint.

    L U 2 Replies Last reply
    0
    • L lucy 0

      I have an SDI application. The title bar text is: FileName - AppName My question is: how can I change AppName on the fly? I have a menu item to swtich between two options. I want the application title bar to reflect which option is currently selected. So I want the title bar text to be something as: FileName - AppName option1 or FileName - AppName option2 I searched MSDN, and found there is a function AfxGetAppName( ), but it is to get CWinApp.m_pszAppName. Is there a function to set the m_pszAppName? Thank you very much for any hint.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Try SetWindowText() Artificial intelligence is no match for natural stupidity.

      L 1 Reply Last reply
      0
      • L Lost User

        Try SetWindowText() Artificial intelligence is no match for natural stupidity.

        L Offline
        L Offline
        lucy 0
        wrote on last edited by
        #3

        Get it. CMainFrame.SetWindowText(). Thanks a lot!

        1 Reply Last reply
        0
        • L lucy 0

          I have an SDI application. The title bar text is: FileName - AppName My question is: how can I change AppName on the fly? I have a menu item to swtich between two options. I want the application title bar to reflect which option is currently selected. So I want the title bar text to be something as: FileName - AppName option1 or FileName - AppName option2 I searched MSDN, and found there is a function AfxGetAppName( ), but it is to get CWinApp.m_pszAppName. Is there a function to set the m_pszAppName? Thank you very much for any hint.

          U Offline
          U Offline
          User 13792444
          wrote on last edited by
          #4

          AfxGetModuleState()->m_lpszCurrentAppName = L"title"

          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