Thread: Take screenshot every second with a mouse cursor

  1. #1
    Registered User
    Join Date
    Jan 2020
    Posts
    6

    Question Take screenshot every second with a mouse cursor

    I am new to C programming. But I would like to create a small application (for Windows) that runs in the background and takes a screenshot every 1 second and saves it as "screenshot.jpg" and also include a mouse cursor where the current mouse location is. For example I have a "cursor.png" and it could be drawn at the current mouse position on top of the screenshot.


    How could I go about creating and application like this?


    I think I need the following things.



    1. Every second take a screenshot
    2. Get current mouse X, Y coordinates
    3. Draw the "cursor.png" on top of my screenshot at the X, Y coordinates
    4. Save the screenshot to "screenshot.jpg"



    Repeat again at step 1.


    I would appreciate some ideas how I could do this...

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,106
    A simple Google search using "screen capture api windows" would bring up "About 21,300,000 results (0.64 seconds)".

    Start with the top and examine the first, and subsequent pages and see if any of these fit your needs, or can point you to another link.

    Good luck! I don't do Mickey$oft windoze. ;^)

  3. #3
    Registered User
    Join Date
    Jan 2020
    Posts
    6
    Quote Originally Posted by rstanley View Post
    A simple Google search using "screen capture api windows" would bring up "About 21,300,000 results (0.64 seconds)".

    Start with the top and examine the first, and subsequent pages and see if any of these fit your needs, or can point you to another link.

    Good luck! I don't do Mickey$oft windoze. ;^)
    Already did that, that is why I asked. I couldn't find anything that did this...

  4. #4
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    Quote Originally Posted by martins View Post
    Already did that, that is why I asked. I couldn't find anything that did this...
    Did you search on MSDN? Here's an example (not quite what you want, but it is a start): Capturing an image

  5. #5
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,106
    Quote Originally Posted by martins View Post
    Already did that, that is why I asked. I couldn't find anything that did this...
    The api code is there, among the "21,300,000 results", but what me be missing is the C code you need to call these api's!

    YOU have to write this code or look in Github, Sourceforge.net, or some other source to see if anyone has already written similar code that you can adapt to your needs.

    We cannot and will not write that code for you.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use C++ to move mouse cursor
    By AJk101 in forum C++ Programming
    Replies: 5
    Last Post: 02-02-2011, 07:03 AM
  2. Getting the position of the mouse cursor
    By Mavix in forum Game Programming
    Replies: 5
    Last Post: 12-27-2007, 04:02 PM
  3. Display Mouse cursor
    By chad101 in forum Game Programming
    Replies: 0
    Last Post: 03-26-2007, 07:20 AM
  4. mouse/cursor trailer?
    By Queatrix in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 10-10-2005, 02:37 AM
  5. changing mouse cursor
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 12-25-2001, 09:39 PM

Tags for this Thread