Link to home
Start Free TrialLog in
Avatar of erictankok
erictankok

asked on

Window event callback if I have a window's m_hwnd ...

Hi,

In my own application, how do I recieve a minimisation event (WM_MINIMIZE) from a window (eg. Command Prompt) when it minimises and unminimises?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of cookre
cookre
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of erictankok
erictankok

ASKER

Thanks.

is there a way to use SetWindowsHookEx() without having to put the CallWndProc() in another DLL? This is because my application is just a EXE file.

For example,

SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC) CallWndProc, NULL, 0)

Can the above work with my CallWndProc located in my main program?

With the callback for a global hook in an external dll, the callback code will still be in RAM for the OS to call even if your code exits without releasing the hook.  The OS thus need not check for the presence of the callback before each call to it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh well. I can't have a separate DLL due to certain project requirements. So I guess I will have to use a timer to poll for window minimisation.

Thanks everyone for your help.