Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Window handling manager

I have a Windows box that is running three applications. When the applications are started each application creates a borderless window which is positioned such that they overlap in a particular way.

At the moment, when I click on a control on the bottom window, it comes to the top of the window stack.

I need to ensure that each window keeps its order in the window stack even if a window receives input.

I am thinking I need to write some sort of simple window manager that will maintain the correct Z-order of the windows.

The problem is, I need to know if a particular window has changed position. I have found that there is a WM_WINDOWPOSCHANGING message but my understanding is that this message is send to the window whose position has changed.

I need my window manager application to be somehow notified that the Z-order has changed.

Is there some way I can catch all WM_ messages and determine if the message applies to one of the windows I wish to control?

like image 888
JRT Avatar asked Dec 20 '25 00:12

JRT


1 Answers

Instead of MSalter's approach trying to DLL injection into each of the running the application, consider installing a WH_CBT Windows hook. In your CBTProc, return 0 when you get a HCBT_MOVESIZE for the three application window handles you care about.

Read MSDN for the docs on CBTProc and SetWindowsHookEx.

like image 191
Ants Avatar answered Dec 22 '25 15:12

Ants



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!