To the main page...The list of my products...Some texts...Sample applications, tips, tricks...If you need support...

Self-starting configurable service
Step 5. Do send message to the service

Well, create the regular application, drop a button onto its main form and add modify OnClick event as follows:


procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
    Ini: TIniFile;
    ThreadId: Integer;
    if ThreadId = 0 then
        Raise Exception.Create('Service Ex22SvcA is not started');

Save and compile the client, install and run the service. Then run the client application and press a button. You will hear a couple of beeps meaning that our service successfully receives windows messages!

The source code of this step is available here (zip, 5.4kb). By the way it plays a well known melody instead of two beeps :)

<< | Index | Step 1 | Step 2 | Step 3 | Step 4 | Step 5
Add your comment | Read comments

© 1998-2001 Alexey Dynnikov
My ICQ # is 18267212