lopez86100
September 14th, 2007, 07:55 PM
When I run textout in function lunched with CreateThread() (the same effect with _beginthread) text doesn't appear on window. But when I run this function normally , it sends text to the window. Here is the function
DWORD WINAPI SetScreenText(void * data){
InvalidateRect(hwnda, NULL, TRUE);
RedrawWindow(hwnda, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW | RDW_UPDATENOW | RDW_INTERNALPAINT);
HDC df;
UpdateWindow(hwnda);
SetBkMode((df=GetDC(hwnda)), TRANSPARENT);
/*
SetTextColor(
df, // handle to DC
0xFF << 0 // text color
);
*/
ExtTextOut(
df, // handle to DC
10, // x-coordinate of starting position
10, // y-coordinate of reference point
ETO_CLIPPED, // text-output options
NULL, // optional dimensions
text, // character string
size , // number of characters in string
NULL // array of spacing values
);
}
//some of variables are global
DWORD WINAPI SetScreenText(void * data){
InvalidateRect(hwnda, NULL, TRUE);
RedrawWindow(hwnda, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_ERASENOW | RDW_UPDATENOW | RDW_INTERNALPAINT);
HDC df;
UpdateWindow(hwnda);
SetBkMode((df=GetDC(hwnda)), TRANSPARENT);
/*
SetTextColor(
df, // handle to DC
0xFF << 0 // text color
);
*/
ExtTextOut(
df, // handle to DC
10, // x-coordinate of starting position
10, // y-coordinate of reference point
ETO_CLIPPED, // text-output options
NULL, // optional dimensions
text, // character string
size , // number of characters in string
NULL // array of spacing values
);
}
//some of variables are global