Solved

Moving my window causes no messages?

Posted on 1998-02-16
6
216 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
  • 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

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

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 article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

15 Experts available now in Live!

Get 1:1 Help Now