I have an Office plug-in (native C++) which is fairly involving with Office. One of the thing I'm doing is finding the HWND of the main window, and subclass that window. On various occasions I also GetDC that window, and paint my own stuff on top of the Office document.
I'm also using IAT hooking (fairly standard) of various Windows API.
I've a 'Decorate' function that draw on the HDC directly. Until Office 2010, I called my method immediately after Office handled WM_PAINT, and also after WM_KEYUP. That was working fine.
Starting with Office 2013, WinWord pains the client area in times I failed to track. Moreover, I cannot even find any GDI API that Office is using when repainting it's client area. I'm putting a hook on DrawText (gdi), or DrawString (gdi+).
As far as I can tell, WinWord will repaint the client area (and hence - delete my decoration) even without calling GetDC, BeginPaint, or ReleaseDC!
I'm almost out of ideas. I'll appreciate any idea that Office could use to touch the screen? I'm setup to hook any function, and/or Windows message - just can't find what has to be hooked. Any other idea (no need for complete solution - just an direction will be fine). Any tool that can be used (e.g. is there anything similar to FileMon for GDI methods?) will be appreciated.