I have a simple, dialog based, VC++ app using the MFC, it does nothing except
what the app wizard produced. I want my app to pick up and process the
WM_DEVICECHANGE message which gets sent to top level windows when the os detects
a device change (surprise surprise), e.g. something being plugged in a USB port
etc. However when I go to class wizard to add the message handler, no matter what
class I select the message never appears as one that I can handle!! Obviously I
don't want to go messing with the app wizard generated code .
Any suggestions? Ideally some sample code would great.
Cheers
Simon
Simon,
Class Wizard only supports the more common messages. It's not
difficult to add a message handler yourself, however searching though
the MFC docs, there is already one you can use.
Add ON_WM_DEVICECHANGE() to your message map, and implement a member
function afx_msg void OnDeviceChange( UINT, DWORD ).
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.
So my next step sometimes is to search the internet. I found the CodeGuru
web site a few years ago by searching the internet for an API function. I
found:
http://codeguru.earthweb.com/multimedia/cd_audio.shtml
Which might help.
"Simon Sadler" <simon....@sema.co.uk> wrote in message
news:0b7701c08d25$ec447670$b1e62ecf@tkmsftngxa04...