simple GDI problem
I have a simple one script windows shell, and within winmain I am trying to
blit a rectangle from the desktop to my window, in vague anticipation of
making a ''screen mate'' thingy (like that anoying sheep and the felix pet
food advert that leaps around the desktop.) No direct X here, simple old
GDI.
I have a very tenuous grip on what exactly all this means, but here goes:
// ShowWindow(hwnd, SW_HIDE);
HDC hdcScreen ;
hdcScreen = CreateDC("DISPLAY", NULL, NULL, NULL);
BitBlt(hdc,
0,0,
WINDOW_WIDTH /2, WINDOW_HEIGHT/2,
&hdcScreen,
200,200,
SRCCOPY);
// ShowWindow(hwnd, SW_SHOW);
ReleaseDC(hwnd,hdc);
This seems to work, but not very well! The visual effect is midely
displeasing, in that you get a dr who title sequence effect in the window,
the image replicating like Microsoft Patience game when you win! The
nastiest aspect of the code is the way it eats up memory, and is rather
destructive. I had to restart my machine after each attempt, and once this
required a Windows ME system restore. Incidentally I am compiling with
visual studio 6.
What will fix the code??
January 17, 2002 08:45 AM
It''d be an incredibly good idea to follow up your CreateDC with a DeleteDC when you''re through with it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement