Solved

WM_TIMER disabled On TitleBar MouseDown?

Posted on 1997-11-02
2
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

630 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