How to make a windowless control repaint (its container) 
Author Message
 How to make a windowless control repaint (its container)

You may try using IOleInPlaceSiteWindowless::InvalidateRect or
InvalidateRgn to invalidate as small an area as possible. You can also
paint directly onto the container's DC - see
IOleInPlaceSiteWindowless::GetDC. IOleInPlaceSiteWindowless pointer is
stored in CComControl::m_spInPlaceSite. First check that your control
has indeed negotiated windowless status (m_bWndless is TRUE).

Actually, painting-intensive controls are better off being windowed.
Consider making your control windowed only (set m_bWindowOnly to TRUE in
your constructor). Then you have full control over repainting, and can
move to such architectures as OpenGL or DirectDraw for a performance
going beyond what GDI is capable of.
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

> UpdateWindow() doesn't seem to work. If you give it no parameters, it
> come back saying there is no window handler (which is right for the
> control). Trying to find the hWnd of the container so far hasn't given
> success either. Does anybody know the trick?

> (My basic problem is that InvalidateRect works, but much too slow as
> trying to repaint every few milliseconds).

> Thanks,

> Andy

Sat, 11 Sep 2004 01:52:19 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Windowless nonrectangular control doesn't repaint background

2. activex container supporting windowless controls

3. ActiveX container supporting windowless controls

4. windowless control and container's hwnd

5. MFC Container Dialog for a Windowless ActiveX Control

6. MFC Support for Windowless ActiveX Control Container

7. windowless activex container?

8. Windowless containers

9. Run-time container supporting windowless activation ...

10. Repaint containers background

11. Making small, windowless MFC apps

12. Convert windowed control to windowless control


Powered by phpBB® Forum Software