Hi all..
How do i use DrawText in animate window. With the help of animate window i'm popping up my dialog box. And in WM_PAINT i'm using DrawText to put some text on Bitmap. DrawText works fine when i don't use animatewindow. But it didn't work when using animatewindow.
Code:case WM_PAINT: { PAINTSTRUCT ps; HDC hDC; hDC = BeginPaint(hWnd, &ps); RECT r = {0}; HDC hdc_bitmap_text = NULL; UpdateWindow(hWnd); GetClientRect(GetDlgItem(hWnd, IDC_NEW_BITMAP), &r); hdc_bitmap_text = GetDC(GetDlgItem(hWnd, IDC_NEW_BITMAP)); if(hdc_bitmap_text) { SetBkMode(hdc_bitmap_text, TRANSPARENT); SetTextColor(hdc_bitmap_text, RGB(0,0,0)); DrawText(hdc_bitmap_text, iCm->BitmapMessage, -1, &r, DT_SINGLELINE | DT_CENTER | DT_VCENTER); ReleaseDC(GetDlgItem(hWnd, IDC_NEW_BITMAP), hdc_bitmap_text); hdc_bitmap_text = NULL; } EndPaint(hWnd, &ps); break; }




Reply With Quote