From: Faisal on 8 Feb 2010 04:43 Raymond Chen's blog says, messages like WM_PAINT, WM_QUIT messages are treated in special way. http://blogs.msdn.com/oldnewthing/archive/2005/11/04/489028.aspx ie, even if more than one message is posted, system combines the messages only once the windowprocedure is called. I need this behaviour for a WM_APP or registered message. Is it possible?
From: David Lowndes on 8 Feb 2010 05:21 >Raymond Chen's blog says, messages like WM_PAINT, WM_QUIT messages are >treated in special way. >http://blogs.msdn.com/oldnewthing/archive/2005/11/04/489028.aspx > >ie, even if more than one message is posted, system combines the >messages only once the windowprocedure is called. >I need this behaviour for a WM_APP or registered message. Is it >possible? You'd need to roll it yourself - use PeekMessage to filter for your specific message. Dave
From: Goran on 8 Feb 2010 09:56 On Feb 8, 10:43 am, Faisal <faisal...(a)gmail.com> wrote: > Raymond Chen's blog says, messages like WM_PAINT, WM_QUIT messages are > treated in special way.http://blogs.msdn.com/oldnewthing/archive/2005/11/04/489028.aspx > > ie, even if more than one message is posted, system combines the > messages only once the windowprocedure is called. > I need this behaviour for a WM_APP or registered message. Is it > possible? As David said, you can roll your own easily and I don't know of any mechanics supported by the system either. That said... It's a strange question. It seems to me that you are not asking with an explanation of a problem, but with an explanation of a solution. That's usually a wrong way to ask. What exactly are you trying to do? If you explain your problem, someone could help much better. And finally, could it be that some OnIdle scheme could work for your case, did you consider that? Goran.
From: Joseph M. Newcomer on 8 Feb 2010 11:35 See below... On Mon, 8 Feb 2010 06:56:54 -0800 (PST), Goran <goran.pusic(a)gmail.com> wrote: >On Feb 8, 10:43�am, Faisal <faisal...(a)gmail.com> wrote: >> Raymond Chen's blog says, messages like WM_PAINT, WM_QUIT messages are >> treated in special way.http://blogs.msdn.com/oldnewthing/archive/2005/11/04/489028.aspx >> >> ie, even if more than one message is posted, system combines the >> messages only once the windowprocedure is called. >> I need this behaviour for a WM_APP or registered message. Is it >> possible? > >As David said, you can roll your own easily and I don't know of any >mechanics supported by the system either. > >That said... It's a strange question. It seems to me that you are not >asking with an explanation of a problem, but with an explanation of a >solution. That's usually a wrong way to ask. What exactly are you >trying to do? If you explain your problem, someone could help much >better. **** I agree. This is another "How do I implement this solution?" instead of "How do I solve this problem?" question. The answer is: you can't implement this solution. Don't even waste time trying. BUT: if you state your problem, there might be a half-dozen different ways of handling it effectively. We would have to know what kind of information you want to combine and the specification of what "combine" means. THe OnIdle suggestion below is one of the many ways you can tackle this. There are others. Questions include whether or not these messages are created in a single thread or in multiple threads, and sent via SendMessage or PostMessage. Note that WM_PAINT is not an official message, and in fact they are not "combined". What is combined is the collection of invalidated regions in your client area; when the WM_PAINT is eventually generated it reports the clipping region as the union of all invalidated regions. This is only because the creation of the message is deferred. In your case, you either have to come up with a way of deferring the message, or a way of "combining" the information that the message reports. joe **** > >And finally, could it be that some OnIdle scheme could work for your >case, did you consider that? > >Goran. Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on 8 Feb 2010 13:16 Just a clarification: I said WM_PAINT is not an official message. This means it NEVER, EVER appears in the message queue; it is never sent via SendMessage or PostMessage. It is an entirely synthetic message, created whenever the low-level GetMessage handler feels like it, specifically, it feels like it if there are no other messages in the queue and there are no timers pending. joe On Mon, 08 Feb 2010 11:35:24 -0500, Joseph M. Newcomer <newcomer(a)flounder.com> wrote: >See below... >On Mon, 8 Feb 2010 06:56:54 -0800 (PST), Goran <goran.pusic(a)gmail.com> wrote: > >>On Feb 8, 10:43�am, Faisal <faisal...(a)gmail.com> wrote: >>> Raymond Chen's blog says, messages like WM_PAINT, WM_QUIT messages are >>> treated in special way.http://blogs.msdn.com/oldnewthing/archive/2005/11/04/489028.aspx >>> >>> ie, even if more than one message is posted, system combines the >>> messages only once the windowprocedure is called. >>> I need this behaviour for a WM_APP or registered message. Is it >>> possible? >> >>As David said, you can roll your own easily and I don't know of any >>mechanics supported by the system either. >> >>That said... It's a strange question. It seems to me that you are not >>asking with an explanation of a problem, but with an explanation of a >>solution. That's usually a wrong way to ask. What exactly are you >>trying to do? If you explain your problem, someone could help much >>better. >**** >I agree. This is another "How do I implement this solution?" instead of "How do I solve >this problem?" question. > >The answer is: you can't implement this solution. Don't even waste time trying. > >BUT: if you state your problem, there might be a half-dozen different ways of handling it >effectively. We would have to know what kind of information you want to combine and the >specification of what "combine" means. > >THe OnIdle suggestion below is one of the many ways you can tackle this. There are >others. Questions include whether or not these messages are created in a single thread or >in multiple threads, and sent via SendMessage or PostMessage. > >Note that WM_PAINT is not an official message, and in fact they are not "combined". What >is combined is the collection of invalidated regions in your client area; when the >WM_PAINT is eventually generated it reports the clipping region as the union of all >invalidated regions. This is only because the creation of the message is deferred. In >your case, you either have to come up with a way of deferring the message, or a way of >"combining" the information that the message reports. > joe >**** >> >>And finally, could it be that some OnIdle scheme could work for your >>case, did you consider that? >> >>Goran. >Joseph M. Newcomer [MVP] >email: newcomer(a)flounder.com >Web: http://www.flounder.com >MVP Tips: http://www.flounder.com/mvp_tips.htm Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
|
Pages: 1 Prev: PolyLine and autoscrolling canvas (0/1) Next: CFileDialog |