ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting hWnd from Automation Refnum

Hi folks,
My Labview application has an OCX as part of its front panel. The OCX display format is toggled by double-clicking on it. I want to be able to make this toggle from the LV app so I thought to use a 'Call Library Function Node' to PostMessage a double-click to the OCX control. A bit clumsy, I know, but it seems the only way to communicate to the OCX.

My question is can I get the OCX's hWnd from its automation refnum? btw I am using Labview 7.0.

Thanks, K.D.Giles

0 Kudos
Message 1 of 2
(3,647 Views)
OCX is an ActiveX object.  In LabVIEW, you use an ActiveX container to hold ActiveX object.
The ActiveX container is a child window of the front panel window; the ActiveX object window is a child window of ActiveX container, ie. a grandchild window of the front panel window.
You can use FindWindowEx to find the top, the child, and the grand child window.
 
I don't if you can get the hWnd from automation refnum, unless there is a propety from the OCX.
 
George Zou
 
George Zou
Message 2 of 2
(3,638 Views)