🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Problem setting a system wide hook. Help please?

#16055
From: Spike
Date: Mon, 02 Jun 2003 09:30
24 lines
2009 bytes
Hi all,
I'm trying to make a program which can detect wether a certain program
is
starting. I was thinking about using a system wide hook, but I can't get
it to work.
I've got the source on my ftp ftp://130.89.161.107/ShellHook.zip . I
would like to know what I'm doing wrong. I looks like it almost works,
but for some reason I can't get the instace handle from DllMain.

I started by building the DLL file in a seperate project. When finished
I used "implib" to import the library (as a tutorial stated). Then I
opened a new application, include the DLL .cpps and made the rest of the
app. It looks like it runs OK (without errors that is), but it won't set
the hook, because the HINSTANCE is NULL.

Could someone please help me with his, as this is the first time I try
to program dlls as well as hooks...
By the way: I am using BCB 6. The project just contains functions to set
the hook and display a msg if a program starts, so no extra code to look
through...
-- 
Spike

while (!asleep()) sheep++;
Technical Details
Message-ID: <3edb1935$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,64ef2e065c89c8be,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-02 02:38:40 PST
From: "Spike" <vanoorspronk@not_hotmail.com.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Problem setting a system wide hook. Help please?
Date: Mon, 2 Jun 2003 11:30:43 +0200
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 130.89.161.107
Message-ID: <3edb1935$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1054546229 130.89.161.107 (2 Jun 2003 02:30:29 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail