Please help with Screen Capture Wallpaper with PaintDesktop(HDC hdc) API
-
Hello all, I am trying to capture desktop wallpaper into memory device context, but it wasn't successful. Here are the steps I did. 1: create a DC for the screen and create a compatible memory DC to screen DC 2: get screen resolution for bitmap width and height 3: create a bitmap compatible with the screen DC with width and height obtained from step 2 4: select created bitmap into memory DC as a drawing surface 5: create clipping region in the memory DC 6: paint the desktop pattern to the memory DC with PaintDesktop(HDC hdc) API function 7: copy the bitmap in the memory DC on to the clipboard, I got a black image when pasting it to WordPad. Could you please give me some pointers for this problem? Did you spot any problems in the steps I performed? I can tell that PaintDesktop() didn't paint the desktop pattern into my memory DC. I really got stuck. Thank you very much for your help. :) :) ;) :) :) :) :)
-
Hello all, I am trying to capture desktop wallpaper into memory device context, but it wasn't successful. Here are the steps I did. 1: create a DC for the screen and create a compatible memory DC to screen DC 2: get screen resolution for bitmap width and height 3: create a bitmap compatible with the screen DC with width and height obtained from step 2 4: select created bitmap into memory DC as a drawing surface 5: create clipping region in the memory DC 6: paint the desktop pattern to the memory DC with PaintDesktop(HDC hdc) API function 7: copy the bitmap in the memory DC on to the clipboard, I got a black image when pasting it to WordPad. Could you please give me some pointers for this problem? Did you spot any problems in the steps I performed? I can tell that PaintDesktop() didn't paint the desktop pattern into my memory DC. I really got stuck. Thank you very much for your help. :) :) ;) :) :) :) :)
HKEY_CURRENT_USER\Desktop\Wallpaper will give you the path to the wallpaper file, then it would be easy to use ::LoadImage ( assuming a bmp ) to load it into a DC and copy it across to another if desired. Christian #include "std_disclaimer.h" People who love sausage and respect the law should never watch either one being made. The things that come to those who wait are usually the things left by those who got there first.
-
Hello all, I am trying to capture desktop wallpaper into memory device context, but it wasn't successful. Here are the steps I did. 1: create a DC for the screen and create a compatible memory DC to screen DC 2: get screen resolution for bitmap width and height 3: create a bitmap compatible with the screen DC with width and height obtained from step 2 4: select created bitmap into memory DC as a drawing surface 5: create clipping region in the memory DC 6: paint the desktop pattern to the memory DC with PaintDesktop(HDC hdc) API function 7: copy the bitmap in the memory DC on to the clipboard, I got a black image when pasting it to WordPad. Could you please give me some pointers for this problem? Did you spot any problems in the steps I performed? I can tell that PaintDesktop() didn't paint the desktop pattern into my memory DC. I really got stuck. Thank you very much for your help. :) :) ;) :) :) :) :)
PaintDesktop worked OK with memory device context in NT 4. In Windows 2000 it fails. The funny thing is that you can call PaintDesktop with HDC obtained using ::GetDC or CClientDC and it will work, even on Win2000. Tomasz Sowinski -- http://www.shooltz.com.pl