Tried hook, GetMessage and spy(created MFC application, provided the handle of the mfc application window and checked for the win messages. Through spy i got to know along with WM_DEVICECHANGE , WM_GETICON, WM_CANCELMODE, WM_ACTIVATEAPP and WM_ACTIVATETOPLEVEL also is sent by windows.