🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Detecting media insertion/removal

#3355
From: Mike Wynne
Date: Thu, 29 Jun 2006 11:06
27 lines
2066 bytes
OK, I had another attempt with this code:

#define WM_DEVICE WM_USER+125

LPITEMIDLIST ppidl;

if (SHGetSpecialFolderLocation(Application->Handle , CSIDL_DRIVES, &ppidl) 
== NOERROR)
{
    SHChangeNotifyEntry shCNE;

    shCNE.pidl = ppidl;
    shCNE.fRecursive = TRUE;

    nID = SHChangeNotifyRegister(Application->Handle,
        SHCNRF_InterruptLevel | SHCNRF_ShellLevel,
                                    SHCNE_MEDIAINSERTED |SHCNE_MEDIAREMOVED
                                    | SHCNE_DRIVEREMOVED |SHCNE_DRIVEADD,
                                    WM_DEVICE,
                                    1,
                                    &shCNE);
}

But still, my application doesn't recieve any WM_DEVICE messages on 
insert/eject.  I get the feeling I'm missing something really obvious...

MikeW
Technical Details
Message-ID: <44a3b431@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44a17fbc$1@newsgroups.borland.com> <44a1a4e8$1@newsgroups.borland.com> <44a1aa53@newsgroups.borland.com> <44a1c9cc$1@newsgroups.borland.com> <44a22030@newsgroups.borland.com> <44a2a037$1@newsgroups.borland.com> <44a2cf86$1@newsgroups.borland.com> <44a2f062$1@newsgroups.borland.com> <44a2f16a$1@newsgroups.borland.com> <44a3082c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e15854a90a45465d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Wynne" <mikeywyn@hotmail.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <44a17fbc$1@newsgroups.borland.com> <44a1a4e8$1@newsgroups.borland.com> <44a1aa53@newsgroups.borland.com> <44a1c9cc$1@newsgroups.borland.com> <44a22030@newsgroups.borland.com> <44a2a037$1@newsgroups.borland.com> <44a2cf86$1@newsgroups.borland.com> <44a2f062$1@newsgroups.borland.com> <44a2f16a$1@newsgroups.borland.com> <44a3082c@newsgroups.borland.com>
Subject: Re: Detecting media insertion/removal
Date: Thu, 29 Jun 2006 12:06:26 +0100
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 62.188.49.47
Message-ID: <44a3b431@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1151579185 62.188.49.47 (29 Jun 2006 04:06:25 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail