|
Short story: Catch Windows device notifications, system settings updates, and power status.
Longer description from old site: click here.
To be edited...
This sample, or the one from which it originally derived, was published (or at least peripherally mentioned) in the following article(s):
- No Such Thing as a Windowless VB App, Classic VB Corner, VSM Online, November 2009
- Listening to ThunderMain, Classic VB Corner, VSM Online, December 2009
- Monitoring System Power Status, Classic VB Corner, VSM Online, January 2010
This sample uses the following API calls:
Module Library Function CSysInfoDevice.cls kernel32
user32CloseHandle
CreateFile
RtlMoveMemory
RegisterDeviceNotification
UnregisterDeviceNotificationCSysInfoGeneral.cls kernel32 RtlMoveMemory CSysInfoPower.cls kernel32 GetSystemPowerStatus
RtlMoveMemoryMHookXP.bas comctl32
kernel32DefSubclassProc (#413)
GetWindowSubclass (#411)
RemoveWindowSubclass (#412)
SetWindowSubclass (#410)
lstrlen
OutputDebugString
RtlMoveMemoryMSysInfo.bas kernel32
user32RtlMoveMemory
EnumThreadWindows
GetClassName
GetWindowLongDon't see what you're looking for? Here's a complete API cross-reference.
Please, enjoy and learn from this sample. Include its code within your own projects, if you wish. But, in order to insure only the most recent code is available to all, I ask that you don't share the sample by any form of mass distribution. Download SysInfo.zip, 24Kb, Last Updated: Tuesday, November 17, 2009
The following resources may also be of interest:
- HookXP - Demonstrates native Windows subclassing method with no risk of improper teardown. Very flexible!