1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
void TexMess()
{
hWnd = FindWindow(TEXT("Skyrim"), TEXT("Skyrim")); //Handle to game window
hDC = GetDC(hWnd); //Get device context from window handle
GetClientRect(hWnd, &Rec); //Create surface area
hdcMem = CreateCompatibleDC(hDC); //Memory DC
hbmMem = CreateCompatibleBitmap(hDC, Rec.right, Rec.bottom); //Memory bitmap
hOld = SelectObject(hdcMem, hbmMem);
backGRND = (HBRUSH)GetStockObject(NULL_BRUSH); //Supposed to be transparent
FillRect(hdcMem, &Rec, backGRND); //Supposed to apply transparency
SetBkMode(hdcMem, TRANSPARENT); //Text background transparent
SetTextColor(hdcMem, 0x000000FF); // Red text
DrawText(hdcMem, Text, wcslen(Text), &Rec, DT_CENTER); //Outputs the text
BitBlt(hDC, 0, 0, Rec.right, Rec.bottom, hdcMem, 0, 0, SRCCOPY); //Copies back buffer to primary buffer
//Take out the trash
SelectObject(hdcMem, hOld);
DeleteObject(hbmMem);
DeleteDC(hdcMem);
ReleaseDC(hWnd, hDC);
}
|