AfxMessageBox()
-
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...
Simplest way is to use ::MessageBox Arjan.
-
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...
Use MessageBox instead of AfxMessageBox:
MessageBox(AfxGetMainWnd(),"Text","Title",MB_OK);
orMessageBox("Text","Title");
depending in wich class you're using it. Hope this helps -
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...
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