Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I detect Removable Harddisk plug in or pull out?

6 views
Skip to first unread message

YaoQ

unread,
Dec 7, 2005, 12:51:48 AM12/7/05
to
Hi,

I'm new to WinCE. I want to refresh the file list when removable Harddisk
plug in or out.Is there any interruption flag or message? How can I detect?

Thank you!


Nicolas BESSON

unread,
Dec 7, 2005, 8:00:05 AM12/7/05
to
Take a look at RequestDeviceNotifications.


The device manager can notify us of the appearance and disappearance of
device interfaces.

Nicolas
--
Nicolas BESSON
ADENEO (ADESET)
Windows Embedded Consultant
nbesson AT adeneo DOT adetelgroup DOT com

Tel : +33 (0)4.72.18.08.40

"YaoQ" <ya...@dsp.ac.cn> wrote in message
news:O$SC9Hv%23FH...@tk2msftngp13.phx.gbl...

YaoQ

unread,
Dec 7, 2005, 8:44:51 PM12/7/05
to
> Take a look at RequestDeviceNotifications.

Thank you!

But I can't find RequestDeviceNotifications in WinCE5.0.

Is there suitable funtion for WinCE5.0?

<ctacke/>

unread,
Dec 7, 2005, 11:56:42 PM12/7/05
to
It's right here in the documentation.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddk5/html/wce50lrfrequestdevicenotifications.asp

-Chris


"YaoQ" <ya...@dsp.ac.cn> wrote in message

news:%23xmKii5%23FHA...@TK2MSFTNGP12.phx.gbl...

YaoQ

unread,
Dec 8, 2005, 1:07:04 AM12/8/05
to
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceddk5/html/wce50lrfrequestdevicenotifications.asp

Oh,I see.

But I don't know how to set GUID* devclass, and do I have to CreateMsgQueue
to get a HANDLE hMsgQ ? Is there any sample?

Thank you!


Paul G. Tobey [eMVP]

unread,
Dec 8, 2005, 10:48:41 AM12/8/05
to
Yes, you have to do that. Have you *looked* for a sample? There are seven
hits on microsoft.public.windowsce.* on "requestdevicenotifications
createmsgqueue". The first one shows code (in that case for detecting USB
devices being plugged in). Another shows the code for detecting device
mount of a hard disk.

Search using GoogleGroups, www.googlegroups.com.

Paul T.

"YaoQ" <ya...@dsp.ac.cn> wrote in message

news:ehcMJ17%23FHA...@TK2MSFTNGP14.phx.gbl...

YaoQ

unread,
Dec 8, 2005, 10:18:47 PM12/8/05
to
It seems I need to create a new thread to monitor the MsgQueue. Right?

Thank you!

"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> 写
入邮件 news:%233Lrc7A$FHA....@tk2msftngp13.phx.gbl...

Paul G. Tobey [eMVP]

unread,
Dec 9, 2005, 10:35:33 AM12/9/05
to
There are no have-to things, but that's the way I'd do it in most cases. It
just depends on what the rest of your code is doing...

Paul T.

"YaoQ" <ya...@dsp.ac.cn> wrote in message

news:uTgly7G$FHA....@TK2MSFTNGP14.phx.gbl...

YaoQ

unread,
Dec 13, 2005, 1:23:23 AM12/13/05
to
Thank you very much!


YaoQ

unread,
Dec 13, 2005, 8:53:02 PM12/13/05
to

"Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com> 写
入邮件 news:%2300nvYN$FHA....@TK2MSFTNGP14.phx.gbl...

> There are no have-to things, but that's the way I'd do it in most cases.
It
> just depends on what the rest of your code is doing...
>

The rest of my code is:

while ((bRet=GetMessage (&msg, NULL, 0, 0))!=0)
{
if(bRet==-1)
MessageBox(hWnd,T("Fatal ERROR"),0,0);
else
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}

How can I monitor the device attachment message?

Thank you!

Paul G. Tobey [eMVP]

unread,
Dec 14, 2005, 10:58:22 AM12/14/05
to
With a separate thread.

Paul T.

"YaoQ" <ya...@dsp.ac.cn> wrote in message

news:OnXEJDFA...@TK2MSFTNGP09.phx.gbl...

Steve Maillet (eMVP)

unread,
Dec 14, 2005, 7:44:11 PM12/14/05
to
The official MSDN-2540N training course contains, among many useful things
to know about PB and CE V5.0, a complete sample of using the device
notifications for detecting insertions of disk devices to implement an
AutoRun service. You can get a self paced version of the course at
http://www.EmbeddedFusion.com/msdn2540N.htm


--
Steve Maillet
EmbeddedFusion
www.EmbeddedFusion.com
smaillet at EmbeddedFusion dot com


0 new messages