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. AfxMessageBox()

AfxMessageBox()

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

    Hi, I would like to know if it's possible to change the title name of a AfxMessageBox or a MessageBox? thanks Mykel Everything's beautiful if you look at it long enough...

    A C K 3 Replies Last reply
    0
    • M MemLeak

      Hi, I would like to know if it's possible to change the title name of a AfxMessageBox or a MessageBox? thanks Mykel Everything's beautiful if you look at it long enough...

      A Offline
      A Offline
      Arjan Schouten
      wrote on last edited by
      #2

      Simplest way is to use ::MessageBox Arjan.

      1 Reply Last reply
      0
      • M MemLeak

        Hi, I would like to know if it's possible to change the title name of a AfxMessageBox or a MessageBox? thanks Mykel Everything's beautiful if you look at it long enough...

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        Use MessageBox instead of AfxMessageBox: MessageBox(AfxGetMainWnd(),"Text","Title",MB_OK); or MessageBox("Text","Title"); depending in wich class you're using it. Hope this helps

        1 Reply Last reply
        0
        • M MemLeak

          Hi, I would like to know if it's possible to change the title name of a AfxMessageBox or a MessageBox? thanks Mykel Everything's beautiful if you look at it long enough...

          K Offline
          K Offline
          khehwan
          wrote on last edited by
          #4

          AfxMessageBox() will use 'm_pszAppName' as the title name. The best way is to use MessageBox(). If you want to use resource as input message, here's an example: int MyMessageBox(UINT nIDPrompt,LPCTSTR lpszTitle, UINT nType) { HMODULE hThisApp; DWORD dwLen,dwBufSize; int nResult; hThisApp=AfxGetInstanceHandle(); _TCHAR *lpszText=NULL; dwBufSize=0; do { delete [] lpszText; dwBufSize+=256; lpszText=new _TCHAR[dwBufSize]; dwLen=LoadString(hThisApp,nIDPrompt,lpszText,dwBufSize); } while((0!=dwLen)&&(dwLen+sizeof(_TCHAR)==dwBufSize)); nResult=MessageBox(GetActiveWindow(),lpszText,lpszTitle,nType|MB_TASKMODAL); delete [] lpszText; return nResult; } Best Regards, K Wan

          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