Solved

Moving my window causes no messages?

Posted on 1998-02-16
6
221 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 100 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…

738 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