On Oct 10, 2016, at 1:15 PM, A B dianaxxyyzz@gmail.com wrote:
Thank you for your response. I ' m trying to send WM_QUIT before send WM_CLOSE,when a user click on X ,but only when he close the main window . This is a ugly patch that prevent visual studio 6 to crash if a menu is opened and user click on X . That way I need to know if the hwnd from handle_wm_protocols() is the one of the main window or not , cause I need to send WM_QUIT only if user close his main program window.
Rather than sending WM_QUIT, I recommend that you try sending WM_CANCELMODE. You can send that to any window which the window manager closes without unintended consequences, so you don't need to attempt to determine which is the "main" window. In fact, this may not even be a hack; it might be the right thing to do.
On Oct 10, 2016, at 1:20 PM, A B dianaxxyyzz@gmail.com wrote:
Thinking from wine perspective , what will be the logic to find out if a hwnd is for the main window of a program ?
There is no logic to find that out because "main window" is not a well-defined concept and means nothing in terms of Wine/Windows internals. Visual Studio itself may consider one of its windows "main", but that is not exposed to Wine. The only significance is how VS behaves.
-Ken