Print the message name for registered messages.

This commit is contained in:
Alexandre Julliard 2003-01-11 21:07:50 +00:00
parent a3717a2edd
commit 04d5963871
1 changed files with 26 additions and 16 deletions

View File

@ -1798,8 +1798,6 @@ inline static void set_indent_level( int level )
*/
static const char *SPY_GetMsgInternal( UINT msg )
{
static char msg_buffer[20];
if (msg <= SPY_MAX_MSGNUM)
{
if (!MessageTypeNames[msg]) return "???";
@ -1847,9 +1845,7 @@ static const char *SPY_GetMsgInternal( UINT msg )
if (!WINEMessageTypeNames[msg-WM_WINE_DESTROYWINDOW]) return "???";
return WINEMessageTypeNames[msg-WM_WINE_DESTROYWINDOW];
}
sprintf( msg_buffer, "WM_USER+%04x", msg - WM_USER );
return msg_buffer;
return "";
}
/***********************************************************************
@ -1900,9 +1896,19 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e )
sizeof(sp_e->msg_name)-1);
sp_e->data_len = 0;
if (strncmp(sp_e->msg_name, "WM_USER+", 8) == 0) {
if (!sp_e->msg_name[0])
{
INT i = 0;
if (sp_e->msgnum >= 0xc000)
{
if (GlobalGetAtomNameA( sp_e->msgnum, sp_e->msg_name+1, sizeof(sp_e->msg_name)-2 ))
{
sp_e->msg_name[0] = '\"';
strcat( sp_e->msg_name, "\"" );
return;
}
}
#if DEBUG_SPY
TRACE("looking class %s\n", sp_e->wnd_class);
#endif
@ -1910,7 +1916,8 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e )
while (cc_array[i].classname &&
strcmpW(cc_array[i].classname, sp_e->wnd_class) !=0) i++;
if (!cc_array[i].classname) return;
if (cc_array[i].classname)
{
#if DEBUG_SPY
TRACE("process class %s, first %p, last %p\n",
debugstr_w(cc_array[i].classname), cc_array[i].classmsg,
@ -1921,8 +1928,11 @@ static void SPY_GetMsgStuff( SPY_INSTANCE *sp_e )
if (p) {
strncpy (sp_e->msg_name, p->name, sizeof(sp_e->msg_name)-1);
sp_e->data_len = p->len;
return;
}
}
sprintf( sp_e->msg_name, "WM_USER+%04x", sp_e->msgnum - WM_USER );
}
}
/***********************************************************************