Click here to Skip to main content
15,913,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: PostMessage to a different thread's messageQueue Pin
CPallini26-Mar-08 2:53
mveCPallini26-Mar-08 2:53 
GeneralRe: PostMessage to a different thread's messageQueue Pin
snir_ya26-Mar-08 3:24
snir_ya26-Mar-08 3:24 
GeneralRe: PostMessage to a different thread's messageQueue Pin
CPallini26-Mar-08 4:08
mveCPallini26-Mar-08 4:08 
GeneralRe: PostMessage to a different thread's messageQueue Pin
rp_suman26-Mar-08 4:56
rp_suman26-Mar-08 4:56 
GeneralDrawing text with DirectDraw Pin
Hanan88826-Mar-08 0:43
Hanan88826-Mar-08 0:43 
GeneralRe: Drawing text with DirectDraw Pin
James R. Twine26-Mar-08 1:45
James R. Twine26-Mar-08 1:45 
GeneralRe: Drawing text with DirectDraw Pin
Hanan88826-Mar-08 1:51
Hanan88826-Mar-08 1:51 
AnswerRe: Drawing text with DirectDraw Pin
Hanan88826-Mar-08 3:11
Hanan88826-Mar-08 3:11 
I managed to mix the DirectDraw and Windows GDI like this:
HDC hdc = NULL;
HRESULT result = m_lpDDSBack->GetDC(&hdc);  //m_lpDDSBack is my backbuffer surface
    wchar_t text[256] = "thank god";
    int x = 100;
    int y = 200;

    size_t length = wcslen(text);
CPTDDUtils::MyDrawText(hdc, x, y, text, length);

m_lpDDSBack->ReleaseDC(hdc);

void  CPTDDUtils::MyDrawText(HDC hdc, int x, int y, LPCTSTR lpString, int stringSize)
{
	/*HFONT*/ HGDIOBJ  hFont, hOldFont; 

	// Retrieve a handle to the variable stock font. 
	hFont = GetStockObject(ANSI_VAR_FONT); 

	// Select the variable stock font into the specified device context.
	if (hOldFont = SelectObject(hdc, hFont)) 
	{ 
		TextOut(hdc, x, y,lpString , stringSize); 

		// Restore the original font.	
		SelectObject(hdc, hOldFont); 
	}
}


I do this after I drew the bitmaps, and before I 'flip' .

So this draws the text but in white rectangle. I don't want the white rectangle, I want this rectangle to be transparent. Also, I rather use some normal font.

Also, if this code is 'messed up', please let me know. Smile | :)
GeneralRe: Drawing text with DirectDraw Pin
James R. Twine26-Mar-08 4:58
James R. Twine26-Mar-08 4:58 
GeneralRe: Drawing text with DirectDraw Pin
Hanan88826-Mar-08 5:39
Hanan88826-Mar-08 5:39 
GeneralRe: Drawing text with DirectDraw Pin
Stephen Hewitt26-Mar-08 13:54
Stephen Hewitt26-Mar-08 13:54 
GeneralRe: Drawing text with DirectDraw Pin
Hanan88826-Mar-08 22:39
Hanan88826-Mar-08 22:39 
General64 bit API Hooking Pin
San246826-Mar-08 0:01
San246826-Mar-08 0:01 
QuestionCan I draw in a RichEdit Control Pin
Desmond Mardle25-Mar-08 23:56
Desmond Mardle25-Mar-08 23:56 
AnswerRe: Can I draw in a RichEdit Control Pin
Rajasekharan Vengalil26-Mar-08 0:24
Rajasekharan Vengalil26-Mar-08 0:24 
Questiondifference between static_cast and dynamic cast? Pin
rowdy_vc++25-Mar-08 23:37
rowdy_vc++25-Mar-08 23:37 
AnswerRe: difference between static_cast and dynamic cast? Pin
Maxwell Chen25-Mar-08 23:46
Maxwell Chen25-Mar-08 23:46 
AnswerRe: difference between static_cast and dynamic cast? Pin
Cedric Moonen25-Mar-08 23:55
Cedric Moonen25-Mar-08 23:55 
AnswerRe: difference between static_cast and dynamic cast? Pin
CPallini26-Mar-08 0:05
mveCPallini26-Mar-08 0:05 
GeneralRe: difference between static_cast and dynamic cast? Pin
BadKarma26-Mar-08 2:54
BadKarma26-Mar-08 2:54 
GeneralRe: difference between static_cast and dynamic cast? Pin
CPallini26-Mar-08 3:08
mveCPallini26-Mar-08 3:08 
GeneralC++ UAC elevation error on code Pin
spiced25-Mar-08 23:36
spiced25-Mar-08 23:36 
GeneralRe: C++ UAC elevation error on code Pin
Rajasekharan Vengalil26-Mar-08 0:12
Rajasekharan Vengalil26-Mar-08 0:12 
GeneralDesktop item postion - Shell programming Pin
tom87@2125-Mar-08 23:31
tom87@2125-Mar-08 23:31 
GeneralMaking a copy of the object inside the object Pin
piul25-Mar-08 23:00
piul25-Mar-08 23:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.