?
Solved

Moving my window causes no messages?

Posted on 1998-02-16
6
Medium Priority
?
223 Views
Last Modified: 2013-12-03
When user moves my program's window or even child windows, all my WM_TIMER and MM_WIM_DATA and MM_WOM_DONE messages stop coming! Why is this? It's causing problems for me since if I'm playing/recording audio I miss my necessary notifications if user takes too long to move a window. How do I get around this?
0
Comment
Question by:RLM
[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
  • 2
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 400 total points
ID: 1411339
Try to move window yourself. Handle WM_NCLBUTTONDOWN and when mouse pointer is over caption bar. Then capture window messages with SetCapture. Now all WM_MOUSEMOVE messages will be sent to your window. You can move window with SetWindowPos and moreover perform additional actions. When user releases mouse call ReleaseCapture
0
 
LVL 22

Expert Comment

by:nietod
ID: 1411340
Galkin presented the correct solution, but didn't explain what what the problem actually was!  In case you are curious, what is happening is that when a window is moved (or a menu is down or a message box is up, as well) windows executes a private message loop.  So the messages are still occuring, code written in the operating system is getting the messages and is ignoring ones that it can't handle.  

Galkin's solution will fix this, although he just outlined it, there will be a lot of details to handle.  However, you will have the same problem when a menu is down and that is much harder to handle!
0
 

Author Comment

by:RLM
ID: 1411341
There must be an easier solution!? MS would've known this problem would arise, no? Isn't there anyway for me to get my messages dispatched to me? Alot of MS apps have to deal with this same problem and I'm sure they're not manually moving their windows and manually handling menus.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 7

Expert Comment

by:galkin
ID: 1411342
No this is the common problem. For instance I have window where I display animation and this animation stops playing while I am moving window. I don't know if this feature is by design or it is a bug
0
 
LVL 22

Expert Comment

by:nietod
ID: 1411343
You can get timer messages (I believe) if you create a timer for a specific window.  However most other messages will not get through.  There is no other way around it that I've ever seen.  You are not alone.  This problem probably appears here monthly.
0
 

Author Comment

by:RLM
ID: 1411344
hehe, sorry for not believing you 1st time. guess i'll just ignore it and maybe user will avoid moving my window after he starts to here the audio clipping.

Thanks for both helping me.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

771 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