Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to make OnMessage.....

Posted on 2001-06-29
3
Medium Priority
?
183 Views
Last Modified: 2010-04-06
How to make OnMessage event of your own, but that will capture messages even if Form of the application is not visible, which is after this lines:
    Form1.Visible:=False;
    Application.ShowMainForm:=False;
???
0
Comment
Question by:Jurica2505
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6237019
what about

application.onmessage := MyMessageHandler; ?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 6237046
What messages do you want to receive, because when I put a TTimer on the form, it will still receive the OnTimer events...
0
 
LVL 3

Accepted Solution

by:
f15iaf earned 300 total points
ID: 6237159
This is the example of making onmessage event;


unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  Tmesevent=procedure(var mes:Tmessage)of object;
  TForm1 = class(TForm)
  private
    mesev:Tmesevent;
    { Private declarations }
  public
        procedure wndproc(var message:Tmessage);override;
  published
        property OnMessage:Tmesevent read mesev write mesev;
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
procedure Tform1.wndproc(var message:Tmessage);
begin
        if(assigned(mesev))then
        mesev(message);
        inherited wndproc(message);
end;
{$R *.DFM}

end.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question