L
Lindsay
I'm using the CallWndRetProc in a DLL to monitor for Explorer Windows.
Basically I'm using this procedure to find the Explorer windows (checking
for "ExploreWClass" and "CabinetWClass" classes) and adding their hwnd to an
array. The timer (set to 1 second interval) goes through the entire array
decrementing a timer for each hwnd. When the timer reaches zero, the window
is minimized. The CallWndRetProc uses the WM_CREATE to add the hwnd,
WM_DESTROY to remove the hwnd, and checks the Active/Inactive state. If the
hwnd becomes Active, the timer is reset and the window is ignored. When the
hwnd becomes Inactive the timer starts decrementing the timer for that hwnd.
Although the DLL works, I'm wondering if I've gone about this the right way.
I've never put a Windows Hook procedure in a DLL before, but it's neccessary
for system wide hooking of this kind.
Can anybody see a potential problem with this method?
Basically I'm using this procedure to find the Explorer windows (checking
for "ExploreWClass" and "CabinetWClass" classes) and adding their hwnd to an
array. The timer (set to 1 second interval) goes through the entire array
decrementing a timer for each hwnd. When the timer reaches zero, the window
is minimized. The CallWndRetProc uses the WM_CREATE to add the hwnd,
WM_DESTROY to remove the hwnd, and checks the Active/Inactive state. If the
hwnd becomes Active, the timer is reset and the window is ignored. When the
hwnd becomes Inactive the timer starts decrementing the timer for that hwnd.
Although the DLL works, I'm wondering if I've gone about this the right way.
I've never put a Windows Hook procedure in a DLL before, but it's neccessary
for system wide hooking of this kind.
Can anybody see a potential problem with this method?