Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Send/Handle message to window question

7 views
Skip to first unread message

Imrich Kovac

unread,
Jul 4, 1999, 3:00:00 AM7/4/99
to
Hi all

I want send and receive special message (like WM_COMMAND) to a window
in my application. But componets like TForm, TApplication have
encapsulated message handling.
Do you have any clue how to do it ?? Do I need write raw Windows
application for this purpose ??

Thanks
Imrich Kovac

exit

unread,
Jul 4, 1999, 3:00:00 AM7/4/99
to
you mean like creating a message handler? something like this..

type
TForm1 = class(TForm)
private
{ Private declarations }
public
procedure wmmove(var msg: tmessage); message wm_move; //trap wm_move message
{ Public declarations }
end;

var
Form1: TForm1;

implementation

procedure tform1.wmmove(var msg: tmessage);
begin
caption:=inttostr(left);
end;

>Subject: Send/Handle message to window question
>From: imr...@cmic.sk (Imrich Kovac)
>Date: Sun, 04 July 1999 03:39 PM EDT
>Message-id: <377fb547...@nntp.uunet.ca>

Damian Wright

unread,
Jul 5, 1999, 3:00:00 AM7/5/99
to
This might help...


const

WM_FILEREADY = WM_USER + 2000;

procedure TForm1.FormCreate(Sender: TObject);

begin
Application.OnMessage := AppMessage;
end;

procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
if Msg.message = WM_FILEREADY then
begin
Memo1.Lines.LoadFromFile(StrPas(PChar(Msg.lParam)));
Handled := True;
end;
{ for all other messages, Handled remains False }
{ so that other message handlers can respond }
end;

Damian


Imrich Kovac <imr...@cmic.sk> wrote in message
news:377fb547...@nntp.uunet.ca...

0 new messages