Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Active Handle
Message
From
18/02/2008 15:47:52
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01293107
Message ID:
01293579
Views:
17
>>How can the Windows handle of an ActiveX control on a form be obtained? The particular ActiveX that I am using does not have this property available. Is there a way to retrieve it? Thanks.
>>
>See if http://news2news.com/vfp/?example=261&function=136 can help.

Sergey--

Thank you for the above link; this led me to the missing information that I needed. I found the Win32 API call:

FindWindowEx

that would get the handle for the active-x as a child on a form; but I needed to know the active-x class name for the function to work. The above referenced link gave me that information. I was trying the class name that is displayed for the OLE class in VFP, but this was not giving the handle (always returned 0). With a test form (with the active-x placed on it) and the above referenced code, I was able to determine the actual active-x class name. Now with the following code, the Active-x handle can be determined:
LOCAL lcOLEClass, lhAXHdl
DECLARE INTEGER FindWindowEx IN "user32.dll" ;
             INTEGER, INTEGER, STRING @, STRING @
lcOLEClass = "AfxOleControl80"        && this would be the class name for AX
lhAXHdl = FindWindowEx(thisform.HWnd,0,@lcOLEClass,0)
...
Thanks again for your help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform