Hi, I need to save a bmp or jpg with the user screen, just like pressing PrintScreen. I found how to do this, but the mouse pointer is not shown (pointer is null )
the mouse pointer isnt actually part of the on screen graphics, but is implemented on the video card in a separate buffer, and is only combined with the image when it is sent to be drawn on the monitor.
the workaround i guess, after initialising your printscreen, is to query the system and find out where the mouse is, and what the current cursor is (if possible) and draw it on the image yourself..
Here, a working example.
Sometimes at first click it was not able to get the picture..it seems to happen half the time...Must check a bit more
Resize the form after a capture to see all what you got.
'***********************************************
Attached removed, modified and reloaded in next answers
The previous version used kebd_event api to
simulate a printScreen.
It worked fine on Win2K, but gave matters on win98
Thus I used a routine found in MSDN
at topic "HowTo: capture screen, a form or any window"
to capture screen if os is older than Win2k
'***********************************************
Last edited by Cimperiali; December 4th, 2003 at 11:23 AM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Here, modified a bit.
It is not a great job (only some error handling), it might be done better (ideas are welcome: I like to learn!), in any case, now it seems to work properly
'********************
Again, removed and attached a bit far down
'*********************
Last edited by Cimperiali; December 3rd, 2003 at 03:18 PM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Worked with win2k and now should work also with win9x
****************************************************
REBUILD once more, to (hopefully) make it work even on win9X...
****************************************************
a bit better, now....
and it should also be able to capture the Mouse shape even if it
is from another application...
Last edited by Cimperiali; December 5th, 2003 at 05:00 AM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Last edited by Cimperiali; December 8th, 2003 at 08:34 AM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.