|
-
October 16th, 2008, 06:16 AM
#1
[RESOLVED] DrawText in AnimateWindow.
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;
}
Last edited by techie.ashish; October 16th, 2008 at 06:26 AM.
-
October 16th, 2008, 11:19 AM
#2
Re: DrawText in AnimateWindow.
Not sure what your goal is with trying to draw into a control from the parent window. Why not let the control handle it's own painting.
Also, calling UpdateWindow from a WM_PAINT handler is a No-no.
-
October 17th, 2008, 01:23 AM
#3
Re: DrawText in AnimateWindow.
Yes Thanks..I was not giving opportunity to control to handle the painting..
Thanks a ton...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|