Here is an example that uses the accelerator table:
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, AppEvnts; type TForm1 = class(TForm) ApplicationEvents1: TApplicationEvents; procedure FormCreate(Sender: TObject); procedure ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); procedure FormDestroy(Sender: TObject); private FAccelTable: HACCEL; FAccels: array[0..1] of TAccel; protected procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND; end; var Form1: TForm1; implementation {$R *.dfm} const SC_Sticky = 170; SC_Original = 180; procedure TForm1.FormCreate(Sender: TObject); var SysMenu: HMENU; begin SysMenu := GetSystemMenu(Handle, False); AppendMenu (SysMenu, MF_SEPARATOR, 0, ''); AppendMenu (SysMenu, MF_STRING, SC_Sticky, 'Sticky'
Sertac akyuz
source share