Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Get Application Window Handle from mouse click, C++

Get Application Window Handle from mouse click, C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++questioncsharpvisual-studiotutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arthur89kim
    wrote on last edited by
    #1

    Hi all, I'm using Visual Studio 2005 with MFC application. Is there a coding method to obtain Application Window's handle and rect with a mouse click? :confused: Let's say I have a transparent window with WS_EX_TOPMOST attribute and there are other window applications such as Microsoft Word, Mozilla Firefox and Window Explorer. I was told to obtain the rect and the handle of the window application with a mouse click while the transparent window on TOPMOST. Example: I click on Mozilla Firefox while all other windows are opened and on top of mozilla and yet the transparent window is on TOPMOST of all. How do I obtain the RECT as well as the handle?? By the way, I'm trying to BitBlt that Mozilla with a mouse click with all window including my own created MFC window on top of it. :-O

    You smile at me and I smile at you, And so one smile makes two~

    G 1 Reply Last reply
    0
    • A arthur89kim

      Hi all, I'm using Visual Studio 2005 with MFC application. Is there a coding method to obtain Application Window's handle and rect with a mouse click? :confused: Let's say I have a transparent window with WS_EX_TOPMOST attribute and there are other window applications such as Microsoft Word, Mozilla Firefox and Window Explorer. I was told to obtain the rect and the handle of the window application with a mouse click while the transparent window on TOPMOST. Example: I click on Mozilla Firefox while all other windows are opened and on top of mozilla and yet the transparent window is on TOPMOST of all. How do I obtain the RECT as well as the handle?? By the way, I'm trying to BitBlt that Mozilla with a mouse click with all window including my own created MFC window on top of it. :-O

      You smile at me and I smile at you, And so one smile makes two~

      G Offline
      G Offline
      goorley
      wrote on last edited by
      #2

      I think EnumWindows and GetWindowRect functions can be used.

      A 1 Reply Last reply
      0
      • G goorley

        I think EnumWindows and GetWindowRect functions can be used.

        A Offline
        A Offline
        arthur89kim
        wrote on last edited by
        #3

        Thanks for the reply. Even though I can get handles from there. How do I actual press with my mouse to get the coordinate (POINT) on any position of the Window Application to obtain corresponding handle of that Window Application since I got a transparent window at TOPMOST and other Window Applications before it? :confused:

        To code or not to code, that is the question~

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups