Article View: borland.public.cppbuilder.nativeapi
Article #14069Re: CBT hooks and exe name
From: Remy Lebeau (TeamB)
Date: Mon, 25 Aug 2003 16:59
Date: Mon, 25 Aug 2003 16:59
25 lines
1860 bytes
1860 bytes
"Martin C" <martinc@aol.com> wrote in message
news:3f4a0317@newsgroups.borland.com...
> I've CBT hook application that help me get notified whenever an new window
> is to be created using HCBT_CREATEWND, but I need to know how I can get
the
> exe name of the newly created window from its handle?
You will need to use GetWindowThreadProcessId() to obtain the window's
process ID, then you can enumerate all of the running processes one at a
time until you find the cooresponding ID, at which time you will have the
executable name available as well. Look at the following article for more
information on enumerating processes:
HOWTO: Enumerate Applications Using Win32 APIs
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q175030
Gambit
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03
Technical Details
Message-ID:
<3f4a4088$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f4a0317@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ee2ed6328ff2f934 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-25 10:04:03 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f4a0317@newsgroups.borland.com> Subject: Re: CBT hooks and exe name Date: Mon, 25 Aug 2003 09:59:47 -0700 Lines: 27 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.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3f4a4088$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1061830792 207.175.226.26 (25 Aug 2003 09:59:52 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail