Hi all
When i set the SetBkMode to TRANSPARENT
the background will not change when use TextOut
but if i need change the text, the previous text will not clear
and next text overwrite to old text
is there any way to clear previous text ??
PS: Don't tell me that TextOut blank text, it's not a correct answer
Posted on 2003-08-27 20:58:33 by jordanc
Show your code.

I try

case WM_PAINT:
const char msg1[] = "one message";
const char msg2[] = "two message";
HDC hdc = BeginPaint(hwnd, &ps);
SetBkMode(hdc, TRANSPARENT);
TextOut(hdc, 0, 0, msg1, lstrlen(msg2));
TextOut(hdc, 4, 4, msg2, lstrlen(msg1));
EndPaint(hwnd, &ps);
return 0;

Posted on 2003-08-28 00:02:29 by P2M
Hello P2M
like your result
the msg2 is or msg1 on screen
it's not i want
i hope msg2 can "cover" msg1, not "or"
Posted on 2003-08-28 01:07:59 by jordanc
Posted on 2003-08-28 01:10:10 by P2M
Why not switch back to opaque mode when you need draw so.
Posted on 2003-08-28 01:52:16 by C.Z.
SetBkMode does not have anything to do with the text you write, it merely turns on or off the transparency of the control (and text) background. The text is in the foreground.
Posted on 2003-08-28 06:12:45 by sluggy
Hi all

Use FillRect can solve my problem

thanks to all
Posted on 2003-08-28 21:00:56 by jordanc