15,896,606 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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.
Alex Culea
24-Aug-12 16:51pm
View
The "Connection: Close" entry did the job. The server was keeping the connection alive. The code posted above is a bad example of coding but this was not the purpose of the question. Thank you very much!
Alex Culea
24-Aug-12 16:37pm
View
You are right about multi-threading debug. But somehow my case does not apply. This class is consumed by a worker thread. The thread itself is controlled by the UI using WINAPI message queues (PostMessage). The time it takes to receive the response is exactly the same when running in debug/release. Also, I set 2 breakpoints: one at the beginning of the method (the one shown above), and one at the end; and the time it takes the code to reach from A-B it's the same it takes when running without debugger. I'm stuck with this problem for a few days now, can't seem to find any clue. :(
Alex Culea
24-Aug-12 16:04pm
View
While it is my intention for recv to block (is running in a separate thread), the actual problem is that it blocks for too long. I updated the code to use the select function and still nothing. Also, when I test the code on a remote server (google.com) the recv function blocks until I stop debugging. Could it have anything to do with the socket creation code? Btw, thanks for your input.
Alex Culea
24-Aug-12 14:07pm
View
No, the webserver is not the culprit in this case. It takes my browser less than 1 sec to load the same message (a short .htm file). Also it's noticeable when debugging as I step through code that recv blocks.
Alex Culea
9-Jun-11 13:05pm
View
Your solution is the right answer to my problem, thanks a lot!
Show More