CSGO: FullScreen Draw
-> I am trying to draw graphics to a HDC app (CS:GO).
-> I am using this code to draw in fullscreen :
-> This code worked for Fullscreen 5 months ago but it is not working now. Do you have an Update for cs go?
RECT m_Rect;
HDC HDC_Desktop;
HBRUSH EnemyBrush;
HFONT Font;
HWND TargetWnd;
HWND Handle;
DWORD DwProcId;
COLORREF SnapLineCOLOR;
COLORREF TextCOLOR;
void SetupDrawing(HDC hDesktop, HWND handle)
{
HDC_Desktop = hDesktop;
Handle = handle;
EnemyBrush = CreateSolidBrush(RGB(255, 0, 0));
//Color
SnapLineCOLOR = RGB(0, 0, 255);
TextCOLOR = RGB(0, 255, 0);
}
void DrawString(int x, int y, COLORREF color, const char* text)
{
SetTextAlign(HDC_Desktop, TA_CENTER | TA_NOUPDATECP);
SetBkColor(HDC_Desktop, RGB(0, 0, 0));
SetBkMode(HDC_Desktop, TRANSPARENT);
SetTextColor(HDC_Desktop, color);
SelectObject(HDC_Desktop, Font);
TextOutA(HDC_Desktop, x, y, text, strlen(text));
DeleteObject(Font);
}
int main()
{
TargetWnd = FindWindow( 0, L"Counter-Strike: Global Offensive");
if (TargetWnd)
{
HDC HDC_Desktop = GetDC(TargetWnd);
SetupDrawing(HDC_Desktop, TargetWnd);
for (;;)
{
GetWindowRect(TargetWnd, &m_Rect);
DrawString(150, 150, TextCOLOR, "saddasdassd");
}
}
return 0;
}
it works fine if application is on windowed mode. But when I switch it to fullscreen mode, I am unable to draw graphics.
I tried setting hWnd to application’s hWnd instead of zero, but no luck.
|