Re: Identification of controls of another application



On Wed, 9 Nov 2005 17:31:00 +0100, "Javier Jiménez Rodríguez"
<desarrollo(arroba)catinformacion(punto)es> wrote:

>Thank you Tom but me does not serve because what I need is an identifier
>that remain invariable in any execution of the external application and
>GetFocusHwnd returns a different value in each execution of the external
>application. I try to know in which data of another application is the
>cursor. In the code, the name, the date,...

One thing that will not change from one instance to the next is a
control's ~child ID~. To obtain the child ID for a particular window
hwnd at runtime, you can use GetWindowLong with GWL_ID. You could also
use the Spy++ tool to obtain it from a running instance. (Conversely,
to obtain the hwnd for a given child ID, use GetDlgItem.) For example
to fetch the Child ID of the focus window:

Dim hwndFoc As Long, IDFoc As Long
hwndFoc = GetFocusHwnd 'previous example
If hwndFoc <> 0 Then
IDFoc = GetWindowLong(hwndFoc, GWL_ID)
Debug.Print IDFoc
End If


-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
.



Relevant Pages

  • Re: GIVE ME A BREAK
    ... This is INCREDIBLE abuse of power, ... I think every parent who has a child in Iraq should petition to have their ... > folks in Texas could have used a stay of execution. ...
    (sci.med.transcription)
  • Re: Task progress when executing a package via ActiveX
    ... >the parent package? ... still just one number for the entire child package. ... The only way to do this would be to write your own execution ... global community for SQL Server professionals ...
    (microsoft.public.sqlserver.dts)
  • Re: OT: "Justice" in Iran
    ... :>: Usually, the US is more advanced than Iran, child executions ... :>: 20 states permitted the execution of juveniles. ... to children under certain specific ages, eg age of consent laws apply ... unborn baby: an unborn baby ...
    (rec.arts.mystery)
  • Re: Can Last of the Time Lords be time-reversed so vanishes from BB...
    ... would be Sarah Jane Adventure`s which is notably more child friendly in ... plot, style and execution. ... usual teatime fare you`d see at 5pm on Children`s telly. ...
    (rec.arts.drwho)