Thread: Screen Snapshot with Cursor

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    39

    Screen Snapshot with Cursor

    Hi all,

    I have written a code that takes a snapshot of the Screen and the mouse pointer and generates a .bmp file. I have managed to succesfully capture the cursor location but the problem is that the snapshot generated shows the mouse cursor as a Hourglass icon (or any relative icon that shows a busy state).
    I have used a combination of GetIconInfo and DrawIconEx to do this.
    There could be 2 possible reasons (acc. to me)
    1) WHen the code takes a snapshot of the screen/captures the mouse pointer it temporarily (not visible to the eye) goes into a busy state and that is why the captured image shows that way
    2) I may not have specified everything required to aquire the correct icon of the cursor and so it takes some default icon (which may be the busy state icon).

    I would like to know if the method I followed is correct as regards to capturing the cursor and why it is unable to get the correct Icon of the cursor

    Thanks

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Welcome to the boards.

    If you just need a default system cursor, then you can get their handles with LoadImage using the LR_SHARED flag - see LoadCursor for the system identifiers necessary to return the respective handles.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    May 2005
    Posts
    39
    Hi Ken,

    I don't know what the 'default system cursor' term means. Basically, I just want to be able to capture the cursor as it is while it is being displayed on the window and would like it to appear in the snapshot i take.
    In my case what will be the 'file' from which I would need to load the image when I use LoadImage(); ?
    LoadCursor(); will enable me to get the handle of a cursor 'resource identifier' like IDC_ARROW, IDC_CROSS etc. But I would like to get the identifier of the cursor that is visible on the desktop as I move it on the screen.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 04:56 PM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  3. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  4. Trouble getting snapshot of screen :(
    By Hunter2 in forum Game Programming
    Replies: 2
    Last Post: 04-25-2003, 09:41 AM
  5. Mouse in 800x600 24Bit Mode?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 11-11-2001, 01:38 AM