Finding the current focused window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gilshallem@gmail.com

    Finding the current focused window

    Hi i am trying to find the handle of the current focused control in
    all the running application.
    I tried GETFOCUS() but it gave the the handle only of the current
    thread

    There are 2 options of solving it.
    One, is to find an API function that do it.
    Secount, is to find a function that detarmin if a control is focused
    the i can make a loop checking all the controls.

    Please halp me fint one of this functions.

    BTW: I allready tried

    Function Isfocused(Handl e as intptr)
    Dim c as control = control.fromhan dle(handle)
    Return c.focused
    End Function

    But This works only for .net controls

    I have spend hours trying to solve this, Pleeeaaasee help me
  • kimiraikkonen

    #2
    Re: Finding the current focused window

    On Feb 10, 6:29 pm, gilshal...@gmai l.com wrote:
    Hi i am trying to find the handle of the current focused control in
    all the running application.
    I tried GETFOCUS() but it gave the the handle only of the current
    thread
    >
    There are 2 options of solving it.
    One, is to find an API function that do it.
    Secount, is to find a function that detarmin if a control is focused
    the i can make a loop checking all the controls.
    >
    Please halp me fint one of this functions.
    >
    BTW: I allready tried
    >
    Function Isfocused(Handl e as intptr)
    Dim c as control = control.fromhan dle(handle)
    Return c.focused
    End Function
    >
    But This works only for .net controls
    >
    I have spend hours trying to solve this, Pleeeaaasee help me
    FindWindow API?

    Comment

    • gilshallem@gmail.com

      #3
      Re: Finding the current focused window

      On Feb 10, 6:29 pm, gilshal...@gmai l.com wrote:
      Hi i am trying to find the handle of the current focused control in
      all the running application.
      I tried GETFOCUS() but it gave the the handle only of the current
      thread
      >
      There are 2 options of solving it.
      One, is to find an API function that do it.
      Secount, is to find a function that detarmin if a control is focused
      the i can make a loop checking all the controls.
      >
      Please halp me fint one of this functions.
      >
      BTW: I allready tried
      >
      Function Isfocused(Handl e as intptr)
      Dim c as control = control.fromhan dle(handle)
      Return c.focused
      End Function
      >
      But This works only for .net controls
      >
      I have spend hours trying to solve this, Pleeeaaasee help me
      I found a new solution, GetGuiThreadInf o() but this don's work on vista

      Comment

      Working...