How to disable a windows Message ?
I want to create a USB Mass Storage access control system where one can disable a particular USB Media with username and password as input. The idea i'm trying to workout is Using Global Hooks with hook parameter WH_GETMESSAGE i need to trap the WM_DEVICECHANGE message and disable it so that the device cannot be enabled. But the things are not working properly as i expected. i'm new to vc++ so can u pls help me on this...
The code i've tried in my Hook.cpp Dll is as follows... On executing this code with my MFC App when i insert my USB Drive the syatem tary icon for safe removal of usb drive is disabled and also the dock or undock sound in winxp was disabled. But still the drive can be accessed from My Computer . Also the WM_DEVICECHANGE can be monitored on spy++.
Thanks in Advance...
Re: How to disable a windows Message ?
First write the code in accordance with the manual
For example you don't handle the case where nCode<0 correctly.
Why do you need to PostMessage(HWND_BROADCAST, WM_NULL, 0, 0); in addition to modifying the existing message?
|All times are GMT +5.5. The time now is 07:46.|