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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to differenciate?

How to differenciate?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialhelpquestion
3 Posts 2 Posters 1 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.
  • F Offline
    F Offline
    FISH786
    wrote on last edited by
    #1

    Hello, I am trying to capture a window from an external App Example Calculator. I am able to get the handle of the window. If the user opens a second instance, I am able to get that handle too using EnumWindows. Which means I have 2 handles for the 2 calculators. Short of using the Handle is there anything else that I could use to differenciate the 2 windows. I can't use the window title since they are both the same. Reason for asking: I know the handle gets reused, but is it possible for the handle to change after the window has been created or does it stay the same after creation? Yes, if I close the window, I know I will not get the same handle. Is it possible that If the user minimizes the window and activates it again, we get a new handle? If the handle changes during the lifetime of the window whats the best way of keeping track of that window? I have created a thread and am using the same function to handle capturing data from the 2 windows by passing the handle as a parameter. However, I can only get the data from one of the windows, or am I better off creating multiple threads which is what I was avoiding? Could someone please help.

    S 1 Reply Last reply
    0
    • F FISH786

      Hello, I am trying to capture a window from an external App Example Calculator. I am able to get the handle of the window. If the user opens a second instance, I am able to get that handle too using EnumWindows. Which means I have 2 handles for the 2 calculators. Short of using the Handle is there anything else that I could use to differenciate the 2 windows. I can't use the window title since they are both the same. Reason for asking: I know the handle gets reused, but is it possible for the handle to change after the window has been created or does it stay the same after creation? Yes, if I close the window, I know I will not get the same handle. Is it possible that If the user minimizes the window and activates it again, we get a new handle? If the handle changes during the lifetime of the window whats the best way of keeping track of that window? I have created a thread and am using the same function to handle capturing data from the 2 windows by passing the handle as a parameter. However, I can only get the data from one of the windows, or am I better off creating multiple threads which is what I was avoiding? Could someone please help.

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      FISH786 wrote:

      but is it possible for the handle to change after the window has been created or does it stay the same after creation

      AFAIK, a window handle doesn't change over the lifetime of a window.

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      F 1 Reply Last reply
      0
      • S Stuart Dootson

        FISH786 wrote:

        but is it possible for the handle to change after the window has been created or does it stay the same after creation

        AFAIK, a window handle doesn't change over the lifetime of a window.

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        F Offline
        F Offline
        FISH786
        wrote on last edited by
        #3

        Thanks again. which is what I thought but wanted to be sure. I guess back to debugging and find out why I can't get the data from the second window. However, I should be able to use the same thread and pass the handle as a parameter? or am I better off creating multiple threads and dedicate each thread to a window for the lifetime of that particular window?

        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