is there any way to know when a window is repainted? I assume i should capture wm_paint messages or maybe somehow EndPaint() function (i think this would be better). So, does anyone know any methods for this?
is there any way to know when a window is repainted? I assume i should capture wm_paint messages or maybe somehow EndPaint() function (i think this would be better). So, does anyone know any methods for this?
What window?
If it's yours, yeah, just add the capture code right before you end your WM_PAINT case.
If you're talking about a different process, then you're going to have to hook the process' address space, then change the DLL import table to hook EndPaint, then have the code send the notification back to your process. If you're relativity new to C++, then this is going to be a very difficult task.
That's a pretty extreme solution, the usual way is to inject into the process and subclass the window.
thanks, setting a global hook works for me fine, because i want to detect evey paint message of all running windows
If you are in the same program, then yes you check the WM_PAINT being sent to the program. However, in a separate program, you'll have to do some DLL injection or Hooking probably.
★ Inferno provides Programming Tutorials in a variety of languages. Join our Programming Forums. ★
wm_paint works fine for all windows except menus and pop up menus, what messages are sent when a menu is redrawn? win api documentation says it is WM_DRAWITEM but i've done some research and i didnt find that this message would be sent to any window that uses menus.