----
вот может кому из вуайеристов пригодится
----
Прежде чем написать на ASM сначала пробую на
DELPHI
-------
unit SystemMenu1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, AppEvnts;
type
TForm1 = class(TForm)
Button1: TButton;
ApplicationEvents1: TApplicationEvents;
procedure Button1Click(Sender: TObject);
procedure ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var
HWND_Sysmenu : HWND;
Str : PAnsiChar;
begin
{}
// function GetSystemMenu(hWnd: HWND; bRevert: BOOL): HMENU; stdcall;
Str := 'Hello';
HWND_Sysmenu := GetSystemMenu(Form1.Handle,False);
AppendMenu(HWND_Sysmenu,MFT_String and MF_PopUp and MFS_Checked and MFS_HiLite,$0A000,str);
end;
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
{}
if (Msg.message=WM_SYSCOMMAND) and (Msg.wParam=$0A000) then
begin
MessageDlg('System Menu',mtERROR,[mbYes],0);
end;
end;
end.