P
Phil Crosby
Hi
I'm using Spy++ to look at the WM_PAINT window messages moving across the
word process, to see how the windows in Word are related. If you edit the
content of the document using the keyboard, it seems like the only windows
that receive a WM_PAINT message are the two MsoCommandBar windows (that are
children of the WwB document window) and the status bar. I think the actual
repainting of the document is happening in the WwG window. Why is it
repainting when there is no WM_PAINT message? I'm no expert in win32
painting, but I thought it was a best practice not to paint outside of a
WM_PAINT message.
I'm concerned because I'm interested in monitoring closely what Word is
doing - especially when it's done painting. I'm doing this for a research
prototype, so all hacks are allowed and best practices ignored ;-) I was
thinking of listening for WH_CALLWNDPROCRET using SetWindowHookEx and finding
out when the appropriate window was done responding to a WM_PAINT event.
However, if the Word window doing the redrawing of the document isn't sending
a "done" message when it's done painting, well, that strategy won't work.
Update:
To further investigate what's happening, I implemented a hack to monitor
calls to the BeginPaint and EndPaint methods in USER32.DLL as outlined in
this article:
http://www.fengyuan.com/article/wmprint.html
It seems the only windows that call BeginPaint are the windows I mentioned
in my first post. What other drawing method would Word use to paint on the
device context that corresponds to the window containing the document content?
Someone else ran into this issue while trying to force a hidden window
capture of Word-
http://www.probo.com/timr/blog/pyblosxom.cgi/2005/Nov
He mentions that the Word rendering window probably has its window style set
as CS_OWNDC (which I can't verify in Spy++), but even in that case I thought
you still needed to call BeginPaint to draw. Clearly that's not the case, as
no windows call BeginPaint when the document is modified except the two
MsoCommandBar windows and the status bar
I'm at a loss how to proceed. Are there any general pointers I should look
into? If Word might be calling GetDC or some other giveaway win32 method when
it starts painting that I can listen for, what might that method be?
Thanks!
-Phil Crosby
Note: this is a repost from here:
http://msdn.microsoft.com/newsgroup...6d4f-4b7d-b7f1-c60b33f0165f&lang=en&cr=US&p=1
I'm using Spy++ to look at the WM_PAINT window messages moving across the
word process, to see how the windows in Word are related. If you edit the
content of the document using the keyboard, it seems like the only windows
that receive a WM_PAINT message are the two MsoCommandBar windows (that are
children of the WwB document window) and the status bar. I think the actual
repainting of the document is happening in the WwG window. Why is it
repainting when there is no WM_PAINT message? I'm no expert in win32
painting, but I thought it was a best practice not to paint outside of a
WM_PAINT message.
I'm concerned because I'm interested in monitoring closely what Word is
doing - especially when it's done painting. I'm doing this for a research
prototype, so all hacks are allowed and best practices ignored ;-) I was
thinking of listening for WH_CALLWNDPROCRET using SetWindowHookEx and finding
out when the appropriate window was done responding to a WM_PAINT event.
However, if the Word window doing the redrawing of the document isn't sending
a "done" message when it's done painting, well, that strategy won't work.
Update:
To further investigate what's happening, I implemented a hack to monitor
calls to the BeginPaint and EndPaint methods in USER32.DLL as outlined in
this article:
http://www.fengyuan.com/article/wmprint.html
It seems the only windows that call BeginPaint are the windows I mentioned
in my first post. What other drawing method would Word use to paint on the
device context that corresponds to the window containing the document content?
Someone else ran into this issue while trying to force a hidden window
capture of Word-
http://www.probo.com/timr/blog/pyblosxom.cgi/2005/Nov
He mentions that the Word rendering window probably has its window style set
as CS_OWNDC (which I can't verify in Spy++), but even in that case I thought
you still needed to call BeginPaint to draw. Clearly that's not the case, as
no windows call BeginPaint when the document is modified except the two
MsoCommandBar windows and the status bar
I'm at a loss how to proceed. Are there any general pointers I should look
into? If Word might be calling GetDC or some other giveaway win32 method when
it starts painting that I can listen for, what might that method be?
Thanks!
-Phil Crosby
Note: this is a repost from here:
http://msdn.microsoft.com/newsgroup...6d4f-4b7d-b7f1-c60b33f0165f&lang=en&cr=US&p=1