Re: Identification of controls of another application
- From: Tom Esh <tjeshGibberish@xxxxxxxxxx>
- Date: Wed, 09 Nov 2005 12:51:57 -0500
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)
.
- Follow-Ups:
- Re: Identification of controls of another application
- From: Javier Jiménez Rodríguez
- Re: Identification of controls of another application
- References:
- Identification of controls of another application
- From: Javier Jiménez Rodríguez
- Re: Identification of controls of another application
- From: Tom Esh
- Re: Identification of controls of another application
- From: Javier Jiménez Rodríguez
- Identification of controls of another application
- Prev by Date: Re: Identification of controls of another application
- Next by Date: Re: Identification of controls of another application
- Previous by thread: Re: Identification of controls of another application
- Next by thread: Re: Identification of controls of another application
- Index(es):
Relevant Pages
|