How to Read an Active X Control?
From: Kannan (kannan_s_at_excite.com)
Date: 11/11/04
- Next message: Hendrik Schober: "Re: 7.1 IDE bug"
- Previous message: Ommund: "Compatibility between VC++ versions"
- Messages sorted by: [ date ] [ thread ]
Date: 11 Nov 2004 10:25:43 -0800
My application is an MFC application but since MFC is essentially a
Object Oriented wrapper for Win32 I am taking the liberty to post my
question here. I also must confess that I am not an Active X
programmer.
Here is my problem:
I have to read a text string from a non editable TextBox in an "alien"
application. I say "alien" b'cas it is a third party application whose
source code is not available to me. The third party vendor tells me
that the non editable TextBox is implemented as an Active X Control.
The issues I have are as follows:
1. What must I do to get a handle (in MFC it would be a CWnd to the
ACTIVE X Control)?
2. I Don t believe that Spy++ lists all the Windows that I can
visually see in the target (i.e. third party) application. What are
the Windows that Spy++ will EXCLUDE in its Windows Hierarchy display.
3. Once I get a handle (in MFC - CWnd) to an Active X window I can get
the IUnknown to the Active X Control. Please let me know if this
understanding of mine is correct. The IUnknown can be obtained by any
one of the following calls:
LPUNKNOWN pUnk;
IUnknown *pi=0;
pUnk = localParentCWnd->GetControlUnknown();
If the ActiveX control is inside an ActiveX container then:
cmdTarg = (CCmdTarget *) localParentCWnd;
pUnk = cmdTarg->GetControllingUnknown();
If the ActiveX Container has native Windows controls inside it then:
HRESULT hr = AtlAxGetControl(localParentCWnd->m_hWnd,&pi);
Kannan
- Next message: Hendrik Schober: "Re: 7.1 IDE bug"
- Previous message: Ommund: "Compatibility between VC++ versions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|