Peter Williams
2010-12-27 11:09:13 UTC
Hi All,
I am trying to port some Delphi 5 or 7 (cannot recall which) to Lazarus.
What do I change WM_USER to? I am getting Identifier not found.
Here is the code:
main.pas
const
WM_USER_APPLICATION_MINIMIZE = WM_USER+1;
// identifier not found WM_USER
type
[...]
private
{ Private declarations }
procedure OnUserAppMin(var M: TMessage);
message WM_USER_APPLICATION_MINIMIZE;
procedure TForm1.OnUserAppMin(var M: TMessage);
begin
Application.Minimize;
end; { OnUserAppMin }
{----------------------------------------------------------}
about.pas
procedure TForm2.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (key = VK_ESCAPE) then
begin
key := 0;
PostMessage(Form1.Handle, WM_USER_APPLICATION_MINIMIZE, 0, 0);
// error : Identifier not found WM_USER_APPLICATION_MINIMIZE
close;
end;
end; { FormKeyDown }
{----------------------------------------------------------}
I am trying to port some Delphi 5 or 7 (cannot recall which) to Lazarus.
What do I change WM_USER to? I am getting Identifier not found.
Here is the code:
main.pas
const
WM_USER_APPLICATION_MINIMIZE = WM_USER+1;
// identifier not found WM_USER
type
[...]
private
{ Private declarations }
procedure OnUserAppMin(var M: TMessage);
message WM_USER_APPLICATION_MINIMIZE;
procedure TForm1.OnUserAppMin(var M: TMessage);
begin
Application.Minimize;
end; { OnUserAppMin }
{----------------------------------------------------------}
about.pas
procedure TForm2.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (key = VK_ESCAPE) then
begin
key := 0;
PostMessage(Form1.Handle, WM_USER_APPLICATION_MINIMIZE, 0, 0);
// error : Identifier not found WM_USER_APPLICATION_MINIMIZE
close;
end;
end; { FormKeyDown }
{----------------------------------------------------------}