I know CeRunAppAtEvent can run an exe at this event. However, I want to
detect this evenet in my application that is currently runnining. All I want
to do is to pop-up a warning message telling the user to plug the card back
in order or run the application. I see on my Pocket PC that File Explorer
detects the removal and remove the "Storage Card" from the folder list when
the card is unplugged, so the mechanism is there!

Any ideas?

Re: How do you detect removal/unplugging of a CF/SD card? by ctacke/>

ctacke/>
Tue Apr 04 15:16:32 CDT 2006

CeRunAppAtEvent can set a named system event. Simply have a worker thread
in your existing app that calls WaitForSingleObject on the event and handle
when it occurs.

-Chris


"Robert" <rliuyh@yahoo.com> wrote in message
news:uiIVFOCWGHA.3740@TK2MSFTNGP03.phx.gbl...
>I know CeRunAppAtEvent can run an exe at this event. However, I want to
>detect this evenet in my application that is currently runnining. All I
>want to do is to pop-up a warning message telling the user to plug the card
>back in order or run the application. I see on my Pocket PC that File
>Explorer detects the removal and remove the "Storage Card" from the folder
>list when the card is unplugged, so the mechanism is there!
>
> Any ideas?
>



Re: How do you detect removal/unplugging of a CF/SD card? by Lao

Lao
Tue Apr 04 16:16:50 CDT 2006

Chris points out the right direction. You can find ready-to-compile
source code here:
http://windowsmobilepro.blogspot.com/2005/11/pocket-pc-power-management-series-4.html

The source code is for detecting device wakeup, but the idea is the
same as card removal, replacing NOTIFICATION_EVENT_WAKEUP with
NOTIFICATION_EVENT_DEVICE_CHANGE.
---
Lao K
Windows Mobile Pocket PC Smartphone Programming Hints and Tips
http://windowsmobilepro.blogspot.com