Solved

How to make OnMessage.....

Posted on 2001-06-29
3
179 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

623 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