Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

How to change caption of window, using AfxMessageBox()..

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jigar Mehta - 25 Feb 2004 10:02 GMT
Hye,
   I am Jigar Mehta, currently, I am using AfxMessageBox where I need to
change the caption of the messagebox using that function only... What I get
is,
the project name as the caption. I don't want to show my codename of the
project to people in my final product, so, I want to change the caption of
the messagebox to some different.

   so, how to do that??? is there any parameter which does this thing ???

--
Jigar Mehta
jigar@toughguy.net
Michael Buechel - 25 Feb 2004 12:36 GMT
use MessageBox instead

Signature

kind regards, muechel

while(!sleep())
  ++sheep;

Jigar Mehta - 27 Feb 2004 07:52 GMT
That's what I want to say, that Afx is in the thread which does not have MFC
support., So, I can not use MessageBox function... I want to ask whether
there is any way of changing caption in AfxMessageBox function or not...

Jigar Mehta
Jigar.Mehta@gmx.net

use MessageBox instead

--
kind regards, muechel

while(!sleep())
  ++sheep;
Jigar Mehta - 30 Mar 2005 20:25 GMT
At last i have got the answer from one of my friend,, so, i want to share
it with u all...

AfxMessageBox uses this pointer for the caption -
AfxGetApp()->m_pszAppName
So I temporarily change it, I call AfxMessageBox, and then I restore it.

-----------------------------------------------------------
const char lpszTitle[] = "MyTitle";
const char pszMsgBuff[] = "The message";
UINT nMsgBoxStyle = MB_OK;

-----------------------------------------------------------
const char* psz;

psz = AfxGetApp()->m_pszAppName;
AfxGetApp()->m_pszAppName = lpszTitle;

AfxMessageBox(pszMsgBuff, nMsgBoxStyle);

AfxGetApp()->m_pszAppName = psz;
-----------------------------------------------------------

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.