How to get activeX control type

Posted by Admin on 17-Jun-2009 04:52

Hi All,

  I have more than one activeX/CODEJOCK  control on my GUI Screen.

  I just want to find name and type of each  activeX/CODEJOCK control.

  I have used Window handle to find its child widgets. But It does not provide me exact type of the activeX/CODEJOCK control.

Please  suggest is there any way to find type of activeX/CODEJOCK.

Thanks

Vishwdeep

All Replies

Posted by Admin on 18-Jun-2009 04:42

Hey,

If you run through the widget tree ... you can test if the widget is a control frame ...

IF phWidget:TYPE = "CONTROL-FRAME" THEN ...

if you have the handle to the control frame you can get the handle of the control that resides on the control frame

For example :

assign hCfComHdl                       = TreeViewControl:com-handle
          hCOLLECTION                  = hCfComHdl:controls
          hTREEVIEWHANDLE        = hCOLLECTION:item(1).

Then you can get the name --> hTREEVIEWHANDLE:name

kind regards

Gerd

Posted by Admin on 19-Jun-2009 01:50

Thanks Gerd,

   But One thing Ijust want to confirm.

You have written ,

      -->   Then you can get the name --> hTREEVIEWHANDLE:name

My Question is -

    Does name of any activex control never change ?

i.e.  Does hTREEVIEWHANDLE:name will give me alswys same value.

Regards

Vishwdeep

Posted by Admin on 19-Jun-2009 01:54

I'm not sure, but I think it doesn't change ...

Gerd

Posted by Admin on 19-Jun-2009 02:00

vishwdeep.pandey schrieb:

    Does name of any activex control never change ?

i.e.  Does hTREEVIEWHANDLE:name will give me alswys same value.

That all depends on you! The name of the Active X Control is usually a setable property (like at MS TreeView).

Why do you need to rely on the name of the Control instance? You might want to rethink the design...

Posted by Admin on 19-Jun-2009 02:02

Attached is a screenshot of the TreeView Active X Control property sheet in the AppBuilder.

I changed the name of the Control of a German word.Your code should not rely on me not doing this.

Posted by jmls on 19-Jun-2009 02:37

for this sort of thing you should use the tag property to store the information that you need (i.e tag = treeview1)

Posted by Admin on 19-Jun-2009 07:37

Thank Mike,

  I am working on a tool(created in Progress) which calles progress screen and Identify its widget and perform operations on that i.e.

  when it find buttonn it performs Click opertaion.

  For Progress defined widget Progress give Proper type of widget i.e for

  for Button   "hWdgethandle:type"  (assuming hWidgetHandle is widget handle gives Button.

  But I stuck at one place when OCX come into picture.

  Progress just Provide  me "CONTROL-FRAME".

  So, My Question is ,

   Is there any attribute Provided by OCX through which we can identify, the exact type ie  tabstrip, treeview etc.

Thanks

Vishwdeep

This thread is closed