Share via


Naming a Window Appropriately

Naming a Window Appropriately

Overview of naming a window appropriately and setting the window caption for the Tablet PC.

Assign every window a user-friendly caption, even if the window or its caption is invisible. This allows the speech functionality to identify the window and the window hierarchy. This recommendation applies to all windows: top-level windows with visible frames; child windows, such as floating palettes; custom controls; toolbars; and panes within a window, when implemented as child windows.

There are three ways to set the window caption:

  • Set the string in your resource script when calling CreateWindow or related functions.
  • Call SetWindowText.
  • Define the name of controls in dialog boxes by using the techniques described in Naming Controls in Dialog Boxes. This is the only method for labeling an edit control, because setting the controls intrinsic label changes the controls contents.

You can query the caption by using either Microsoft® Active Accessibility® or the WM_GETTEXT message.

For more information about querying the caption by using Active Accessibility, see the Accessibility Leave Site section of the MSDN® Library.