<div dir="ltr"><div><div>Thank you for your response.<br></div>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 . <br></div>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.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 10, 2016 at 9:07 PM, Ken Thomases <span dir="ltr"><<a href="mailto:ken@codeweavers.com" target="_blank">ken@codeweavers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm CC'ing the list.  Please keep the discussion on the list.<br>
<span class=""><br>
On Oct 10, 2016, at 12:26 PM, A B <<a href="mailto:dianaxxyyzz@gmail.com">dianaxxyyzz@gmail.com</a>> wrote:<br>
><br>
> If we run the command: wine program.exe , does wine save the hwnd of the main window for the program.exe ? And how to get it ? For example if I want to printf in wine logs ,the hwnd of the main window of program.exe , is this hwnd saved somewhere in a wine variable ?<br>
<br>
</span>The concept of "main window" of a program is purely a human interpretation.  There's no such concept in the Win32 API.  Therefore, there's no specific variable in Wine which holds the "main" window's handle.<br>
<br>
You can collect a +win debug log and you'll see the window handle of all of the windows created by the program (along with a lot of activity related to them).  It's up to you to determine which is the main window.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Ken<br>
<br>
</font></span></blockquote></div><br></div>