I have my application and third-party application. And I need to know that the window of third-party application has been maximized. Is there any way to know it?
At first, I thought that I could use my own callback function for handling events of this window.
SetWindowLong(hwnd, GWL_WNDPROC, (LONG)WindowProc);
But this function fails with error "Access denied". And this happens for a reason. It's not very wise to change something in the window that you don't own.
So what should I do?
Use GetWindowPlacement function. Make sure you set the length member of WINDOWPLACEMENT to sizeof(WINDOWPLACEMENT) before calling GetWindowPlacement.
The showCmd field of the returned WINDOWPLACEMENT structure should be equal to SW_MAXIMIZE (3) if the window is maximized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With