I am looking to make a program similar to Xfire which will overlay
information while playing a directx game. For an example of what xfire
is capable of, see the image below:
http://media.xfire.com/xfire/xf/them...ur_image_4.jpg
I believe it is possible to overlay to DX games without needing to use
directx since I don't see any calls to d3d or dd libraries in Xfire. I
am able to get a basic overlay using GetDesktopWindow but I have it on
a timer/thread with sleeps and it always flickers in-game. Putting it
on a constant loop thread by itself only slowed down the game
dramatically which is not useful. I was wondering if anyone could
provide me with a better sample of accomplishing this. My code is
below:
Font font = new Font("Verdana", 15);
PointF pointf = new PointF(5, 5);
IntPtr hwnd = GetDesktopWindow();
IntPtr hdc = GetWindowDC(hwnd);
RECT rect = new RECT();
GetClientRect(hwnd, ref rect);
DrawTextA(hdc, "test", -1, ref rect, 0);
ReleaseDC(hwnd, hdc);