Enhance SPY_GetMsgName to translate common control messages.
diff --git a/windows/spy.c b/windows/spy.c
index c3c4bbc..1a39607 100644
--- a/windows/spy.c
+++ b/windows/spy.c
@@ -1579,11 +1579,14 @@
CHAR wnd_name[16]; /* window name for message */
} SPY_INSTANCE;
+/* This is defined so that the external entry point can return the addr */
+static SPY_INSTANCE ext_sp_e;
+
/***********************************************************************
* SPY_GetMsgInternal
*/
-static const char *SPY_GetMsgInternal( UINT msg, BOOL support_common_clts )
+static const char *SPY_GetMsgInternal( UINT msg )
{
static char msg_buffer[20];
@@ -1673,7 +1676,7 @@
const USER_MSG *p;
sp_e->msg_name[sizeof(sp_e->msg_name)-1] = 0;
- strncpy (sp_e->msg_name, SPY_GetMsgInternal( sp_e->msgnum, TRUE ),
+ strncpy (sp_e->msg_name, SPY_GetMsgInternal( sp_e->msgnum ),
sizeof(sp_e->msg_name)-1);
sp_e->data_len = 0;
@@ -1699,18 +1702,6 @@
}
/***********************************************************************
- * SPY_GetMsgName
- *
- * **** External function ****
- *
- * Get message name
- */
-const char *SPY_GetMsgName( UINT msg )
-{
- return SPY_GetMsgInternal( msg, FALSE );
-}
-
-/***********************************************************************
* SPY_GetWndName
*
* Sets the value of "wnd_name" and "wnd_class" members of the
@@ -1766,6 +1757,24 @@
}
/***********************************************************************
+ * SPY_GetMsgName
+ *
+ * **** External function ****
+ *
+ * Get message name
+ */
+const char *SPY_GetMsgName( UINT msg, HWND hWnd )
+{
+ ext_sp_e.msgnum = msg;
+ ext_sp_e.msg_hwnd = hWnd;
+ ext_sp_e.lParam = 0;
+ ext_sp_e.wParam = 0;
+ SPY_GetWndName(&ext_sp_e);
+ SPY_GetMsgStuff(&ext_sp_e);
+ return ext_sp_e.msg_name;
+}
+
+/***********************************************************************
* SPY_GetVKeyName
*/
const char *SPY_GetVKeyName(WPARAM wParam)