RE: [324] Contact-add window despite Messenger Lock
In C, I would use a hook looking for the WM_CREATE message, and then add it to a std::vector (a dynamic array which does all the allocations automatically). And then add each HWND and it's current state (hidden or visible). In the callback I would also check if Messenger is locked at that stage, and then hide the window if it is.
And then in my OnEvent_MessengerLocked event I would simply loop through the vector, hide all visible windows (but I would not update the state-vector). And in the OnEvent_MessengerUnlocked event I would set every HWND which had the state visible to visible.
I would set the state using the ShowWindow() API or similar.
|