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
|
#include <Windows.h>
#include <iostream>
int main()
{
HDC hdc;
HWND app = FindWindow(0, "Solitaire");
DWORD id;
GetWindowThreadProcessId(app, &id);
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, id);
PAINTSTRUCT ps;
hdc = BeginPaint(app, &ps);
HPEN hPen,hOldPen;
COLORREF xio = RGB(255,0,0);
hPen = CreatePen(PS_SOLID, 10 , xio);
hOldPen = (HPEN)SelectObject(hdc, hPen);
MoveToEx(hdc,100,100,NULL);
LineTo(hdc,250,500);
system("pause");
}
|