unit UMessages;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ExtCtrls, Grids;

type
  TfmMess = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    btSend: TBitBtn;
    BitBtn2: TBitBtn;
    pn: TPanel;
    sgMess: TStringGrid;
    procedure FormCreate(Sender: TObject);
    procedure sgMessDblClick(Sender: TObject);
  private
    { Private declarations }
  public
    procedure FillMessages;
    procedure LocateToId(ID: Integer);
    function GetId: string;
  end;

var
  fmMess: TfmMess;

implementation

{$R *.DFM}

procedure TfmMess.FillMessages;
begin
  Caption:='Messages';
  sgMess.ColWidths[0]:=200;
  sgMess.ColWidths[1]:=80;
  sgMess.Cells[0,0]:='Message Name';
  sgMess.Cells[1,0]:='Message Id';
  sgMess.RowCount:=2;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NULL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NULL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CREATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CREATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DESTROY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DESTROY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SIZE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SIZE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ACTIVATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ACTIVATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETFOCUS';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETFOCUS,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_KILLFOCUS';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_KILLFOCUS,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ENABLE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ENABLE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETREDRAW';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETREDRAW,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETTEXT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETTEXT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETTEXT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETTEXT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETTEXTLENGTH';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETTEXTLENGTH,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PAINT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PAINT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CLOSE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CLOSE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUERYENDSESSION';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUERYENDSESSION,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUIT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUIT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUERYOPEN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUERYOPEN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ERASEBKGND';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ERASEBKGND,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSCOLORCHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSCOLORCHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ENDSESSION';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ENDSESSION,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSTEMERROR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSTEMERROR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SHOWWINDOW';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SHOWWINDOW,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLOR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLOR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_WININICHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_WININICHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETTINGCHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETTINGCHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DEVMODECHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DEVMODECHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ACTIVATEAPP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ACTIVATEAPP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_FONTCHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_FONTCHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_TIMECHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_TIMECHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CANCELMODE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CANCELMODE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETCURSOR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETCURSOR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSEACTIVATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSEACTIVATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CHILDACTIVATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CHILDACTIVATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUEUESYNC';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUEUESYNC,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETMINMAXINFO';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETMINMAXINFO,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PAINTICON';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PAINTICON,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ICONERASEBKGND';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ICONERASEBKGND,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NEXTDLGCTL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NEXTDLGCTL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SPOOLERSTATUS';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SPOOLERSTATUS,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DRAWITEM';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DRAWITEM,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MEASUREITEM';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MEASUREITEM,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DELETEITEM';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DELETEITEM,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_VKEYTOITEM';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_VKEYTOITEM,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CHARTOITEM';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CHARTOITEM,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETFONT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETFONT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETFONT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETFONT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETHOTKEY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETHOTKEY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETHOTKEY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETHOTKEY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUERYDRAGICON';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUERYDRAGICON,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COMPAREITEM';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COMPAREITEM,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETOBJECT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETOBJECT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COMPACTING';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COMPACTING,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COMMNOTIFY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COMMNOTIFY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_WINDOWPOSCHANGING';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_WINDOWPOSCHANGING,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_WINDOWPOSCHANGED';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_WINDOWPOSCHANGED,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_POWER';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_POWER,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COPYDATA';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COPYDATA,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CANCELJOURNAL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CANCELJOURNAL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NOTIFY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NOTIFY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_INPUTLANGCHANGEREQUEST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_INPUTLANGCHANGEREQUEST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_INPUTLANGCHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_INPUTLANGCHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_TCARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_TCARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_HELP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_HELP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_USERCHANGED';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_USERCHANGED,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NOTIFYFORMAT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NOTIFYFORMAT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CONTEXTMENU';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CONTEXTMENU,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_STYLECHANGING';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_STYLECHANGING,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_STYLECHANGED';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_STYLECHANGED,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DISPLAYCHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DISPLAYCHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETICON';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETICON,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SETICON';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SETICON,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCCREATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCCREATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCDESTROY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCDESTROY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCCALCSIZE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCCALCSIZE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCHITTEST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCHITTEST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCPAINT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCPAINT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCACTIVATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCACTIVATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_GETDLGCODE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_GETDLGCODE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCMOUSEMOVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCMOUSEMOVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCLBUTTONDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCLBUTTONDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCLBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCLBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCLBUTTONDBLCLK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCLBUTTONDBLCLK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCRBUTTONDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCRBUTTONDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCRBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCRBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCRBUTTONDBLCLK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCRBUTTONDBLCLK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCMBUTTONDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCMBUTTONDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCMBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCMBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NCMBUTTONDBLCLK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NCMBUTTONDBLCLK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_KEYFIRST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_KEYFIRST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_KEYDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_KEYDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_KEYUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_KEYUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CHAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CHAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DEADCHAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DEADCHAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSKEYDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSKEYDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSKEYUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSKEYUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSCHAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSCHAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSDEADCHAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSDEADCHAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_KEYLAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_KEYLAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_INITDIALOG';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_INITDIALOG,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COMMAND';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COMMAND,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SYSCOMMAND';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SYSCOMMAND,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_TIMER';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_TIMER,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_HSCROLL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_HSCROLL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_VSCROLL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_VSCROLL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_INITMENU';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_INITMENU,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_INITMENUPOPUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_INITMENUPOPUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MENUSELECT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MENUSELECT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MENUCHAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MENUCHAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ENTERIDLE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ENTERIDLE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MENURBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MENURBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MENUDRAG';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MENUDRAG,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MENUGETOBJECT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MENUGETOBJECT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_UNINITMENUPOPUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_UNINITMENUPOPUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MENUCOMMAND';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MENUCOMMAND,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CHANGEUISTATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CHANGEUISTATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_UPDATEUISTATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_UPDATEUISTATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUERYUISTATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUERYUISTATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLORMSGBOX';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLORMSGBOX,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLOREDIT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLOREDIT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLORLISTBOX';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLORLISTBOX,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLORBTN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLORBTN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLORDLG';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLORDLG,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLORSCROLLBAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLORSCROLLBAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CTLCOLORSTATIC';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CTLCOLORSTATIC,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSEFIRST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSEFIRST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSEMOVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSEMOVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_LBUTTONDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_LBUTTONDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_LBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_LBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_LBUTTONDBLCLK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_LBUTTONDBLCLK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_RBUTTONDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_RBUTTONDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_RBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_RBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_RBUTTONDBLCLK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_RBUTTONDBLCLK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MBUTTONDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MBUTTONDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MBUTTONUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MBUTTONUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MBUTTONDBLCLK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MBUTTONDBLCLK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSEWHEEL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSEWHEEL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSELAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSELAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PARENTNOTIFY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PARENTNOTIFY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ENTERMENULOOP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ENTERMENULOOP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_EXITMENULOOP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_EXITMENULOOP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_NEXTMENU';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_NEXTMENU,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SIZING';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SIZING,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CAPTURECHANGED';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CAPTURECHANGED,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOVING';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOVING,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_POWERBROADCAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_POWERBROADCAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DEVICECHANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DEVICECHANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_STARTCOMPOSITION';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_STARTCOMPOSITION,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_ENDCOMPOSITION';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_ENDCOMPOSITION,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_COMPOSITION';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_COMPOSITION,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_KEYLAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_KEYLAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_SETCONTEXT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_SETCONTEXT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_NOTIFY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_NOTIFY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_CONTROL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_CONTROL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_COMPOSITIONFULL';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_COMPOSITIONFULL,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_SELECT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_SELECT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_CHAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_CHAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_REQUEST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_REQUEST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_KEYDOWN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_KEYDOWN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_IME_KEYUP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_IME_KEYUP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDICREATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDICREATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIDESTROY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIDESTROY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIACTIVATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIACTIVATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIRESTORE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIRESTORE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDINEXT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDINEXT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIMAXIMIZE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIMAXIMIZE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDITILE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDITILE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDICASCADE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDICASCADE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIICONARRANGE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIICONARRANGE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIGETACTIVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIGETACTIVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDISETMENU';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDISETMENU,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ENTERSIZEMOVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ENTERSIZEMOVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_EXITSIZEMOVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_EXITSIZEMOVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DROPFILES';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DROPFILES,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MDIREFRESHMENU';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MDIREFRESHMENU,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSEHOVER';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSEHOVER,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_MOUSELEAVE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_MOUSELEAVE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CUT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CUT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COPY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COPY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PASTE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PASTE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CLEAR';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CLEAR,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_UNDO';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_UNDO,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_RENDERFORMAT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_RENDERFORMAT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_RENDERALLFORMATS';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_RENDERALLFORMATS,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DESTROYCLIPBOARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DESTROYCLIPBOARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DRAWCLIPBOARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DRAWCLIPBOARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PAINTCLIPBOARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PAINTCLIPBOARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_VSCROLLCLIPBOARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_VSCROLLCLIPBOARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_SIZECLIPBOARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_SIZECLIPBOARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_ASKCBFORMATNAME';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_ASKCBFORMATNAME,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_CHANGECBCHAIN';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_CHANGECBCHAIN,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_HSCROLLCLIPBOARD';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_HSCROLLCLIPBOARD,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_QUERYNEWPALETTE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_QUERYNEWPALETTE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PALETTEISCHANGING';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PALETTEISCHANGING,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PALETTECHANGED';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PALETTECHANGED,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_HOTKEY';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_HOTKEY,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PRINT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PRINT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PRINTCLIENT';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PRINTCLIENT,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_HANDHELDFIRST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_HANDHELDFIRST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_HANDHELDLAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_HANDHELDLAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PENWINFIRST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PENWINFIRST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_PENWINLAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_PENWINLAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COALESCE_FIRST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COALESCE_FIRST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_COALESCE_LAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_COALESCE_LAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_FIRST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_FIRST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_INITIATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_INITIATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_TERMINATE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_TERMINATE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_ADVISE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_ADVISE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_UNADVISE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_UNADVISE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_ACK';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_ACK,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_DATA';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_DATA,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_REQUEST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_REQUEST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_POKE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_POKE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_EXECUTE';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_EXECUTE,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_DDE_LAST';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_DDE_LAST,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_APP';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_APP,8);
  sgMess.RowCount:=sgMess.RowCount+1;
  sgMess.Cells[0,sgMess.RowCount-1]:='WM_USER';
  sgMess.Cells[1,sgMess.RowCount-1]:=inttohex(WM_USER,8);
end;

procedure TfmMess.FormCreate(Sender: TObject);
begin
   sgMess.InplaceEditor.ReadOnly:=true;
end;

procedure TfmMess.sgMessDblClick(Sender: TObject);
begin
  ModalResult:=mrOk;
end;

procedure TfmMess.LocateToId(ID: Integer);
var
  i: Integer;
begin
  for i:=1 to sgMess.RowCount-1 do begin
    if strtoint('$'+sgMess.Cells[1,i])=Id then begin
      sgMess.row:=i;
      exit;
    end;
  end; 
end;

function TfmMess.GetId: string;
begin
  result:=sgMess.Cells[1,sgMess.Row];
end;

end.
