I program in Borland C++ 5.02.
I have a large program with many calls to TWindow::MessageBox (and also
MessageBox(HWindow,...) )
It would be useful to log each message shown to the user.
This could be done by deriving from TWindow & re-writing the inherited
TWindow::MessageBox.
However, this could be long-winded as so many classes are derived from
TWindow, esp. TDialog.
Anyway, I'd like to update MessageBox(HWindow,...) similarly, & since
TWindow::MessageBox must call MessageBox(HWindow,...),
it makes more sense to just update MessageBox(HWindow,...).
But is there a way to re-define MessageBox(HWindow,...)?
Thanks,
Regards Mark
. Ed
> Mark Weston wrote in message
> news:489a...@newsgroups.borland.com...
>But is there a way to re-define MessageBox(HWindow,...)?
I think you would need to recompile the libraries with...
#include <windows.h>
#undefine MessageBox
WINUSERAPI
int
WINAPI
MessageBox(
IN HWND hWnd,
IN LPCSTR lpText,
IN LPCSTR lpCaption,
IN UINT uType);
Then in one of the libs...
WINUSERAPI int WINAPI MessageBox(
HWND hWnd,
LPCSTR lpText,
LPCSTR lpCaption,
UINT uType)
{
{Log code}
#ifdef UNICODE
return MessageBoxW(hWnd,l[Text,lpCaption,uType);
#else
return MessageBoxA(hWnd,l[Text,lpCaption,uType);
#endif // !UNICODE
}