// VCL message list, which defines the controls unit in VCL
# Define max_vcl_message 81
Static const char * const cmessagenames [max_vcl_message + 1] = {
"Cm_activate ",
"Cm_deactivate ",
"Cm_gotfocus ",
"Cm_lostfocus ",
"Cm_cancelmode ",
"Cm_dialogkey ",
"Cm_dialogchar ",
"Cm_focuschanged ",
"Cm_parentfontchanged ",
"Cm_parentcolorchanged ",
"Cm_hittest ",
"Cm_visiblechanged ",
"Cm_enabledchanged ",
"Cm_colorchanged ",
"Cm_fontchanged ",
"Cm_cursorchanged ",
"Cm_ctl3dchanged ",
"Cm_parentctl3dchanged ",
"Cm_textchanged ",
"Cm_mouseenter ",
"Cm_mouseleave ",
"Cm_menuchanged ",
"Cm_appkeydown ",
"Cm_appsyscommand ",
"Cm_buttonpressed ",
"Cm_showingchanged ",
"Cm_enter ",
"Cm_exit ",
"Cm_designhittest ",
"Cm_iconchanged ",
"Cm_wantspecialkey ",
"Cm_invokehelp ",
"Cm_mongowhook ",
"Cm_release ",
"Cm_showhintchanged ",
"Cm_parentshowhintchanged ",
"Cm_syscolorchange ",
"Cm_wininichange ",
"Cm_fontchange ",
"Cm_timechange ",
"Cm_tabstopchanged ",
"Cm_uiactivate ",
"Cm_uideactivate ",
"Cm_docwindowactivate ",
"Cm_controllistchange ",
"Cm_getdatalink ",
"Cm_childkey ",
"Cm_drag ",
"Cm_hintshow ",
"Cm_dialoghandle ",
"Cm_istoolcontrol ",
"Cm_recreatewnd ",
"Cm_invalidate ",
"Cm_sysfontchanged ",
"Cm_controlchange ",
"Cm_changed ",
"Cm_dockclient ",
"Cm_undockclient ",
"Cm_float ",
"Cm_borderchanged ",
"Cm_bidimodechanged ",
"Cm_parentbidimodechanged ",
"Cm_allchildrenflipped ",
"Cm_actionupdate ",
"Cm_actionexecute ",
"Cm_hintshowpause ",
"Cm_docknotification ",
"Cm_mousewheel ",
"Cm_isshortcut ",
"Cm_updateactions ",
"Cm_invalidatedockhost ",
"Cm_setactivecontrol ",
"Cm_popuphwnddestroy ",
"Cm_createpopup ",
"Cm_destroyhandle ",
"Cm_mouseactivate ",
"Cm_controllistchanging ",
"Cm_bufferedprintclient ",
"Cm_unthemecontrol ",
"Cm_doublebufferedchanged ",
"Cm_parentdoublebufferedchanged ",
"Cm_themechanged"
};
String _ fastcall messagename (uint MSG)
{
String retval;
If (MSG <= wm_user)
{
Retval = messagetypenames [MSG];
}
Else
{
If (MSG> = cm_base)
{
If (MSG <= cm_base + max_vcl_message)
{
Retval = cmessagenames [MSG-cm_base];
}
Else if (MSG-cn_base <wm_user)
{
Retval = "cn" + String (messagetypenames [MSG-cn_base]). substring (3,255 );
}
}
}
If (retval. Length () = 0)
{
Char aname [256];
If (getclipboardformatname (MSG, aname, 255 ))
// Get the name of the message defined by registerwindowmessage
{
Retval = aname;
}
Else
{
If (MSG> = wm_app)
{
Retval = "wm_app +" + inttostr (MSG-wm_app) + "(0x" + inttohex (INT) (MSG-wm_app), 4) + ")";
}
Else
{
Retval = "wm_user +" + inttostr (MSG-wm_user) + "(0x" + inttohex (INT) (MSG-wm_user), 4) + ")";
}
}
}
Return retval. Length ()? Retval: string ("(unknown)"); // if the message name is still unknown, it is a new message that may be unknown.
}