Solved

How to make OnMessage.....

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now