Transparenter Text

Felheart

Grünschnabel
Hi,
ich will mittels DrawText bzw. TextOut einfach auf den Desktop zeichen.
Dabei habe ich aber Probleme.

1. Der Hintergrund des Textes ist nicht transparent obwohl ich
SetBkMode(hdc, TRANSPARENT);
benutze.

Hier mal der Source:

Code:
int main()
{

	LPCSTR pString = ":]";
	tagRECT r;
	HWND hwnd = GetDesktopWindow();
	HDC hdc = GetWindowDC(NULL);


	srand((unsigned)time(0));

	SetBkMode(hdc, TRANSPARENT);
	SetBkColor(hdc, RGB(0, 0, 0));
	SetTextColor(hdc, RGB(255, 255, 255));
	SelectObject(hdc, Font);
	FillRect(hdc, &r, (HBRUSH)GetStockObject(BLACK_BRUSH));
	while(1)
	{

		r.left = 0;
		r.top = 0;
		r.right = 1440;
		r.bottom = 900;

		TCHAR text[] = "TRANSPARENTER TEXT";
		TextOut(hdc, (1440/2)-(500), (900/2)-(300), text, ARRAYSIZE(text));
	
		if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
		{
			return 0;
		}

		Sleep(1);
	}
}
 
Zurück