Skip to main content

SalWindow

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Runtime.50 (5.0.0.0)

Adapts WinForms controls to SAL window messages, editing operations, layout, and compatibility services.

public class SalWindow

Most static operations translate accessory or embedded controls to the corresponding SAL window. APIs that dispatch messages directly intentionally retain the original control routing.

Example:

void SetCaption(System.Windows.Forms.Control window)
{
PPJ.Runtime.Windows.SalWindow.SetText(window, "Customer details");
PPJ.Runtime.Windows.SalWindow.BringToTop(window);
}

Constructors

Instance member SalWindow(salWnd)

Creates a SAL implementation and action manager for a window.

NameTypeDescription
salWndISalWindowThe SAL window to which this implementation belongs.

Properties

Static member DesignMode

Boolean: Gets the SAL runtime design-mode state.

Static member DisableMessages

Boolean: Gets or changes the current thread message-suppression nesting count.

Each true assignment increments the count; each false assignment decrements it without going below zero. Pair assignments in a try/finally block.

Static member DragLocation

Point: Gets the saved drag-start location.

Static member DragSource

Control: Gets the control currently providing the SAL drag operation.

Static member DropDisabled

Boolean: Gets or sets whether the current drop is disabled.

Static member DropLocation

Point: Gets the current pointer location within the drop target.

Static member DropTarget

Control: Gets the current SAL drop target.

Static member KeepMask

Boolean: Gets or sets whether reading masked edit text retains the mask.

Static member MapEnterToTab

Boolean: Gets or sets whether SAL keyboard handling maps Enter to Tab.

Instance member NamedProperties

SalNamedProperties: Gets the named-property collection, creating an empty collection on first access.

Static member ProfessionalColors

ProfessionalColorTable: Gets the shared professional color table for WinForms rendering.

The table is created on first access.

Methods

Static member AddListItem(ctrl, text)

Adds a text item to a supported list control.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
textStringThe item text to add.

Returns: Int32. The resulting item index, or Sys.LB_Err for an unsupported or unavailable control.

Instance member AddMessageActions(handler)

Deprecated memberDeprecated: Deprecated. Use AddWindowActions() Registers a delegate with this window's action manager.

ParameterTypeDescription
handlerDelegateThe action delegate to register.

This obsolete entry point is equivalent to AddWindowActions.

Instance member AddMessageActions(target)

Deprecated memberDeprecated: Deprecated. Use AddWindowActions(). Adds another window's registered action handlers to this window.

ParameterTypeDescription
targetISalWindowThe SAL window whose handlers are copied into this instance.

This obsolete entry point delegates to AddWindowActions.

Instance member AddWindowActions(handler)

Registers a delegate with this window's action manager.

ParameterTypeDescription
handlerDelegateThe action delegate to register.

Instance member AddWindowActions(target)

Adds another window's registered action handlers to this window.

ParameterTypeDescription
targetISalWindowThe SAL window whose handlers are copied into this instance.

Static member BringToTop(ctrl)

Brings a control forward or activates its top-level/MDI form.

ParameterTypeDescription
ctrlControlThe control to translate.

Returns: Boolean. True when a control resolves; otherwise, false.

Static member CanCopy()

Checks whether the focused control has content that can be copied.

Returns: Boolean. True when SAL finds selected text, selected table rows, or other copyable content; otherwise, false.

Static member CanCut()

Checks whether the focused control has content that can be cut.

Returns: Boolean. True when the focused control passes SAL enabled, editability, and selection checks; otherwise, false.

Static member CanPaste()

Checks whether SAL permits pasting into the focused control.

Returns: Boolean. The focused control's SAL paste-availability result.

Static member CanUndo()

Reports SAL undo-command availability for the focused control.

Returns: Boolean. True when a focused control is available; otherwise, false.

This compatibility check does not inspect undo history or guarantee that Undo can perform an undo.

Static member Center(ctrl)

Centers a control within its parent or a top-level form relative to its owner/screen.

ParameterTypeDescription
ctrlControlThe control to center.

Returns: Boolean. True when a control resolves; otherwise, false.

Top-level placement is constrained to the selected screen working area. A control without a parent is unchanged unless it is a top-level form.

Static member Clear()

Dispatches the clear clipboard command to the focused control.

Returns: Boolean. The table or column command result, or true when ordinary control content is cleared; false if no target is available.

Static member Clear(ctrl)

Clears text, checked state, or selection according to the control type.

ParameterTypeDescription
ctrlControlThe control to clear.

Returns: Boolean. False for a null target or a form; otherwise, true.

Date pickers are first set to the current date. This operation clears selection, not the item collection, for list controls. Unsupported non-form controls can return true without a change.

Static member ClearCursor(ctrl, type)

Restores the default cursor for a window or drag role.

ParameterTypeDescription
ctrlControlThe non-null target control.
typeInt32The cursor role to reset.

Returns: Boolean. The cursor-assignment result.

Uses IBeam for subclasses of TextBox and Default for other types, including TextBox itself.

Static member ClearList(ctrl)

Removes all items from a supported list control.

ParameterTypeDescription
ctrlControlThe list control to translate and clear.

Returns: Boolean. True for an ISalListControl, ListBox, or ComboBox; otherwise, false.

A plain ComboBox also has its text cleared.

Static member Copy()

Copies the focused control's selected text or content to the clipboard.

Returns: Boolean. The table or column command result, or true after copying ordinary control content; false if no target is available.

Static member CopyProfile(ctrl, profile)

Copies number and date/time format settings into a control's writable culture.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
profileInt32The SAL profile or locale identifier supplying the format settings.

Returns: Boolean. False for an unavailable control or a SAL edit control with a missing/read-only culture; otherwise, true.

Static member CopyString(text)

Places persistent Unicode text on the Windows clipboard.

ParameterTypeDescription
textStringThe text to copy.

Clipboard exceptions are logged and suppressed.

Static member CreateFont(name, size, enhancement)

Creates a point-sized font from a family name and SAL enhancement flags.

ParameterTypeDescription
nameStringThe font family name.
sizeSingleThe size in points; nonpositive values use 8 points.
enhancementInt32The combined bold, italic, underline, and strikeout FONT_Enh flags.

Returns: Font. The created font, or null when the name is null or empty.

Static member CreateWindow(type, owner, args)

Creates and shows a modeless form of the specified type.

ParameterTypeDescription
typeTypeThe form type to instantiate.
ownerControlThe owning control or form.
argsObject[]Arguments used by the form creation path.

Returns: Control. The created form, or null if it was disposed during creation.

An ordinary form owned by an MDI container is assigned that MDI parent.

Static member CreateWindow(typeName, parent, args)

Resolves a form type relative to the calling assembly, then creates and shows it.

ParameterTypeDescription
typeNameStringThe application form type name.
parentControlThe owning control or form.
argsObject[]Arguments used by the form creation path.

Returns: Control. The created form, or null if it was disposed during creation.

Static member CreateWindow(type, parent, left, top, width, height, flags, args)

Creates and shows a SAL form with optional embedding and initial visibility.

ParameterTypeDescription
typeTypeThe form type to instantiate.
parentControlThe parent for embedding or owner for normal display.
leftSingleThe embedded-form left coordinate in form units.
topSingleThe embedded-form top coordinate in form units.
widthSingleThe embedded-form width in form units.
heightSingleThe embedded-form height in form units.
flagsInt32CREATE_AsChild, CREATE_Hidden, and CREATE_Border flags.
argsObject[]The form creation arguments.

Returns: Control. The new form, or null when a child has no parent or the form is destroyed during creation.

Embedding is supported for SalForm-derived types. The bounds and border option are used only on that path; other forms use their normal Show behavior.

Static member CreateWindow(typeName, parent, left, top, width, height, flags)

Resolves and creates a SAL form with child-window, visibility, and border options.

ParameterTypeDescription
typeNameStringThe form type name resolved relative to the calling assembly.
parentControlThe parent or owner; required for child-form creation.
leftSingleThe child form's horizontal position in form units.
topSingleThe child form's vertical position in form units.
widthSingleThe child form's width in form units.
heightSingleThe child form's height in form units.
flagsInt32The combined CREATE_AsChild, CREATE_Hidden, and CREATE_Border options.

Returns: Control. The created form, or null when the underlying creation path does not retain a live form.

Static member Cut()

Copies and clears content from the focused control.

Returns: Boolean. The table or column command result, or true after processing ordinary control content; false if no target is available.

Call CanCut when command availability must respect the control's editability.

Static member DeleteListItem(ctrl, index)

Removes an item from a supported list control.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The zero-based item index.

Returns: Int32. The remaining item count, or Sys.LB_Err for an invalid index or unsupported control.

Static member Destroy(ctrl)

Closes a form or disposes another control.

ParameterTypeDescription
ctrlControlThe control to destroy.

Returns: Boolean. False for an unresolved target; otherwise, true.

SAL forms are marked closed once. If still being created, they receive a posted WM_CLOSE instead of an immediate Close call.

Static member DisableWindow(ctrl)

Disables input to the specified control, or clears editability for a table column.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Static member DisableWindowAndLabel(ctrl)

Disables input to the specified control and disables its associated label.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Static member DragAcceptFiles(ctrl, accept)

Changes native file-drop acceptance for a control.

ParameterTypeDescription
ctrlControlThe target control with an existing handle.
acceptBooleanTrue to accept file drops; false to disable them.

Returns: Boolean. True when the request is applied; false when the target or handle is unavailable.

Instance member DragDropStart()

Starts SAL drag-and-drop at the current mouse position.

Returns: Boolean. False when no mouse button is pressed; true after the drag operation completes.

Uses an empty string as drag data.

Instance member DragDropStart(pt, data)

Starts SAL drag-and-drop with an explicit source position and payload.

ParameterTypeDescription
ptPointThe drag-start point in source-client pixels.
dataObjectThe drag payload; null becomes an empty string.

Returns: Boolean. False when no mouse button is pressed; otherwise, true after the operation completes.

Sends SAM_DragStart before entering the native drag loop and SAM_DragEnd during cleanup. DragDropStop during the start handler prevents entry into the loop.

Instance member DragDropStop()

Requests termination of SAL drag mode by clearing the current source.

Returns: Boolean. True when a source was active; otherwise, false.

Static member EnableWindow(ctrl)

Enables a control or makes a table column editable.

ParameterTypeDescription
ctrlControlThe control to enable.

Returns: Boolean. False for a null or disposed target; otherwise, true.

TextBoxBase controls also become writable. Native disabled styles and associated tab-stop changes are corrected when needed.

Static member EnableWindowAndLabel(ctrl)

Enables input to the specified control and enables its associated label.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Static member EndDialog(ctrl, value)

Closes a modal dialog with a return value.

ParameterTypeDescription
ctrlControlThe modal form.
valueInt32The SAL return value, or DialogResult value for a non-SAL form.

Returns: Boolean. True when closure is initiated; false for an unresolved/nonmodal target or a SAL dialog already marked closed.

A SAL dialog still being created is hidden and receives a posted WM_CLOSE.

Static member FillDoubleGradient(g, start, middle, end, bounds, firstGradientSize, secondGradientSize, vertical)

Draws two edge gradients with a solid middle-color region between them.

ParameterTypeDescription
gGraphicsThe destination graphics surface.
startColorThe color at the leading edge.
middleColorThe center color.
endColorThe color at the trailing edge.
boundsRectangleThe overall drawing rectangle.
firstGradientSizeInt32The leading gradient length in graphics units.
secondGradientSizeInt32The trailing gradient length in graphics units.
verticalBooleanTrue for vertical gradients; false for horizontal gradients.

The middle strip has a minimum thickness of one. Gradient lengths are used directly rather than clamped to the overall rectangle.

Static member FillGradient(g, start, end, bounds, vertical)

Fills a rectangle with a linear color gradient.

ParameterTypeDescription
gGraphicsThe destination graphics surface.
startColorThe starting color.
endColorThe ending color.
boundsRectangleThe rectangle in graphics coordinates.
verticalBooleanTrue for a top-to-bottom gradient; false for left-to-right.

Nonpositive width or height produces no drawing.

Static member FindChild(ctrl, name)

Recursively finds the first descendant matching a control name.

ParameterTypeDescription
ctrlControlThe root control to translate.
nameStringThe exact, case-sensitive Control.Name.

Returns: Control. The first matching descendant in control-collection order, or null.

Static member FindChild(ctrl, type)

Recursively finds the first descendant matching a control type.

ParameterTypeDescription
ctrlControlThe root control to translate.
typeTypeThe type used with IsInstanceOfType.

Returns: Control. The first matching descendant in control-collection order, or null.

Static member FindControl(ctrl, name, throwIfNotFound)

Gets a control-valued member by name.

ParameterTypeDescription
ctrlControlThe control whose members are inspected.
nameStringThe member name.
throwIfNotFound optionalBooleanTrue to throw when the member does not exist.

Returns: Control. The member value as Control, or null when absent or not a control.

Static member FindMember(ctrl, name, throwIfNotFound)

Resolves a named member on the translated control.

ParameterTypeDescription
ctrlControlThe control to inspect.
nameStringThe member name.
throwIfNotFound optionalBooleanTrue to throw MissingMemberException when lookup fails; false to return null.

Returns: ReferenceInfo. A ReferenceInfo wrapper, or null when lookup fails and exceptions are disabled.

Static member FireWindowActions(ctrl, msgCode, wParam, lParam)

Dispatches a message to the derived control SAL handlers.

ParameterTypeDescription
ctrlControlThe target control.
msgCodeInt32The message identifier.
wParamSalNumberThe first message parameter.
lParamSalNumberThe second message parameter.

Returns: WindowActionsEventArgs. The dispatch event data, or WindowActionsEventArgs.Empty when no SAL adapter exists.

Resolves derived instances but does not translate accessories, avoiding duplicate routing.

Static member FireWindowActionsToChildren(ctrl, msg, wParam, lParam)

Dispatches a message directly to child SAL handlers.

ParameterTypeDescription
ctrlControlThe parent control.
msgInt32The message identifier.
wParamSalNumberThe first message parameter.
lParamSalNumberThe second message parameter.

Returns: Boolean. False for a null/disposed parent; otherwise, true.

Traverses children in SAL order but does not descend into forms or user controls. Recipients require existing handles. MDI child forms receive native messages; WM_CLOSE and WM_DESTROY for ordinary descendants are delivered to handlers to avoid destroying controls.

Static member FormUnitsToPixels(ctrl, units, vertical)

Converts a length in form units to pixels using the specified control's form metrics.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
unitsSingleThe length in form units.
verticalBooleanTrue for a vertical measurement; false for a horizontal measurement.

Returns: Int32. The converted pixel length.

Static member FromHandle(handle, type)

Resolves a SAL window handle and casts the translated control through SAL inheritance rules.

ParameterTypeDescription
handleSalWindowHandleThe window handle to resolve.
typeTypeThe required application or framework type.

Returns: Object. The cast object, or null when the handle does not resolve to a control.

Throws:

Static member GetClassName(ctrl)

Gets the application class name used by SAL compatibility code.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: String. The application type name, an empty string for runtime-defined types, or null for a missing/native-control target.

Forms use their base type; nested table types are unwrapped through their base classes.

Static member GetClientArea(ctrl)

Finds the client area accessory for a control.

ParameterTypeDescription
ctrlControlThe control whose accessory is requested.

Returns: SalFormClientArea. The client area accessory, or null if none is found.

Static member GetControlName(ctrl)

Gets the specified control's name.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: String. The control name, or an empty string when the control cannot be resolved.

Static member GetControlName(ctrl, sName)

Copies the specified control's name to the supplied variable.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
sName by referenceSalStringReceives the control name when the operation succeeds.

Returns: Boolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Static member GetControlType(ctrl)

Gets the SAL window type of the specified control.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Int32. The SAL Sys.TYPE_* code for the translated control.

Static member GetDataLength(ctrl)

Gets a SAL edit control's input-length limit.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Int32. The maximum length, with zero and 32767 reported as -1; zero when the control is not a SAL edit control.

Static member GetDataType(ctrl)

Gets the SAL data type represented by the specified control.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Int32. The SAL data-type code, or zero if the translated control does not implement the SAL value contract.

Static member GetDefaultButton(ctrl)

Gets a form's accept button.

ParameterTypeDescription
ctrlControlThe form to inspect.

Returns: Control. The button as a control, or null when the target is not a form or has no compatible button.

Static member GetFirstChild(parent, typeMask)

Finds the first child matching a SAL control-type mask.

ParameterTypeDescription
parentControlThe parent control.
typeMaskInt32The TYPE_* mask; zero matches nothing.

Returns: Control. The first matching child or accessory, or null.

Uses MDI child order for MDI forms, column creation order for tables, and tab order within the client area for ordinary controls.

Static member GetFocus()

Gets the focused native window translated to its SAL handle.

Returns: SalWindowHandle. The translated focus handle.

Static member GetFont(ctrl, sName, nSize, nEnhancement)

Reads the control font's family, point size, and style flags.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
sName by referenceSalStringReceives the font family name.
nSize by referenceSalNumberReceives the size in points.
nEnhancement by referenceSalNumberReceives the combined Sys.FONT_Enh* style flags.

Returns: Boolean. True if a font was available; otherwise, false.

Static member GetFont(font, name, size, enhancement)

Reads a font's family, point size, and SAL style flags.

ParameterTypeDescription
fontFontThe font to inspect.
name by referenceStringReceives the family name.
size by referenceSingleReceives the point size.
enhancement by referenceInt32Receives the combined bold, italic, strikeout, and underline Sys.FONT_Enh* flags.

Returns: Boolean. False if the font is null; otherwise, true.

Static member GetFontNames()

Enumerates the installed font-family names.

Returns: String[]. An array of font-family names in the installed-font collection order.

Static member GetFormat(ctrl)

Gets the format picture of a SAL edit control.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: String. The format picture, or null for a control without SAL editing support.

Static member GetFormatCode(ctrl)

Gets the SAL format code represented by an edit control.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: Int32. The recognized format code, casing/password code, Picture for an unrecognized nonempty format, or Unformatted.

Lower/upper casing takes precedence over the password flag.

Static member GetFormattedText(ctrl, format)

Converts an editable control's value to text, optionally using its SAL format.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
formatBooleanTrue to apply the SAL format for number and date values and mask handling for string values; false to use the value's ordinary string conversion.

Returns: String. The converted text, an empty string for a null value, or null for a noneditable target.

Static member GetFormParameter(ctrl, paramType, value)

Gets a form parameter directly from a SalForm.

ParameterTypeDescription
ctrlControlThe SalForm instance; this method does not translate the control.
paramTypeSalNumberThe requested form parameter code.
value by referenceSalNumberReceives the form parameter; unchanged when ctrl is not SalForm.

Returns: SalBoolean. True for SalForm; otherwise, false.

Static member GetHintText(ctrl)

Gets the watermark of a SAL data field, multiline field, or combo box.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: String. The watermark text, or null for an unsupported control.

Static member GetInputMask(ctrl)

Gets the input mask of a SAL edit control.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: String. The edit mask, or null for a control without SAL editing support.

Static member GetLabel(ctrl)

Gets the label associated with a control.

ParameterTypeDescription
ctrlControlThe control whose label is requested.

Returns: Control. The associated label, or null when no label can be resolved.

SAL forms use their label mapping; other forms use the runtime's label-discovery fallback.

Static member GetLabelText(ctrl)

Gets the text of a control associated label.

ParameterTypeDescription
ctrlControlThe control whose label is requested.

Returns: String. The label text, an empty string when no label exists, or null for an unresolved target.

Static member GetLabelText(ctrl, maxLen)

Gets the specified control's associated label text.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
maxLenInt32The maximum number of leading characters to return.

Returns: String. The label text limited to the requested length, or an empty string if no label exists.

Static member GetLabelText(ctrl, sText, maxLen)

Copies the associated label text to a supplied variable.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
sText by referenceSalStringReceives the label text when it can be read.
maxLenInt32The maximum number of leading characters to copy.

Returns: SalNumber. The number of characters copied, or zero if no label text is available.

Static member GetListItemsCount(ctrl)

Gets the number of items in a supported list control.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.

Returns: Int32. The item count, or Sys.LB_Err for an unsupported or unavailable control.

Static member GetListItemState(ctrl, index)

Tests an item's selection state.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The zero-based item index.

Returns: Boolean. The SAL list's selection result, the list-box selection state, or whether a combo box's selected index equals the requested index; false for unsupported controls.

Static member GetListItemText(ctrl, index)

Gets an item's string representation.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The zero-based item index.

Returns: String. The converted item text, or null when the item or supported control is unavailable.

Static member GetListItemText(ctrl, index, text)

Copies an item's string representation to a SAL string.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The zero-based item index.
text by referenceSalStringReceives the item text on success; otherwise remains unchanged.

Returns: Int32. The copied character count, or Sys.LB_Err when item text is unavailable.

Static member GetListItemTextLength(ctrl, index)

Gets the character count of an item's string representation.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The zero-based item index.

Returns: Int32. The character count, or Sys.LB_Err when item text is unavailable.

Static member GetListSelectedFile(ctrl, fileName)

Decodes a selected entry created by file-list population.

ParameterTypeDescription
ctrlControlThe SAL file-list control.
fileName by referenceSalStringReceives the selected file name, directory with a trailing backslash, or drive designation. Remains unchanged when no selection is available.

Returns: Boolean. True for a directory or drive entry; false for a file entry or unavailable selection.

A false result can still return a valid file name.

Static member GetListSelectedFile(ctrl)

Gets the decoded name of a selected file-list entry.

ParameterTypeDescription
ctrlControlThe SAL file-list control.

Returns: String. The file name, directory with trailing backslash, or drive designation; an empty string when no selection is available.

Static member GetListSelectedIndex(ctrl)

Gets a supported list control's current selection index.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.

Returns: Int32. The zero-based selection index, or Sys.LB_Err if the control is unavailable or unsupported. A supported control returns -1 when no item is selected.

Static member GetListSelectedItems(ctrl, selectedArray)

Copies available selected item indices into a dynamic SAL array.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
selectedArraySalArray<SalNumber>The output array, made dynamic and reset before selected indices are copied.

Returns: Boolean. True when at least one index is copied; false if no selection collection is available or it is empty.

When no collection is available, the supplied array is left unchanged.

Static member GetListSelectedItemsCount(ctrl)

Gets the number of selected items from a SAL multiple-selection list.

ParameterTypeDescription
ctrlControlThe SAL list control whose selection is counted.

Returns: Int32. The selected count for multiple-selection mode, -1 for single-selection mode, or zero when selection is disabled or the target is unavailable.

Use a control implementing ISalListControl. The ordinary ListBox fallback dereferences the absent SAL interface and can throw.

Static member GetLocation(ctrl)

Gets the current window position in SAL form units.

ParameterTypeDescription
ctrlControlThe control to measure.

Returns: PointF. The position in form units, or PointF.Empty for an unresolved target.

Uses native window bounds when a handle exists so values are current during move/size notifications; otherwise uses managed bounds.

Static member GetMdiClient(ctrl)

Finds the MDI client child of an MDI container form.

ParameterTypeDescription
ctrlControlThe form to inspect.

Returns: MdiClient. The MdiClient child, or null when the control is not an MDI container form.

Static member GetMessageName(msg)

Gets the runtime's symbolic name for a recognized WinSDK message.

ParameterTypeDescription
msgInt32The Windows message code.

Returns: String. The stored message name, or an empty string for an unrecognized code.

Static member GetMousePositionFromLParam(lParam)

Unpacks signed mouse coordinates from a native message parameter.

ParameterTypeDescription
lParamIntPtrThe packed low-word X and high-word Y coordinates.

Returns: Point. The point formed from the two signed 16-bit coordinates.

Static member GetNextChild(ctrl, typeMask)

Finds the next sibling matching a SAL window-type mask.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
typeMaskInt32The SAL window types to include; zero matches no controls.

Returns: Control. The next matching control, or null if no control matches.

Static member GetParent(ctrl)

Gets the SAL parent or owning form for a control.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: Control. The parent/owner according to SAL containment rules, or null when unavailable.

Embedded forms skip accessory containers. Table columns resolve to their table or form-table window. Ordinary child controls return the parent container form.

Static member GetProfile(ctrl)

Maps a control's formatting culture to a SAL profile identifier.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Int32. The default or program profile, a recognized country profile, or the culture's locale identifier.

A writable culture is reported as Sys.FMT_Profile_Program.

Static member GetProfileParameter(ctrl, paramCode, paramValue)

Reads a numeric parameter from the control's formatting culture.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
paramCodeInt32The supported Sys.FMT_Parm_* parameter code.
paramValue by referenceSalNumberReceives the parameter value when its code is recognized.

Returns: Boolean. True for a recognized parameter code; otherwise, false.

The current SAL culture is used when the control has no culture. Date type and leading-zero parameters include compatibility defaults.

Static member GetProfileParameter(ctrl, paramCode, paramValue)

Reads a text parameter from the control's formatting culture.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
paramCodeInt32The supported Sys.FMT_Parm_* parameter code.
paramValue by referenceSalStringReceives the parameter value when its code is recognized.

Returns: Boolean. True for a recognized parameter code; otherwise, false.

The current SAL culture is used when the control has no culture.

Static member GetProperty(ctrl, name)

Gets the value of a SAL named property.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
nameStringThe property name.

Returns: String. The property value, or null if the property or SAL window is unavailable.

Static member GetProperty(ctrl, name, sValue)

Reads a SAL named property into a supplied variable.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
nameStringThe property name.
sValue by referenceSalStringReceives the value only when the property is found.

Returns: Boolean. True if a non-null property value was found; otherwise, false.

Static member GetSalMessageName(msg)

Gets the symbolic name of a recognized SAL message.

ParameterTypeDescription
msgInt32The message identifier.

Returns: String. The SAM name, or the numeric identifier formatted as a string when not recognized.

Static member GetScrollBarPosition(ctrl)

Gets the value of a scrollbar control.

ParameterTypeDescription
ctrlControlThe scrollbar to inspect.

Returns: Int32. The scrollbar Value, or zero for an unsupported target.

Static member GetScrollBarRange(ctrl, nMin, nMax, nLine, nPage)

Reads a scrollbar's range and increments.

ParameterTypeDescription
ctrlControlThe scrollbar control.
nMin by referenceSalNumberReceives the minimum.
nMax by referenceSalNumberReceives the maximum, including SAL scrollbar adjustments.
nLine by referenceSalNumberReceives the small-change increment.
nPage by referenceSalNumberReceives the large-change increment.

Returns: Boolean. False for a null input; otherwise, true. A non-scrollbar target produces zero for all outputs.

Static member GetSize(ctrl)

Gets the current window size in SAL form units.

ParameterTypeDescription
ctrlControlThe control to measure.

Returns: SizeF. The size in form units, or SizeF.Empty for an unresolved target.

Uses native window bounds when a handle exists so values are current during move/size notifications; otherwise uses managed bounds.

Static member GetSortedControls(parent)

Gets child controls in SAL traversal order.

ParameterTypeDescription
parentControlThe non-null parent control.

Returns: Control[]. A tab-index-sorted child array; table windows use the table-specific column and child ordering.

Static member GetState(ctrl)

Gets the visibility and form-state classification of the specified window.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Int32. A Sys.Window_* state code; visible non-form controls report Sys.Window_Normal.

Static member GetStatusBar(ctrl)

Finds the status bar accessory for a control.

ParameterTypeDescription
ctrlControlThe control whose accessory is requested.

Returns: SalFormStatusBar. The status bar accessory, or null if none is found.

Static member GetStatusBarText(ctrl)

Gets the text from the status bar associated with a control.

ParameterTypeDescription
ctrlControlThe control whose status bar is searched.

Returns: String. The status-bar text, or an empty string if none is found.

Static member GetSysColor(colorValue)

Resolves a SAL system-color identifier to its current Windows color.

ParameterTypeDescription
colorValueInt32The SAL system-color identifier.

Returns: Int32. The current color as a Win32 color value.

Static member GetText(ctrl)

Gets a control's text using SAL mask handling.

ParameterTypeDescription
ctrlControlThe control whose text is read.

Returns: String. The text returned by SAL mask processing, or null if the control cannot be resolved.

Static member GetText(ctrl, text, maxLen)

Copies the specified control's displayed text or long-string value to a SAL string.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
text by referenceSalStringReceives the retrieved text.
maxLenInt32The maximum character count for ordinary text; ignored for a Sys.DT_LongString value.

Returns: Int32. The number of characters copied, or zero when no text is available.

Static member GetText(ctrl, maxLen)

Gets the specified control's displayed text or long-string value.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
maxLenInt32The maximum character count for ordinary text; ignored for a Sys.DT_LongString value.

Returns: SalString. The retrieved text, or an empty string if the control cannot be resolved.

Static member GetTextUnmasked(ctrl)

Gets a control's text with SAL input-mask processing removed.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: SalString. The unmasked SAL string, or a SAL null string when retrieval fails.

Static member GetToolBar(ctrl)

Finds the toolbar accessory for a control.

ParameterTypeDescription
ctrlControlThe control whose accessory is requested.

Returns: SalFormToolBar. The toolbar accessory, or null if none is found.

Static member GetWindowColor(ctrl, colorIndex)

Gets a supported control color by SAL color index.

ParameterTypeDescription
ctrlControlThe control to inspect.
colorIndexInt32COLOR_IndexWindow, Cell, CellText, WindowText, or Transparent.

Returns: Int32. The Win32 color value, COLOR_None for transparent, or zero for an unresolved target.

Table-column window colors use system defaults; cell colors use column properties. Unsupported index/type combinations translate Color.Empty.

Static member HasAccessories(ctrl)

Tests whether a form directly contains any SAL accessory controls.

ParameterTypeDescription
ctrlControlThe form to inspect.

Returns: Boolean. True if a direct child implements the SAL accessory contract; false for other controls or forms without accessories.

Static member HideWindow(ctrl)

Hides the specified control or table column.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. The visibility state before the operation, or false if the control cannot be resolved.

Static member HideWindowAndLabel(ctrl)

Hides the specified control and its associated label.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. The control's visibility before the operation, or false if it cannot be resolved.

Static member InsertListItem(ctrl, index, text)

Inserts a text item into a supported list control.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The insertion position from zero through the item count, or -1 to append.
textStringThe item text to insert.

Returns: Int32. The insertion result from the list, or Sys.LB_Err for an invalid position or unsupported control.

Static member Invalidate(ctrl)

Invalidates a control and its children for repainting.

ParameterTypeDescription
ctrlControlThe control to invalidate.

Returns: Boolean. True when a control resolves; otherwise, false.

Static member IsChecked(ctrl)

Reads the checked state of a check box or radio button.

ParameterTypeDescription
ctrlControlThe target control.

Returns: Boolean. The checked state, or false for other control types.

Static member IsDerivedFrom(ctrl, type)

Tests the specified control's runtime type against an application base type.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
typeTypeThe type to test, including the framework's emulated inheritance relationships.

Returns: Boolean. True if the runtime type derives from the requested type; otherwise, false.

Static member IsEmpty(ctrl)

Tests whether an editable control has no unmasked text.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Boolean. True when the control is editable and its unmasked text is null or empty; otherwise, false.

Static member IsEnabled(ctrl)

Tests whether a control is enabled.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: Boolean. The enabled state, or false for an unresolved control.

Uses COL_Editable for table columns, native window state when a handle exists, and the managed Enabled property otherwise.

Static member IsKeyboardMessage(msg)

Tests whether a message falls in the WinSDK keyboard-message interval.

ParameterTypeDescription
msgInt32The message code.

Returns: Boolean. True from WM_KEYFIRST through WM_KEYLAST, inclusive; otherwise, false.

Static member IsModified(ctrl)

Reads the specified control's SAL modification flag.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. True if the control reports a modified value; otherwise, false.

Static member IsMouseMessage(msg)

Tests whether a message falls in the WinSDK mouse-message interval.

ParameterTypeDescription
msgInt32The message code.

Returns: Boolean. True from WM_MOUSEFIRST through WM_MOUSELAST, inclusive; otherwise, false.

Static member IsSalMessage(msg)

Tests whether a message code appears in the runtime's recognized SAL-action set.

ParameterTypeDescription
msgInt32The message code to classify.

Returns: Boolean. True for an explicitly recognized SAL action; otherwise, false.

Static member IsScrollBarVisible(control, bars)

Tests the native horizontal and vertical scrollbar style bits.

ParameterTypeDescription
controlControlThe non-null control to inspect.
barsScrollBarsThe scrollbar condition to test; Both requires both flags and None requires neither.

Returns: Boolean. True when the condition matches; false when no handle exists or the value is unsupported.

Static member IsValid(ctrl)

Validates the current value against a SAL edit control's data type.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Boolean. The control's data-type validation result, or false when the target lacks SAL editing support.

Static member IsValidDateTime(ctrl)

Tests whether the control's masked text is a valid date/time for its format and culture.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Boolean. True if the editable control's text passes SAL date/time validation; otherwise, false.

Static member IsValidDecimal(ctrl, precision, scale)

Tests masked control text against a decimal precision and scale.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
precisionInt32The allowed decimal precision.
scaleInt32The allowed number of fractional digits.

Returns: Boolean. True when the editable text passes SAL decimal validation using the control's format and culture; otherwise, false.

Static member IsValidEditMask(mask)

Checks the basic syntax of a SAL edit mask.

ParameterTypeDescription
maskStringThe mask to inspect.

Returns: Boolean. True for a nonempty mask containing a recognized mask character, with at most one asterisk placed at the end.

This is a basic structural check, not a full parsing or value-validation pass.

Static member IsValidFormat(format, code)

Tests a numeric or date/time format by formatting and parsing a sample value.

ParameterTypeDescription
formatStringThe format string to test.
codeInt32Use Sys.FMT_Pic_Number or Sys.FMT_Pic_DateTime.

Returns: Boolean. True if the sample converts back to a non-null SAL value; false for unsupported codes or conversion exceptions.

Static member IsValidInteger(ctrl)

Tests whether the control's masked text is a valid SAL integer.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Boolean. True if the editable text passes integer validation using the control's format; otherwise, false.

Static member IsValidNumber(ctrl)

Tests whether the control's text without its mask is a valid SAL number.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.

Returns: Boolean. True if the editable text passes numeric validation using the control's format and culture; otherwise, false.

Static member IsVisible(ctrl)

Tests whether a control is visible.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: Boolean. The visible state, or false for an unresolved control.

Uses COL_Visible for table columns, native window state when a handle exists, and the managed Visible property otherwise.

Static member KillTimer(ctrl, id)

Removes a native window timer.

ParameterTypeDescription
ctrlControlThe timer owner control.
idInt32The native timer identifier.

Returns: Boolean. The native KillTimer result, or false for an unresolved target.

Static member ListGetMultiSelect(ctrl)

Gets the selected-index collection of a multiple-selection list.

ParameterTypeDescription
ctrlControlThe control to inspect.

Returns: IList. The live selected-index collection, or null for an unsupported or single-selection control.

Static member MDIArrangeIcons(ctrl)

Arranges minimized child icons in an MDI container.

ParameterTypeDescription
ctrlControlThe MDI container form.

Returns: Boolean. True when arranged; false when the translated target is not an MDI container.

Static member MDICascade(ctrl)

Cascades child windows in an MDI container.

ParameterTypeDescription
ctrlControlThe MDI container form.

Returns: Boolean. True when arranged; false when the translated target is not an MDI container.

Static member MDITile(ctrl, vertical)

Tiles child windows in an MDI container.

ParameterTypeDescription
ctrlControlThe MDI container form.
verticalBooleanTrue for vertical tiling; false for horizontal tiling.

Returns: Boolean. True when arranged; false when the translated target is not an MDI container.

Static member MessageBeep(alert)

Plays the Windows sound associated with an alert type.

ParameterTypeDescription
alertInt32The native MessageBeep alert value.

Returns: Boolean. The native success result.

Static member MessageBox(owner, text, title, flags)

Displays a modal Windows message box and restores focus when appropriate.

ParameterTypeDescription
ownerControlThe owner control; its form is used, or the active form/MDI child when unavailable.
textStringThe message text.
titleStringThe caption.
flagsInt32The combined button, icon, default-button, and supported message-box option flags.

Returns: Int32. The selected DialogResult value.

Focus restoration is skipped while SAL validation is active.

Static member ModalDialog(type, owner, args)

Creates and shows a SAL modal dialog.

ParameterTypeDescription
typeTypeThe SAL dialog type; MDI and form-table-window subclasses are rejected.
ownerControlThe dialog owner.
argsObject[]Arguments used by the dialog creation path.

Returns: Int32. The dialog's SAL return value.

Static member ModalDialog(typeName, owner, args)

Resolves a dialog type relative to the calling assembly and shows it modally.

ParameterTypeDescription
typeNameStringThe application dialog type name.
ownerControlThe dialog owner.
argsObject[]Arguments used by the dialog creation path.

Returns: Int32. The dialog's SAL return value.

Static member Move(ctrl, offset)

Moves a control relative to its current location using form-unit offsets.

ParameterTypeDescription
ctrlControlThe control to move.
offsetPointFThe horizontal and vertical offsets in form units.

Returns: Boolean. True if the control was resolved and moved; otherwise, false.

Static member Paste()

Pastes clipboard text into the focused control.

Returns: Boolean. The table or column command result, or true after assigning ordinary control text; false if no target is available.

Call CanPaste to check SAL command availability before invoking this operation.

Static member PasteString(text)

Reads Unicode text from the Windows clipboard.

ParameterTypeDescription
text by referenceStringReceives the clipboard text on success; unchanged on failure.

Returns: Boolean. True when Unicode string data is available; otherwise, false.

Clipboard exceptions are logged and suppressed.

Static member PixelsToFormUnits(ctrl, pixels, vertical)

Converts a pixel length to form units using the specified control's form metrics.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
pixelsInt32The pixel length to convert.
verticalBooleanTrue for a vertical measurement; false for a horizontal measurement.

Returns: Single. The converted length in form units.

Static member PopulateList(ctrl, hSql, sql)

Executes a query and replaces list items with tab-separated result rows.

ParameterTypeDescription
ctrlControlThe supported SAL list, ListBox, or ComboBox.
hSqlSalSqlHandleThe SQL handle used to prepare, execute, and read the query.
sqlStringThe SQL to prepare, or null/empty to execute the previously prepared statement.

Returns: Boolean. True when the list is populated; false for an unsupported control or a preparation/execution failure.

Computes tab stops from schema sizes or text lengths, applies SQL Autotrim to trailing spaces, and updates the horizontal extent for ListBox controls.

Static member PopulateList(ctrl, hSql, sql, errorHandler)

Populates a list from a query under a temporary SQL-error handler.

ParameterTypeDescription
ctrlControlThe target list control.
hSqlSalSqlHandleThe connected SQL handle used to execute and read the query.
sqlStringThe statement to prepare, or an empty value to execute the handle's previously prepared statement.
errorHandlerWhenSqlErrorHandlerThe SQL-error handler active during preparation, execution, and fetching.

Returns: Boolean. The result of the underlying list-population operation.

After successful preparation and execution, existing items are cleared. Each result row becomes one item with tab-separated field values. Trailing spaces are trimmed when the SQL handle enables autotrim.

Static member PopulateListFiles(ctrl, ctrlPath, pathName, attributes)

Replaces a SAL list with file, directory, and drive entries.

ParameterTypeDescription
ctrlControlThe ISalListControl to populate.
ctrlPathControlThe control that receives the resolved directory path.
pathName by referenceSalStringThe directory or wildcard specification; receives the final file pattern on success.
attributesInt32The FA_* selection flags.

Returns: Boolean. True on success; false for an unsupported list or a caught I/O/access failure.

Clears the list before enumeration and may change the process current directory. Directories use bracketed names and drives use the form [-c-]. The implementation applies its legacy attribute filtering directly.

Static member PostMessage(ctrl, msg, wParam, lParam)

Posts a native window message asynchronously.

ParameterTypeDescription
ctrlControlThe target control.
msgInt32The message identifier.
wParamIntPtrThe first native parameter.
lParamIntPtrThe second native parameter.

Returns: Boolean. The native post result, or false for a null/disposed target.

Static member PreviewForm(ctrl)

Displays a form through the runtime print-preview helper.

ParameterTypeDescription
ctrlControlThe form to translate and preview.

Static member PrintForm(ctrl)

Prints a form through the runtime form-printing helper.

ParameterTypeDescription
ctrlControlThe form to translate and print.

Instance member ProcessWndProc(m)

Dispatches a native window message through SAL handling and the underlying control.

ParameterTypeDescription
m by referenceMessageThe native message; its result can be updated.

When disposed, suppressed, or in design mode, uses default processing except for non-client creation. State-changing native messages are processed before notification; most other messages are dispatched before default processing.

Instance member RemoveMessageActions(handler)

Deprecated memberDeprecated: Deprecated. Use RemoveWindowActions() Removes a delegate from this window's action manager.

ParameterTypeDescription
handlerDelegateThe action delegate to remove.

This obsolete entry point is equivalent to RemoveWindowActions.

Instance member RemoveWindowActions(handler)

Removes a delegate from this window's action manager.

ParameterTypeDescription
handlerDelegateThe action delegate to remove.

Static member Scale(size, oldScale, newScale)

Converts pixel dimensions between two form-unit scales.

ParameterTypeDescription
sizeSizeThe pixel size to scale.
oldScaleSizeThe original horizontal and vertical scale.
newScaleSizeThe target horizontal and vertical scale.

Returns: Size. The rescaled size; an empty input is unchanged.

Static member Scale(point, oldScale, newScale)

Converts pixel coordinates between two form-unit scales.

ParameterTypeDescription
pointPointThe pixel point to scale.
oldScaleSizeThe original horizontal and vertical scale.
newScaleSizeThe target horizontal and vertical scale.

Returns: Point. The rescaled point; an empty input is unchanged.

Static member SendMessage(ctrl, msg, wParam, lParam)

Sends a native window message synchronously.

ParameterTypeDescription
ctrlControlThe target control.
msgInt32The message identifier.
wParamSalNumberThe first message parameter.
lParamSalNumberThe second message parameter.

Returns: SalNumber. The native message result, or zero for a null/disposed target.

Static member SendMessageToChildren(ctrl, msg, wParam, lParam)

Sends a message to child windows.

ParameterTypeDescription
ctrlControlThe parent control.
msgInt32The message identifier.
wParamSalNumberThe first message parameter.
lParamSalNumberThe second message parameter.

Returns: Boolean. False for a null/disposed parent; otherwise, true.

Traverses children in SAL order but does not descend into forms or user controls. Recipients require existing handles. MDI child forms receive native messages; WM_CLOSE and WM_DESTROY for ordinary descendants are delivered to handlers to avoid destroying controls.

Static member SendSalMessage(ctrl, msgCode, wParam, lParam)

Deprecated memberDeprecated: Deprecated. Use SalWindow.FireWindowActions(). Dispatches a message and wraps its result in the obsolete SalMessage type.

ParameterTypeDescription
ctrlControlThe target control.
msgCodeInt32The message identifier.
wParamSalNumberThe first message parameter.
lParamSalNumberThe second message parameter.

Returns: SalMessage. A SalMessage wrapping the dispatch result.

Use FireWindowActions for new code.

Static member SendValidateMessage()

Sends SAM_Validate to the focused SAL object.

Returns: Int32. The validation result, or VALIDATE_Ok when the operation is already active.

A reentrancy guard prevents recursive validation from this entry point.

Static member SetChecked(ctrl, value)

Sets the checked state of a checkbox or radio button.

ParameterTypeDescription
ctrlControlThe control to update.
valueSalNumberThe SAL numeric value converted to a Boolean checked state.

Returns: Boolean. True for a supported control; otherwise, false.

Static member SetContextMenu(ctrl, menuName, flags)

Creates and assigns a context menu for the specified control.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
menuNameStringThe name used to resolve the menu type.
flagsInt32Use Sys.CM_TableCell to target the associated table column; other values target the control.

Returns: Boolean. True if the menu was created; false if the control or menu type is unavailable or menu creation fails.

Static member SetContextMenu(ctrl, menuType, flags)

Creates and assigns a named context-menu type.

ParameterTypeDescription
ctrlControlThe target control.
menuTypeTypeThe context-menu type to instantiate.
flagsInt32CM_TableCell to assign the table cell context menu; other values assign the control menu.

Returns: Boolean. False when the control/type/menu cannot be resolved; otherwise, true.

A CM_TableCell request on a non-table still returns true. During SAM_ContextMenu processing, the created menu is shown immediately at the mouse position.

Static member SetCursor(ctrl, cursor, type)

Assigns a window or SAL drag cursor while suppressing SAL messages.

ParameterTypeDescription
ctrlControlThe target control.
cursorCursorThe cursor to assign.
typeInt32CURSOR_Window, CURSOR_DragDrop, or CURSOR_DisableDrop.

Returns: Boolean. True on assignment; false for an invalid target/type or a drag cursor target without a SAL adapter.

Static member SetCursor(ctrl, cursorId, type)

Resolves a standard cursor identifier or native handle and assigns it.

ParameterTypeDescription
ctrlControlThe target control.
cursorIdInt32A standard CURSOR_* identifier or native cursor handle.
typeInt32The cursor role accepted by the Cursor overload.

Returns: Boolean. The cursor-assignment result, or false for null ctrl.

Static member SetCursor(ctrl, fileName, type)

Loads a cursor from a file and assigns it to the requested role.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
fileNameStringThe cursor file path.
typeInt32The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: Boolean. True if loading and assignment succeed; otherwise, false.

Only the window role changes the displayed cursor. Drag/drop roles are accepted for SAL windows without changing a cursor.

Static member SetCursor(ctrl, blob, type)

Creates and assigns a cursor from serialized cursor data.

ParameterTypeDescription
ctrlControlThe target control.
blobByte[]The cursor data bytes.
typeInt32The cursor role accepted by the Cursor overload.

Returns: Boolean. True on assignment; false for null ctrl or a caught creation/assignment exception.

Exceptions are logged.

Static member SetDataLength(ctrl, maxLength)

Sets a SAL edit control's maximum input length.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
maxLengthInt32The character limit; -1 is translated to the control's zero default-limit value.

Returns: Boolean. True if the control implements the SAL editing contract; otherwise, false.

Static member SetDefaultButton(ctrl)

Assigns a button as its form accept button.

ParameterTypeDescription
ctrlControlA ButtonBase that implements IButtonControl and belongs to a form.

Returns: Boolean. True after assignment; false when the target is not ButtonBase or has no form.

If focus is currently on a Button, focus moves to the new default button. Other ButtonBase types that do not implement IButtonControl cause InvalidCastException.

Static member SetFocus(ctrl)

Requests keyboard focus for an eligible control.

ParameterTypeDescription
ctrlControlThe target control.

Returns: Control. The previously focused managed control, or null for a rejected target or an unmapped previous handle.

Rejects table columns, SalActiveX controls, hidden controls, and disabled controls. During validation, defers the focus change and returns the current focus control.

Static member SetFont(ctrl, name, size, enhancement)

Creates and assigns a font to the specified control.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
nameStringThe font family name.
sizeInt32The font size in points.
enhancementInt32The combined Sys.FONT_Enh* style flags.

Returns: Boolean. True if the font was created and assigned; otherwise, false.

Static member SetFormat(ctrl, format)

Assigns a format picture, translating encoded SAL numeric format characters when present.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
formatStringThe format picture, including an encoded SAL numeric picture if required.

Returns: Boolean. True if the control implements SAL editing; otherwise, false.

Encoded group, decimal, and currency markers are translated with invariant-culture symbols.

Static member SetFormatCode(ctrl, format)

Applies a standard SAL format code or casing/password behavior.

ParameterTypeDescription
ctrlControlThe target edit control.
formatInt32The FMT_Format_* code.

Returns: Boolean. True when applied, or for Picture even without a change; false for an unsupported code/target.

Casing and password changes are supported by SalDataField and SalTableColumn.

Static member SetFormattedText(ctrl, text, applyFormat)

Assigns text through a SAL edit control's value property.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
textStringThe value text to assign.
applyFormatBooleanRetained for compatibility and ignored.

Returns: Boolean. True if the control implements SAL editing; otherwise, false.

Static member SetHintText(ctrl, text)

Sets the watermark of a SAL data field, multiline field, or combo box.

ParameterTypeDescription
ctrlControlThe target control.
textStringThe watermark text.

Returns: Boolean. True for a supported control; otherwise, false.

Static member SetInputMask(ctrl, mask)

Assigns the edit mask of a SAL edit control.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
maskStringThe mask to assign.

Returns: Boolean. True if the control implements SAL editing; otherwise, false.

Static member SetLabel(ctrl, label)

Associates a label with a control hosted by a SAL form.

ParameterTypeDescription
ctrlControlThe control to associate with the label.
labelControlThe label control to associate.

Does nothing when the control cannot be resolved or its form does not implement SAL form behavior.

Static member SetLabelText(ctrl, text)

Assigns the text of the specified control's associated label.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
textStringThe label text to display.

Returns: Boolean. True if an associated label was found and updated; otherwise, false.

Static member SetListRedraw(ctrl, redraw)

Changes native redraw for an existing ListControl handle.

ParameterTypeDescription
ctrlControlThe control to translate.
redrawBooleanTrue to enable redraw and refresh; false to suppress redraw.

Returns: Boolean. False for a null translated control; otherwise, true, including when no ListControl handle exists.

Static member SetListSelectedIndex(ctrl, index)

Sets the selection index using SAL single- or multiple-selection rules.

ParameterTypeDescription
ctrlControlThe list or combo-box control to access.
indexInt32The zero-based item index. In multiple-selection mode, -1 selects all items and another out-of-range index clears them. In single-selection mode, -1 clears selection.

Returns: Boolean. True after accepted multiple-selection operations; for single-selection controls, true only when an item is selected. Clearing a single selection returns false.

Static member SetListSelectedItems(ctrl, index, select)

Changes selection in a multiple-selection list.

ParameterTypeDescription
ctrlControlThe list control.
indexInt32The item index; -1 selects or clears all items for a plain ListBox. ISalListControl implementations receive the value directly.
selectBooleanTrue to select; false to clear selection.

Returns: Boolean. True when the supported operation completes; false for an unsupported/single-selection control or invalid plain-list index.

Static member SetListSelectedText(ctrl, startIndex, text)

Selects an item matching text while suppressing SAL messages.

ParameterTypeDescription
ctrlControlThe list control.
startIndexInt32The index after which to search; -1 starts at the beginning.
textStringThe search text; null or empty text is not searched.

Returns: Int32. The matching item index, or -1 when none is found.

Search wraps to the beginning. A failed search clears displayed content only when there is no valid existing selection.

Static member SetListTabStops(ctrl, tabStops)

Assigns tab stops for list item text.

ParameterTypeDescription
ctrlControlThe list control or table column.
tabStopsSalArray<SalNumber>The tab-stop positions in SAL form units.

Returns: Boolean. True when assigned; false for an unsupported target or a rejected tab-stop request.

Table columns store the array on their combo-box configuration. Native list controls convert positions to dialog units.

Static member SetLocation(ctrl, pos)

Moves a control to a position expressed in form units.

ParameterTypeDescription
ctrlControlThe control to move.
posPointFThe horizontal and vertical position in SAL form units.

Returns: Boolean. True when a control resolves; otherwise, false.

Static member SetModified(ctrl, modified)

Sets the specified control's SAL modification flag.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.
modifiedBooleanTrue to mark the value modified; false to clear the flag.

Returns: Boolean. True if the translated control supports SAL values; otherwise, false.

For editable SAL controls, this also clears the validation flag.

Static member SetProfile(ctrl, profile)

Assigns a culture profile to a SAL edit control.

ParameterTypeDescription
ctrlControlThe target control.
profileInt32The FMT_Profile_* identifier.

Returns: Boolean. False for an unresolved control; otherwise, true, including non-edit controls.

The program profile clones Sys.CultureInfo so the assigned culture is writable; other profiles use TranslateProfile.

Static member SetProfileParameter(ctrl, paramCode, paramValue)

Changes a numeric parameter in a SAL edit control's writable formatting culture.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
paramCodeInt32The supported Sys.FMT_Parm_* parameter code.
paramValueSalNumberThe new parameter value.

Returns: Boolean. True when the parameter code is accepted; false for an unsupported code, noneditable target, or missing/read-only culture.

The current value is reassigned after updating the culture. Date-type, leading-zero, and time-leading-zero settings are accepted without changing those settings.

Static member SetProfileParameter(ctrl, paramCode, paramValue)

Changes a text parameter in a SAL edit control's writable formatting culture.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
paramCodeInt32The supported Sys.FMT_Parm_* parameter code.
paramValueSalStringThe new parameter value.

Returns: Boolean. True when the parameter code is accepted; false for an unsupported code, noneditable target, or missing/read-only culture.

The current value is reassigned after updating the culture.

Static member SetProperty(ctrl, name, value)

Adds or replaces a named property on a SAL window.

ParameterTypeDescription
ctrlControlThe control whose SAL named-property collection is updated.
nameStringThe case-sensitive property name.
valueStringThe value to store, including null.

Returns: Boolean. True if the translated control implements the SAL window contract; otherwise, false.

Static member SetScrollBarPosition(ctrl, pos)

Sets a scrollbar value, clamping it to the configured range.

ParameterTypeDescription
ctrlControlThe scrollbar control.
posInt32The requested value.

Returns: Boolean. True when assigned without clamping; false for an unsupported target or a value outside the range.

An out-of-range request still updates the scrollbar to the nearest endpoint.

Static member SetScrollBarRange(ctrl, min, max, line, page)

Sets a scrollbar's range and increments.

ParameterTypeDescription
ctrlControlThe scrollbar control.
minInt32The new minimum.
maxInt32The new maximum, assigned through the SAL override when available.
lineInt32The small-change increment.
pageInt32The large-change increment.

Returns: Boolean. True if the translated target is a scrollbar; otherwise, false.

Static member SetSize(ctrl, size)

Sets a control's dimensions using form units.

ParameterTypeDescription
ctrlControlThe control to resize.
sizeSizeFThe new width and height in form units.

Returns: Boolean. True if the control was resolved and resized; otherwise, false.

Static member SetStatusBarText(ctrl, text)

Sets the text of an associated status bar when one exists.

ParameterTypeDescription
ctrlControlThe control whose status bar is searched.
textStringThe new text.

Returns: Boolean. True, including when no status bar exists.

Static member SetStatusBarText(menu, text)

Sets status text for the form that owns a menu.

ParameterTypeDescription
menuMenuThe menu whose owner is resolved.
textStringThe new status text.

Returns: Boolean. False when no owner is found; otherwise, the control overload result.

Static member SetText(ctrl, text)

Assigns the translated control Text property.

ParameterTypeDescription
ctrlControlThe target control.
textStringThe new text; an empty string becomes null for ComboBox controls.

Returns: Boolean. True when a control resolves; otherwise, false.

Static member SetTimer(ctrl, id, millisec)

Creates or resets a native window timer.

ParameterTypeDescription
ctrlControlThe timer owner control.
idInt32The timer identifier.
millisecInt32The requested interval in milliseconds.

Returns: Boolean. True when the native SetTimer call returns a nonzero identifier; otherwise, false.

Static member SetWindowColor(ctrl, colorIndex, nColor)

Sets a supported control color by SAL color index.

ParameterTypeDescription
ctrlControlThe control to update.
colorIndexInt32The target COLOR_Index* value.
nColorInt32The SAL color value.

Returns: Boolean. False for an unresolved control or unknown index; otherwise, true.

A recognized index can return true without a change when the control type does not support that color role.

Static member ShowStatusBar(ctrl, visible)

Changes the visibility of a form's status bar.

ParameterTypeDescription
ctrlControlThe form that owns the accessory.
visibleBooleanTrue to show the accessory; false to hide it.

Returns: Boolean. True if the translated target is a form with the requested accessory; otherwise, false.

Static member ShowToolBar(ctrl, visible)

Changes the visibility of a form's toolbar.

ParameterTypeDescription
ctrlControlThe form that owns the accessory.
visibleBooleanTrue to show the accessory; false to hide it.

Returns: Boolean. True if the translated target is a form with the requested accessory; otherwise, false.

Static member ShowWindow(ctrl)

Shows the specified control or table column.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. The visibility state before the operation, or false if the control cannot be resolved.

Static member ShowWindowAndLabel(ctrl)

Shows the specified control and its associated label.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. The control's visibility before the operation, or false if it cannot be resolved.

Static member TrackPopupMenu(ctrl, menuName, flags, pos)

Creates and displays a popup menu at a screen position.

ParameterTypeDescription
ctrlControlThe owner control.
menuNameStringThe name used to resolve the menu type.
flagsInt32TPM_RightAlign and TPM_CursorX/TPM_CursorY flags; center/context-menu flags are not implemented.
posPointThe screen position in pixels; cursor flags replace the corresponding coordinate.

Returns: Boolean. True when the popup is shown; false when the target or menu cannot be resolved.

Restores the previous context menu, updates the control, and schedules disposal of the temporary menu afterward.

Static member TrackPopupMenu(ctrl, menuType, flags, pos)

Creates and displays a popup menu at a screen position.

ParameterTypeDescription
ctrlControlThe owner control.
menuTypeTypeThe menu type to instantiate.
flagsInt32TPM_RightAlign and TPM_CursorX/TPM_CursorY flags; center/context-menu flags are not implemented.
posPointThe screen position in pixels; cursor flags replace the corresponding coordinate.

Returns: Boolean. True when the popup is shown; false when the target or menu cannot be resolved.

Restores the previous context menu, updates the control, and schedules disposal of the temporary menu afterward.

Static member TranslateColor(color)

Converts a drawing color to a SAL color constant or Win32 color value.

ParameterTypeDescription
colorColorThe color to translate.

Returns: Int32. A matching SAL system/default/transparency constant when available; otherwise, the Win32 color value.

Static member TranslateControl(ctrl)

Resolves the actual SAL control behind accessories, embedded tables, and second-base instances.

ParameterTypeDescription
ctrlControlThe control to translate.

Returns: Control. The translated control, or null for null input.

Static member TranslateProfile(profile)

Resolves a SAL formatting profile to a culture.

ParameterTypeDescription
profileInt32A SAL country/default profile constant or a locale identifier.

Returns: CultureInfo. The mapped cached culture, or the current SAL culture for the default profile.

Static member TranslateSalColor(colorValue)

Converts a SAL color value into a drawing color.

ParameterTypeDescription
colorValueInt32A SAL color constant or Win32 color value.

Returns: Color. The translated Color; COLOR_None becomes Transparent and COLOR_Default becomes Empty.

Static member Undo()

Dispatches the undo clipboard command to the focused table or column.

Returns: Boolean. The table or column command result; false for ordinary controls or an unavailable target.

Static member Update(ctrl)

Requests an update of the specified control.

ParameterTypeDescription
ctrlControlThe control on which to perform the SAL operation.

Returns: Boolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Static member UpdateMainMenu(form)

Refreshes SAL items in a form's merged or regular main menu.

ParameterTypeDescription
formFormThe form whose menu is refreshed.

Returns: Boolean. True if a menu is found; otherwise, false.

For an MDI container with an active child, the child's menu is used. Refresh occurs within a root SAL context.

Static member Validate(ctrl, showErrorMessage)

Validates a SAL edit control and applies its format after successful validation.

ParameterTypeDescription
ctrlControlThe control whose SAL editing behavior is accessed.
showErrorMessageBooleanTrue to display the SAL invalid-data message when validation fails.

Returns: Boolean. True after successful validation and formatting; otherwise, false.

Static member WaitCursor(wait)

Sets the current pointer to the wait or default cursor.

ParameterTypeDescription
waitBooleanTrue for WaitCursor; false for Default.

Returns: Boolean. True.

Static member WinHelp(ctrl, file, command, index, key)

Invokes the legacy Windows WinHelp API.

ParameterTypeDescription
ctrlControlThe owner control.
fileStringThe help file path.
commandInt32The HELP_* command.
indexInt32The numeric argument for HELP_Context or HELP_SetIndex.
keyStringThe search key for HELP_Key.

Returns: Boolean. False for an empty file name; otherwise, the native WinHelp result.

Static member Yield(ctrl)

Processes pending UI messages for a control.

ParameterTypeDescription
ctrlControlThe control whose native message queue entry is requested.

With no valid handle, calls Application.DoEvents. Otherwise removes and dispatches at most one matching message, invoking Sal.Quit for WM_QUIT.