[TRUCO DELPHI] Crear un elemento en el Menu del Sistema.
delphi
Type TForm1 = Class(TForm) procedure FormCreate(Sender: TObject); private procedure OnAppMessage(Var Msg: TMsg; Var Handled: Boolean); end; Var Form1: TForm1; implementation Const cSC_MYMENUITEM = WM_USER + 1; {$R *.DFM} procedure TForm1.FormCreate(Sender: TObject); begin Application.OnMessage := OnAppMessage; AppendMenu(GetSystemMenu(Application.Handle, False), MF_SEPARATOR, 0, ''); AppendMenu(GetSystemMenu(Application.Handle, False), MF_STRING, SC_MyMenuItem, 'Delphi Access'); end; procedure TForm1.OnAppMessage(Var Msg: TMsg; Var Handled: Boolean); begin If (Msg.Message = WM_SYSCOMMAND) And (Msg.wParam = cSC_MYMENUITEM) Then begin ShowMessage('Mensaje recibido'); Handled := True; end; end;
Saludos!