I want to draw text on the screen above all the windows. I found out about HDC and start working with it. I had 2 problems: the text was flashing and there was background. I found out the function:
SetBkMode(hdc, TRANSPARENT);
but all it done is cancel the flashing. I still got background. My final code now is:
RECT rect = { 20, 20, 200, 200 };
SetTextColor(hdc,RGB(255,0,0));
SetBkMode(hdc, TRANSPARENT);
SetBkColor(hdc,RGBA(0,255,0,0));
DrawText(hdc, L"My text",-1,&rect,DT_LEFT);
I put this code in while(true) statement and sleep for 1 millisec. Before the while i got the hdc init:
HDC hdc = GetDC(0);
So at this point i got non flashing text but with background (not transparent). The background is half transparent so i can see what below it but it doesn't update. When i put a new window below it i can see the "background" of the old one.
I tried using wndproc like in this question: How to draw text with transparent background using c++/WinAPI? But it does nothing at all (i cant even see the text) I tried using the textout example from msdn site: http://msdn.microsoft.com/en-us/library/windows/desktop/dd145133(v=vs.85).aspx But it does nothing too.
How can i draw text on the screen without background at all? Thank you guys