Skip to main content
GameDev.net gamedev.net
🔒 Locked

simple GDI problem

Started by graeme Jan 17, 2002 at 8:41 AM 0 replies 500+ views
Original Post
graeme
graeme
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??

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.