Task bar hook
Posted: Sep 22, 2007 @ 3:19am
I've been making a task bar hook and so far everything has been quite straight forward. However, I'm stuck with how to identify the current window to send it either a WM_CLOSE or minimize it based on whether it has an "OK" or "smart minimize". I don't want to call the default wndproc for the mousedown/up messages because it causes it to redraw and I'm drawing it myself.
Minimize is working ok - haven't had a case where it doesn't work properly yet.
Close works for some windows but not others.
Originally I thought it was just a matter of GetForegroundWindow() to get the current window and send it a WM_CLOSE. However, if I have my task bar hook running and go to calendar and "Menu -> New Appointment" it displays a window that has an "OK" so should respond to a WM_CLOSE as expected, but it just does nothing. I don't know if the problem is GetForegroundWindow() is not returning the correct window - i.e. maybe it's returning the main window not that specific dialog? or maybe it's the window doesn't respond to a normal WM_CLOSE and needs something else as well?
Minimize is working ok - haven't had a case where it doesn't work properly yet.
Close works for some windows but not others.
Originally I thought it was just a matter of GetForegroundWindow() to get the current window and send it a WM_CLOSE. However, if I have my task bar hook running and go to calendar and "Menu -> New Appointment" it displays a window that has an "OK" so should respond to a WM_CLOSE as expected, but it just does nothing. I don't know if the problem is GetForegroundWindow() is not returning the correct window - i.e. maybe it's returning the main window not that specific dialog? or maybe it's the window doesn't respond to a normal WM_CLOSE and needs something else as well?