Miscellaneous GUI objects

From Team Developer SqlWindows Wiki
Revision as of 13:46, 12 September 2008 by (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page covers miscellaneous tips & tricks for GUI objects.


Pointer.pngHow to get the handle of the next child object on a top level window

From a specific child object you can determine the next by using

hWndNextChild = SalGetNextChild ( hWndItem, TYPE_Any )

Pointer.pngHow to get the handles of static child objects like label text or group boxes

To be able to get window handles for such objects, use the next assignment

Set bStaticsAsWindows = TRUE

After this, you can fetch the window handles by looping through all child objects in a top level window. Next sample shows how to loop all label objects, find specific ones and change them to another text.

Set hWndLabel = SalGetFirstChild( hWndForm, TYPE_BkgdText  )
While hWndLabel
  Call SalGetWindowText( hWndLabel , sLabel, 100 )
  If sLabel = 'ReplaceText'
    SalSetWindowText( hWndLabel, 'NewText' )
  Set hWndLabel = SalGetNextChild( hWndLabel, TYPE_BkgdText  )