🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #682

Re: How to use traditional Windows message and API function ?

#682
From: Luka Gabri�
Date: Fri, 22 Feb 2008 19:59
44 lines
2606 bytes
> Modify what code?  You'll have to be more specific about what you want to 
> do.
>
> - Dennis
>

I would like my DLL to comunicate with my application in any way. Windows
message api function seems like a good idea. This is the code for receiving
a message on date time change. When the message on date time change is
received, an event (or function) is triggered. I would like to "trigger" a
handler function in my application from my DLL, and pass some parameters if
possible.

Something like this should be in my application (this works for date/time
change i would like a handler for messages from another application, not
date/time)!

class TMyForm : public TForm
{
private:
    // declare a handler function for your message
    MESSAGE void __fastcall WM_TimeChange(TMessage &Message);

BEGIN_MESSAGE_MAP
    // associate your handler function with some message
    VCL_MESSAGE_HANDLER(WM_TIMECHANGE,              TMessage,
WM_TimeChange);
END_MESSAGE_MAP(TForm);
};

// in your source file
// define the handler function
MESSAGE void __fastcall TMyForm::WM_TimeChange(TMessage &Message)
{
    ShowMessage("Date or time has been changed!");
}

Now I need the code to send a meessage from DLL (or another application) to
my application. (I think it's the PostMessage method, but I'm not sure)!

I hope this clears what I want the code for.

Thanks,
Luka.
Technical Details
Message-ID: <47bf296d@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.osn.de!diablo1.news.osn.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <47b02ecf$1@newsgroups.borland.com> <MPG.221a525c60a3d10c989a5f@newsgroups.borland.com> <47b0d385$1@newsgroups.borland.com> <47b0d5c9$1@newsgroups.borland.com> <47be2fa2$1@newsgroups.borland.com> <47be52e0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,985e142ee2266c4
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Luka Gabri�" <luka.gabric@gmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <47b02ecf$1@newsgroups.borland.com> <MPG.221a525c60a3d10c989a5f@newsgroups.borland.com> <47b0d385$1@newsgroups.borland.com> <47b0d5c9$1@newsgroups.borland.com> <47be2fa2$1@newsgroups.borland.com> <47be52e0$1@newsgroups.borland.com>
Subject: Re: How to use traditional Windows message and API function ?
Date: Fri, 22 Feb 2008 20:59:52 +0100
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 89.201.136.128
Message-ID: <47bf296d@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1203710317 89.201.136.128 (22 Feb 2008 11:58:37 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news.osn.de!diablo1.news.osn.de!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail