GETOWHND

Use this routine to find the current window handle of the named Uniface object. For example this can be used to find the name of a session panel, or session panel button.

Please note: This then allows you to call other windows API functions that require the window handle of the current form.

Uniface objects are named using the guidelines in the Uniface reference manual (reproduced here but may not be correct, see example):

Names of Uniface Object in Windows

4GL debug UDEBUG.ApplicationName
Application ApplicationName
Entity scroll bar EntityName.ModelName.FormName.ApplicationName
Field FieldName.EntityName.ModelName.FormName.ApplicationName
Form FormName.ApplicationName
Form canvas FormName.ApplicationName
Form panel PanelName.FormName.ApplicationName
Form panel button1 ButtonText.PanelName.FormName.ApplicationName
Message frame UFRAME.ApplicationName
Message line ULINE.ApplicationName
Pop-up panel PanelName.FormName.ApplicationName
Session panel PanelName.ApplicationName
Session panel button1 ButtonText.PanelName.ApplicationName
Splash screen ULOGO.ApplicationName
Toolbar UTOOLBAR.ApplicationName
Toolbar button1 ButtonText.UTOOLBAR.ApplicationName

; disable the REMOCC button

$50="Rem_occ.UPANEL.A Test Application"

perform "_getowhnd"

if ($status < 0) done

$52=0 ; ie: disable

perform "_mhenable"

Here are the results from LSTOWHND for objects based on a test screen developed at the March Hare Unfiace Lab:

A Test Application

A3GLTST.A Test Application

A3GLTST.A Test Application

A3GLTST.A Test Application

OBJ.DUMMY.DUMMY.A3GLTST.A Test Application

F1.DUMMY.DUMMY.A3GLTST.A Test Application

UTBD.A3GLTST.A Test Application

GETOBJECT.DUMMY.DUMMY.A3GLTST.A Test Application

GETWNDH.DUMMY.DUMMY.A3GLTST.A Test Application

MHPRT.DUMMY.DUMMY.A3GLTST.A Test Application

SVEBIT.DUMMY.DUMMY.A3GLTST.A Test Application

.A3GLTST.A Test Application

.A3GLTST.A Test Application

.A3GLTST.A Test Application

UTOOLBAR.A Test Application

ULINE.A Test Application

UniCombo.ULINE.A Test Application

UPANEL.A Test Application

Add_occ.UPANEL.A Test Application

Accept.UPANEL.A Test Application

Detail.UPANEL.A Test Application

Erase.UPANEL.A Test Application

Print....UPANEL.A Test Application

Quit.UPANEL.A Test Application

Rem_occ.UPANEL.A Test Application

Store Data.UPANEL.A Test Application

Zoom Field.UPANEL.A Test Application

In the above example:

Application Title Bar/Description: A Test Application
Form Name: A3GLTST
Session Panel Name: SESS1
Fields on Form: F1,OBJ
Command Buttons on Form: GETOBJECT,GETWNDH,MHPRT,SVEBIT

Notes:

This function is only available under Win32 platforms (ie: Windows 95/98/ME and NT/2000). This function is only available in Uniface 7.2.02 and higher.

This function is not available in Uniface 8.

Trying to find the window handle of a window that has not been created results in a NULL return value from _getwhnd(). Therefore it is not possible to call it from the execute trigger.

$Revision: 1.13 $ $Date: 2011/02/28 02:56:32 $[go to top]