Article View: borland.public.cppbuilder.nativeapi
Article #14480Re: Capture Running Applications !!
From: Stan
Date: Tue, 12 Aug 2003 08:25
Date: Tue, 12 Aug 2003 08:25
73 lines
2833 bytes
2833 bytes
Ok, I will try this
thanks for your reply
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3f37de49$1@newsgroups.borland.com...
>
> "Stan" <thewatcher@email.com> wrote in message
> news:3f3771bd@newsgroups.borland.com...
> > my problem comes with the Hook procedure which I do
> > not know how to manipulate, I don't know how send the
> > appropriate message that will contain these desired info.
> > for my applications, I don't know what parameters should
> > I pass to the SendMessage() api, and what should I receive
> > from it ??
>
> Have a look at the WM_COPYDATA message. You can use it to send any
> arbitrary data to a window. Simply create a struct that contains your
> desired info, then send a pointer of the struct to your application. For
> example:
>
> --- DLL ---
>
> struct MyInfo
> {
> ...
> };
>
> MyInfo info;
> // fill info as needed
>
> COPYDATASTRUCT cds = {0};
> cds.dwData = 0x12345678;
> cds.cbData = sizeof(info);
> cds.lpData = &info.
>
> SendMessage(hMyApp, WM_COPYDATA, 0, (LPARAM)&cds);
>
>
> --- Application ---
>
> struct MyInfo
> {
> ...
> };
>
> class TMyForm : public TForm
> {
> private:
> void __fastcall WMCopyData(TMessage &Msg);
> public:
> BEGIN_MESSAGE_MAP
> VCL_MESSAGE_HANDLER(WM_COPYDATA, TMessage, WMCopyData)
> END_MESSAGE_MAP(TForm)
> };
>
> void __fastcall TMyForm::WMCopyData(TMessage &Msg)
> {
> COPYDATASTRUCT *cds = (COPYDATASTRUCT*)Msgg.LParam;
> if( cds->dwData == 0x12345678 )
> {
> MyInfo *info = (MyInfo*)cds->lpData;
> // use info as needed
> Message.Result = TRUE;
> }
> else
> TForm::Dispatch(&Msg);
> }
>
>
> Gambit
>
>
Technical Details
Message-ID:
<3f38a2c2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f3771bd@newsgroups.borland.com> <3f37de49$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,f52c4c114e4bddc2 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-12 01:26:21 PST From: "Stan" <thewatcher@email.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f3771bd@newsgroups.borland.com> <3f37de49$1@newsgroups.borland.com> Subject: Re: Capture Running Applications !! Date: Tue, 12 Aug 2003 11:25:01 +0300 Lines: 75 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 NNTP-Posting-Host: 62.135.27.96 Message-ID: <3f38a2c2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060676290 62.135.27.96 (12 Aug 2003 01:18:10 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail