🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

GetModuleFileName problem

#14124
From: Martin C
Date: Wed, 27 Aug 2003 21:11
16 lines
1665 bytes
I've a problem retrieving the full path of exe using GetModuleFileName
function inside a CBT hook for newly activated windows, I use the following
code as I received from here in previous posts.

GetModuleFileName(((HMODULE)GetWindowLong(hwndToNewWindow,
GWL_HINSTANCE)),buff,sizeof(buff));

when I use this function as shown above, sometimes I get the full path to
the exe for the newly created windows correct 100%, but sometimes I receive
strange results, example: if I try to run the hook, and opened an
application build by BCB, I receive the following as the path to the exe
name "c:\Windows\VCL50.bpl" !!!...

Can anybody help me please and tell me why I receive such problem....

thanks
Technical Details
Message-ID: <3f4d1e9e@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!priapus.visi.com!news-out.visi.com!petbe.visi.com!newshosting.com!news-xfer2.atl.newshosting.com!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,a9f30fdc93d98f91,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-08-27 14:16:13 PST
From: "Martin C" <martinc@aol.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: GetModuleFileName problem
Date: Wed, 27 Aug 2003 13:11:58 -0800
Lines: 18
Organization: V Safe
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: 62.135.7.223
Message-ID: <3f4d1e9e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1062018718 62.135.7.223 (27 Aug 2003 14:11:58 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail