Friday, August 19, 2005

DLLs and CallWndRetProc and Timers

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?
(Asked by Lindsay)

3 Comments:

At 7:54 AM, August 19, 2005, Anonymous Anonymous said...

Yeah, my copy of the standard doesn't describe CallWndRetProc(). Try
asking in a MS newsgroup (ms.public.*)

 
At 7:54 AM, August 19, 2005, Anonymous Anonymous said...

It should. I only have the standard edition too.

 
At 7:55 AM, August 19, 2005, Anonymous Anonymous said...

I should have been more clear. My copy of the ISO C++ Standard does not
discuss CallWndRetProc(). It is a MS-Windows specific function, and as
such is Off-topic in this newsgroup.

Please try a newsgroup beginning with "microsoft.public".

 

Post a Comment

<< Home