Solved

WM_TIMER disabled On TitleBar MouseDown?

Posted on 1997-11-02
2
437 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
ID: 1309216
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
ID: 1309217
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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