🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: shellextension DLL get path - Autorun files

#11271
From: Remy Lebeau (TeamB)
Date: Sun, 22 Feb 2004 04:08
33 lines
2054 bytes
"nik" <neusser@okstate.edu> wrote in message
news:4037b2bb$1@newsgroups.borland.com...

> is it possible to get the path to the folder in which my
> dll is saved and running from?

Look at GetModuleFileName(), passing it the DLL's (not the application's)
HINSTANCE.

> i.e. i have an shellextensionDll to add my own menuitems to
> specific filetypes.
> c:\mypath\mydll.dll
> I want to retrieve c:\mypath

A better approach is to simply read the DLL's path from the Registry.  You
have to register the DLL in order for the OS to find it to begin with.  So
you can find it the same way the OS does - just read the path from the
Registry key where the DLL is registered.

If that is not what you are asking for, then you need to explain what you
are trying to accomplish exactly.

> is there a possibility to get informed just BEFORE a usb stick is
> unplugged from a computer using the "savely removing hardware"
> command?

Look at the WM_DEVICECHANGE message, specifically at the
DBT_DEVICEQUERYREMOVE or DBT_DEVICEREMOVEPENDING notification.  And maybe at
the RegisterDeviceNotification() function as well.


Gambit
Technical Details
Message-ID: <40382950$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4037b2bb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,906606b9b07f2e00
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-21 20:09:27 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4037b2bb$1@newsgroups.borland.com>
Subject: Re: shellextension DLL get path - Autorun files
Date: Sat, 21 Feb 2004 20:08:17 -0800
Lines: 35
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: 67.22.138.253
Message-ID: <40382950$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1077422416 67.22.138.253 (21 Feb 2004 20:00:16 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail