Generic Windows Functions

 

COS.SetWindowText - Sets the text contained in a specified window

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

                        <cosCtlText$> contains the text to be copied

On Exit:

 

 

COS.GetWindowText - Gets the text contained in a specified window

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

On Exit:            <cosCtlText$> contains the window text

 

 

COS.GetWindowTextLength - Returns length of text in a specified window

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

On Exit:            <cosFuncResult>          contains the length of the window text

 

 

COS.GetTextExtent - Returns the width & height of specified text

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

                        <cosCtlText$ >            contains the text to be measured

 

On Exit:            <cosWidth>                 contains the width of the text

 

                        <cosHeight>                 contains the height of the text

 

 

COS.SendMessage - Sends a message to a specified window

 

On Entry:          <cosCWnd$>  contains a handle to the target window

 

                        <cosMessage> contains the message (WM_?? Or…)

 

                        <coswParam>  contains a 32 bit wParam value

 

                        <coslParam>                contains a 32 bit lParam value

On Exit:

 

 

COS.PostMessage - Posts a message to a specified window

 

In Comet, this function is essentially the same as COS.SendMessage

 

 

COS.ShowWindow - Specifies how a window is to be shown

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

<cosState> contains the desired state as follows:

SW.HIDE

SW.SHNORMAL

SW.NORMAL

SW.SHMINIMIZE

SW.SHMAXIMIZE

SW.MAXIMIZE

SW.SHNOACTIVATE

SW.SHOW

SW.MINIMIZE

SW.SHMINNOACTIVATE

SW.SHNA

SW.RESTORE

 

On Exit:            < cosFuncResult >        nonzero if the window was previously visible. It

is zero if the window was previously hidden.

 

 

COS.EnableWindow - Enables/disables a window

 

This function enables or disables mouse and keyboard input to the given window or control. When input is disabled, the window ignores input such as mouse clicks and key presses. When input is enabled, the window processes all input.

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

<cosState>                   contains the desired state as follows:

cosEW.ENABLE (1)  - Enables control

cosEW.DISABLE (0) - Disables control

 

On Exit:            <cosFuncResult>          nonzero if the window was previously disabled.

Otherwise, the return value is zero

 

 

COS.IsWindowEnabled - Determines if a window is enabled/disabled

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

On Exit:            <cosState>                   contains the window state as follows:

cosEW.ENABLE (1)  - Enabled

cosEW.DISABLE (0) - Disabled

 


COS.SetFocus - Moves the input focus to the specified window

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

On Exit:            <cosCWnd$>  contains a handle to the window that previously

had the focus or NullWord$ if the function failed

 

 

COS.GetFocus - Gets the handle of the window with the focus

 

On Entry:

On Exit:            <cosCWnd$>  contains a handle to the window that has the

Input focus

 

 

COS.GetParent - Gets the handle of a window’s parent

 

On Entry:          <cosCWnd$>  contains a handle to the subject child window

 

On Exit:            <cosCWnd$>  contains a handle to the parent of the specified

child window

 

 

COS.InvalidateRect - Invalidates a specified rectangle of a window

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

A rectangle specified in screen units by the variables:

<cosLeft>

<cosTop>

<cosRight>

<cosBottom>

 

                        <cosDlgFlags> cosIR.ERASEBKG to erase background and/or

cosIR.ENTIREWIN to invalidate the entire window

On Exit:

 

 

COS.GetDialogBaseUnits - Returns the factor by which dialog control units are measured.

 

SEE: COS.GetCoswBaseUnits substituting “dialog template units” for “COSW units”

 

 

COS.MapDialogRect - Converts rectangle from dialog units to pixels

 

On Entry:          A rectangle specified in COSW units by the variables:

<cosLeft>

<cosTop>

<cosRight>

<cosBottom>

 

On Exit:            The same rectangle specified in screen units (pixels) by the variables:

<cosLeft>

<cosTop>

<cosRight>

<cosBottom>

 

 

COS.ClientToScreen - Converts a point from client coordinates to screen coordinates.

 

On Entry:          A point specified in client coordinates by the variables:

<cosCol>

<cosRow>

 

On Exit:            The same point specified in screen units (pixels) by the variables:

<cosCol>

<cosRow>

 

 

COS.GetWindowRect - Returns the rectangle defining a window in screen coordinates

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

On Exit:            A rectangle containing the screen coordinates of the window in the variables:

<cosLeft>

<cosTop>

<cosRight>

<cosBottom>

 

 

COS.GetClientRect - Returns the rectangle defining a window in client coordinates.

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

On Exit:            A rectangle containing the client of the window in the variables:

<cosLeft>

<cosTop>

<cosRight>

<cosBottom>

 

 

COS.SetWindowPosEx - Moves, sizes and changes z-order of specified the window

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

A rectangle specified by the variables:

<cosCol>

<cosRow>

<cosWidth>

<cosHeight>

 

<cosDlgFlags> contains one of the following:

 

SWP.DRAWFRAME - Draws a frame (defined in the window's class description) around the window.

 

SWP.HIDEWINDOW - Hides the window.

 

SWP.NOACTIVATE - Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the cosItemId parameter).

 

SWP.NOMOVE         Retains the current position (ignores the x and y parameters).

 

SWP.NOSIZE Retains the current size (ignores the cosWidth and cosHeight parameters).

 

SWP.NOREDRAW    Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the non-client area (including the title and scroll bars), and any part of the parent window uncovered as a result of the moved window. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that must be redrawn.

 

SWP.NOZORDER      Retains the current ordering (ignores the hwndInsertAfter parameter).

 

SWP.SHOWWINDOW          Displays the window.

 

<cosItemId>                contains one of the following:

HWND.BOTTOM - Places the window at the bottom of the Z-order. If cosCWnd$ identifies a topmost window, the window loses its topmost status; the system places the window at the bottom of all other windows.

 

HWND.TOP - Places the window at the top of the Z-order.

 

HWND.TOPMOST - Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.

 

HWND.NOTOPMOST - Repositions the window to the top of all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.

 

On Exit:

 

 

COS.MoveWindow - Moves and sizes a window to the specified screen coordinates

 

On Entry:          <cosCWnd$>  contains a handle to the subject window

 

A rectangle specified by the variables:

<cosCol>

<cosRow>

<cosWidth>

<cosHeight>

 

<cosDlgFlags> 1 to repaint window else 0

On Exit:

 


COS.MessageBox - Displays a message box with a specified parent

 

On Entry:          < cosCtlText$>            contains the message box text

 

                        <cosSysData$>            contains the message box caption

 

            <cosState>                   Specifies the contents and behavior of the

message box.

 

MB.ABORTRETRYIGNORE - The message box contains three push buttons: Abort, Retry, and Ignore.

 

MB.APPLMODAL - The user must respond to the message box before continuing work in the window identified by the hwndParent parameter. However, the user can move to the windows of other applications and work in those windows. MB.APPLMODAL is the default if neither MB.SYSTEMMODAL nor MB.TASKMODAL is specified.

 

MB.DEFBUTTON1 - The first button is the default. Note that the first button is always the default unless MB.DEFBUTTON2 or MB.DEFBUTTON3 is specified.

 

MB.DEFBUTTON21 - The second button is the default.

 

MB.DEFBUTTON31 - The third button is the default.

 

MB.ICONASTERISK1 - Same as MB.ICONINFORMATION.

MB.ICONEXCLAMATION1 - An exclamation-point icon appears in the message box.

 

MB.ICONHAND1 - Same as MB.ICONSTOP.

 

MB.ICONINFORMATION1 - An icon consisting of a lowercase letter "I" in a circle appears in the message box.

 

MB.ICONQUESTION1 - A question-mark icon appears in the message box.

 

MB.ICONSTOP1 - A stop-sign icon appears in the message box.

 

MB.OK1 - The message box contains one push button: OK.

 

MB.OKCANCEL1 - The message box contains two push buttons: OK and Cancel.

 

MB.RETRYCANCEL1 - The message box contains two push buttons: Retry and Cancel.

 

MB.SYSTEMMODAL1 - All applications are suspended until the user responds to the message box. Unless the application specifies MB.ICONHAND, the message box does not become modal until after it is created; consequently, the parent window and other windows continue to receive messages resulting from its activation. System-modal message boxes are used to notify the user of serious, potentially damaging errors that require immediate attention (for example, running out of memory).

 

MB.TASKMODAL1 - Same as MB.APPLMODAL except that all the top-level windows belonging to the current task are disabled if the hwndParent parameter is NULL. This flag should be used when the calling application or library does not have a window handle available but still needs to prevent input to other windows in the current application without suspending other applications.

 

MB.YESNO1 - The message box contains two push buttons: Yes and No.

 

MB.YESNOCANCEL1 - The message box contains three push buttons: Yes, No, and Cancel.

 

On Exit:            <cosFuncResult>          contains the ID of the control that caused the

dialog to close.