Article View: borland.public.cppbuilder.nativeapi
Article #14197Re: Window thread problem
From: Gnum
Date: Thu, 04 Sep 2003 03:14
Date: Thu, 04 Sep 2003 03:14
50 lines
2673 bytes
2673 bytes
What is a difference between .DLL and .EXE in a view-point of your hook?
If windows has been created by BROWSEUI.dll that IS Browser itself,
just take it as fact.
Or what are you trying to achieve?
Gnum
"Martin C" <martinc@aol.com> wrote in message
news:3f55de92@newsgroups.borland.com...
> Hi all,
>
> I am trying to make CBT hook using HSHELL_WINDOWCREATED to get notified
once
> a new window is being created, to retrieve the window handle and the (exe
> name) that initiated this window, although every time I try to run
Internet
> Explorer (as an example) I receive (BROWSEUI.dll) as the exe that
initiated
> this window, I don't know how to get (iexplorer.exe) instead of
> (BROWSEUI.dll).
>
> I use the following code sequence:
>
> //Get the handle of the newly created window
> HWND hwndToNewWindow = (HWND)wParam;
>
> // Get the windows title
> if(hwndToNewWindow != NULL) { GetWindowText(hwndToNewWindow, title,
256); }
>
> //Get the full path of the exe that initiated the window
> GetModuleFileName(((HMODULE)GetWindowLong(hwndToNewWindow,
> GWL_HINSTANCE)),buff,sizeof(buff));
>
> //Get the process ID of the Application that created this window
> TheParentWindowProcessID=GetWindowThreadProcessId(hwndToNewWindow, NULL);
>
> //Then compare the (TheParentWindowProcessID) with all running windows
> process using (CreateToolhelp32Snapshot) function and start comparing
> (Proc.th32ProcessID) with the (TheParentWindowProcessID)
>
> and after all of this I still get BROWSEUI.dll as the exe that created
this
> window !, so can someone tell me please what I am doing wrong here...
>
> I am developing using BCB5 under Windows XP
>
> thanks
>
>
Technical Details
Message-ID:
<3f56ada4$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f55de92@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,e603364ec1c07f71 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-03 20:22:06 PST Reply-To: "Gnum" <alexanderL@marketpulse.biz> From: "Gnum" <alexanderL@marketpulse.biz> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f55de92@newsgroups.borland.com> Subject: Re: Window thread problem Date: Thu, 4 Sep 2003 15:14:10 +1200 Lines: 52 Organization: MarketPulse 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: 203.109.192.137 Message-ID: <3f56ada4$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1062645156 203.109.192.137 (3 Sep 2003 20:12:36 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail