Solved

WM_TIMER disabled On TitleBar MouseDown?

Posted on 1997-11-02
2
434 Views
Last Modified: 2013-11-20
I have a modeless dialog which I use a WM_TIMER message to perform socket processing.  The problem I am having is that if the left mouse button is held down on the dialog title bar, I no longer receive the WM_TIMER messages.  If the dialog is moved, I once again receive the messages, but if the button is simply held down and not released, I do not receive the WM_TIMER messages.

Is there something I can do that will allow the WM_TIMER messages to be dispatched in this case.  I do not want to
prevent the user from moving the dialog, so ignoring WM_NCLBUTTONDOWN messages is not an option.
0
Comment
Question by:TAdkins
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
Comment Utility
You might want to try using the timer callback instead of using the WM_TIMER message. If you specify NULL for the HWND of ::SetTimer, then you need to supply a function that gets called periodically. Another possibility would be to use the asynchronous version of the socket API.

The problem is that when the default wndproc for windows gets the WM_NCLBUTTONDOWN message, it goes into its own modal message loop to move the window, draw the window, etc. The modal message loop does not terminate until the WM_NCLBUTTONUP message. In the meantime, the WM_TIMER message is not seen in your message loop.

One final probability. You can handle WM_NCLBUTTONDOWN yourself, but this would require quite a bit of work.
0
 

Author Comment

by:TAdkins
Comment Utility
I tried using ::SetTimer with a callback.  It appears that
it still uses the WM_TIMER message.  The documentation for
::SetTimer says that is calls the callback when it processes
WM_TIMER.  Any other ideas?

We are using CAsyncSocket.  We are trying to using the timer
proc to go any process the callbacks from CASyncSocket.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now