Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:58:58+00:00 2026-06-12T02:58:58+00:00

I am making a screen capturing application. There’s answer on how to capture an

  • 0

I am making a screen capturing application.

There’s answer on how to capture an active window, but I want to be able to capture a window under mouse even if it’s not active.

Do I understand correctly that I need to find handle of a window under mouse and then call Image.captureWindow(IntPtr handle)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:58:59+00:00Added an answer on June 12, 2026 at 2:58 am

    Use following function to get the cursor position in context of screen

        POINT p;
    if (GetCursorPos(&p))
    {
        //cursor position now in p.x and p.y
    }
    

    Now you will have to use the EnumWindow function to enumerate all top level windows and then for each try this

        if (ScreenToClient(hwnd, &p))
    {
        //p.x and p.y are now relative to hwnd's client area
    }
    

    when you get both the values positive for a window, thats the window on which your cursor is. Here is an example of how to capture a window from its handle

    http://www.codeproject.com/Articles/19192/How-to-capture-a-Window-as-an-Image-and-save-it

    Hope this helps you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a screen capturing application and everything is going fine. All I
I am making a screen cast nor capture of the functionality of our application.I
I am not sure what I clicked, but I was making a home screen
I'm making a form at the bottom of the screen and I want it
I'm making a media player application in android where one part of my screen
i want to know is there anyway that using Java one can capture the
I'm making a Cocoa application and I wanna implement a Screen Hot Corners System
I'm making a splash screen for my application. It's just static BufferedImage drawn by
I am making an phone gap android application for screen size 3.5 inches to
I am making a screen capture program with python. My current problem is PIL.ImageGrab.grab()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.