我写个函数更新窗体  虽然执行成功但是不能显示  求解
HDC hDC = ::GetDC(m_hWnd);
RECT r;
GetClientRect(&r);
HBITMAP hBmp = ::CreateCompatibleBitmap(hDC,r.right,r.bottom);
HDC hMemDC = ::CreateCompatibleDC(hDC);
::SelectObject(hMemDC,hBmp); Graphics g(hMemDC);
g.SetSmoothingMode(SmoothingModeHighQuality);
g.FillRectangle(&SolidBrush(Color::Red), 0, 0, r.right, r.bottom); //background
if (boundColor.GetAlpha() != 0) {
g.DrawRectangle(&Pen(boundColor),0,0,r.right,r.bottom);
}
g.FillPath(textBrush,textPath);

BLENDFUNCTION blend = { AC_SRC_OVER, 0, m_transparency, AC_SRC_ALPHA };
POINT p = {0,0};
if (::UpdateLayeredWindow(m_hWnd,hDC,NULL,NULL,hMemDC,&p,0,&blend,ULW_ALPHA|ULW_COLORKEY) == TRUE) AfxMessageBox(L"update!!");
else 
{
DWORD e = GetLastError();
ASSERT("%d",e);
}
::DeleteObject(hBmp);
::DeleteDC(hMemDC);
::ReleaseDC(m_hWnd,hDC);

解决方案 »

  1.   

    没人回答坚持顶上去  up up up 
      

  2.   

    pptDst [in, optional] 
    Type: POINT*
     
    A pointer to a structure that specifies the new screen position of the layered window. If the current position is not changing, pptDst can be NULL. 
    psize [in, optional] 
    Type: SIZE*
     
    A pointer to a structure that specifies the new size of the layered window. If the size of the window is not changing, psize can be NULL. If hdcSrc is NULL, psize must be NULL. 这个误导我了  不为NULL执行成功  结贴