Thank-you for your reply: This is how my Child is created:
BOOL RTWindRoseGadget::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
BOOL bCreated = CWnd::Create( lpszClassName, lpszWindowName, dwStyle, m_Rect, pParentWnd, nID, pContext);
// Here I have a section of code that creates a ChartDirector object. This is commented whilst I investigate the OnMove issue
return bCreated;
RTWindRoseGadget::RTWindRoseGadget()
{
........
.......
SetWindowLongPtr(this->m_hWnd, GWL_EXSTYLE, GetWindowLongPtr(this->m_hWnd, GWL_EXSTYLE) | WS_EX_COMPOSITED);
if (m_bTransparent)
{
LONG ExtendedStyle = GetWindowLong(this->m_hWnd, GWL_EXSTYLE);
SetWindowLong(this->m_hWnd, GWL_EXSTYLE, ExtendedStyle | WS_EX_LAYERED | WS_EX_TRANSPARENT);
::SetLayeredWindowAttributes(this->m_hWnd, RGB(1, 11, 21), 0, LWA_COLORKEY);
}
void RTWindRoseGadget::OnMove(int x, int y)
{
TRACE("OnMove\r");
// refresh donor bitmap and force display
if (IsWindow(m_RTWindRoseViewer.m_hWnd))
{
m_RTWindRoseViewer.Invalidate();
}
Invalidate();
UpdateWindow();
}
void RTWindRoseGadget::OnMove(int x, int y)
{
TRACE("OnMove\r");
// refresh donor bitmap and force display
if (IsWindow(m_RTWindRoseViewer.m_hWnd))
{
m_RTWindRoseViewer.Invalidate();
}
Invalidate();
UpdateWindow();
}
void RTWindRoseGadget::OnSize(UINT nType, int cx, int cy)
{
TRACE("OnSize\r");
Gadget::OnSize(nType, cx, cy);
CRect rectC;
GetClientRect(rectC); // get client rect for this gadget
m_RTWindChart.SetGraphDimensions(rectC.Width(), rectC.Height());
if (IsWindow(m_RTWindRoseViewer.m_hWnd))
{
m_RTWindRoseViewer.Invalidate();
}
Invalidate();
UpdateWindow();
}
As I haven't created the Chart object, the chart viewer invalidate is not called.
Does the above help?
Regards