Originally Posted by shadybyte
I want to use one of my programs to write on top of the window for another of my programs. I'll try to be as clear as I can. This is a sample of the code I used.
HANDLE hwindow;
HDC hdc;
if ((hwindow = FindWindow(NULL, TEXT("Target Window"))) != NULL) {
hdc = GetDC (hwindow);
TextOut (hdc, 0, 0, TEXT ("Hello Window"), 12);
ReleaseDC(hwindow, hdc);
}
Now I open the program with the caption "Target Window" and low and behold, the words "Hello Window" are no where to be seen. I am 100% sure that FindWindow() did find the window with the right caption. What I do not understand is this: What is the actual coordinate system (map mode) of hdc? Is hdc a device context for the whole window or for the window's client area, and whichever one it's for, how do I get the DC for the other? And most importantly of course, why do I not see the words "Hello Window" anywhere on top of the "Target Window"?
Thank you!