Click here to Skip to main content
15,887,434 members

Comments by Alex Culea (Top 10 by date)

Alex Culea 28-Mar-14 15:41pm View    
In theory, showing a popup window without getting activated is simple, here I fell in a pitfall in the positioning code when SetWindowPos'ing the menu window and not specifying each time SWP_NOACTIVATE. It seems that if you do not add the flag each time you are calling this function, the API will gracefully remove your WX_EX_SHOWNOACTIVATE without remorse. Lesson learned.

To capture mouse I have tried handling WM_WINDOWSPOSCHANGED checking for SWP_SHOWWINDOW and calling SetCapture(hMenuWnd). Then checking SWP_HIDEWINDOW to release the capture but this will deprive the children windows from getting WM_MOUSEMOVE (i'm having some nice mouse over effects there) and forwarding the message as with mouse presses does not return the correct results.

For now I will look into implementing a local hook as you correctly advised and see how that works. Will post a complete solution when I get all the pieces together.
Alex Culea 28-Mar-14 13:52pm View    
Thanks, almost worked. However this has created another set of issues. Since the window is no longer active, it no longer receives WM_KILLFOCUS either so it will not get hidden when the user clicks something else. I am currently working to get it to behave itself and once I come up with a complete solution, I'll mark your answer as accepted and provide more details, maybe even writing a tip on CP.
Alex Culea 28-Mar-14 0:37am View    
Thanks for your comment.

Yes. But the contents of my window gets drawn over by the other child controls and calling SetWindowPos(hMenuWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW );

But it did not change the Z-order in any way, still came behind the other controls.
Alex Culea 24-Aug-12 17:15pm View    
There is absolutely no concern with the send(). The reason why recv was blocking in the last call was because I wasn't specifing "Connection: close" in the HTTP header, and the server was keeping the connection alive thus causing recv to block. Now the requests take less than a sec on google.com (URL parsing, hostname resolving included).
Alex Culea 24-Aug-12 16:55pm View    
Nope I seen the results in the UI. My worker thread sends a notification to the main window which itself updates an multiline edit control with the response. Actually google.com is faster than locahost apache, LOL.