Two (2) questions that I need advise on at the same time.
I have been trying to put text to a screen buffer and then to bitblt the screen buffer to the screen. It works, but I would like some advice on it.
How I place the text to the screen buffer is my question.
Am I doing this correct?
Is DrawText what I should be using?
I tried to get the handle of the front buffer from its HDC,
to use it here instead of the handle of the main window, which I use here:
but all attempts have failed.
How do I get the handle of the front buffer if all that I have its HDC, which has not worked for me?
What I have tried:
I have the following where I draw text to a previous buffer then bitblt from a buffer to the screen. It works, I think.
I am not certain if I am doing this correct. Would you please look at it and advise me?
Processing_A_Buffer_Update = 1;
HDC_of_MainWindow = GetDC( Handle_of_MainWindow ) ;
SetBkMode( HDC_of_FRONT_BUFFER_001, TRANSPARENT );
SetTextColor(HDC_of_FRONT_BUFFER_001, RGB(255, 0, 0));
DrawText(HDC_of_FRONT_BUFFER_001, L"Red Text on Transparent Background!", -1, &rc, DT_CENTER|DT_VCENTER|DT_WORDBREAK);
ReleaseDC( Handle_of_MainWindow, HDC_of_MainWindow ) ;
Processing_A_Buffer_Update = 0;
I tried to use the handle of the FRONT_BUFFER_001 so that I could write text to that buffer in case I had used a different width or height than for the MainWindow but that did not work. Here is my attempt that did not work. No text shows up.
HWND Handle_of_FrontBuffer001 = WindowFromDC(HDC_of_FRONT_BUFFER_001);
That is why I am using the handle of the main window like this