Secondary Dialog Control Functions

 

COS.FindDialog - Find a dialog with a specified ID

 

This function searches through a list of dialogs that have already been created for a session, to find the dialog that is assigned a special user ID.  This function can be useful when entering or returning from an overlay or just running a new program that expects to find such a dialog.  The user ID is assigned at the time the dialog is executed (COS.DoModal or COS.CreateDialog).  An example of a use for this function can be found in the demo program “image” (source #image) contained in the DLG demonstration directory.

 

On Entry:          <cosCtlId>                   Contains the user ID

 

On Exit:            <cosCWnd$>  Contains a handle to the found dialog

                                                            Null$ (“”) if no such dialog was found

 

 

COS.ModalLoop - Executes a modal loop

 

This function is called to enter a MODAL loop.  Once called, control will not return to the calling program until signaled to do so (see COS.ExitModalLoop) from within a message handler.  This function is most often used when Windows controls have been added to the QCRT window, a feature that is demonstrated in the IB demo program “direct” (source #direct) contained in the DLG demonstration directory.

 

On Entry:

On Exit:

 

 

COS.ExitModalLoop - Terminates a modal loop

 

This function is called from within a command message handler to signal that a modal loop (see COS.ModalLoop) is to be terminated.  After calling COS.ExitModalLoop, the message handler must return to its calling function before the function will have an affect.

 

On Entry:

On Exit:

 


COS.EnableInterrupts - Allows messages to be received from Windows

 

This feature enables the Driver Library to continue receiving messages from a dialog or other window while inside an IB INPUT statement.  This function essentially allows a program to have the best of both worlds, that is, Windows controls overlaying a QCRT screen.

 

On Entry:

On Exit:

 

 

COS.DisableInterrupts - Disables Windows messages

 

This feature is called after returning from an IB INPUT statement to prevent Windows messages from being received by the Driver Library.

 

On Entry:

On Exit:

 

 

COS.FlushQueue - Clear all messages pending in the msg. queue

 

Call this function to remove any un-serviced d messages that may have been left in the Driver Library message queue.  This function is useful following errors that may prevent some functions from retrieving Windows messages.

 

On Entry:

On Exit:

 

 

COS.InitCmdFilter - Initializes a WM.COMMAND filter

 

This function initializes a table of up to 63 control id’s and control notifications that are used to filter command (WM_COMMAND) messages generated by a window, dialog, or control.  In order for a program to receive any command message, it MUST have a corresponding entry in this table.

 

On Entry:          <cosCtlText$> Contains a list of 4 byte entries as follows:

                                                                        2 byte packed control ID

                                                                        2 byte packed message

On Exit:

 


COS.AppendCmdFilter - Adds entries to a WM.COMMAND filter

 

This function allows additional entries to be made to the command message filter as described by COS.InitCmdFilter.  Up to 63 entries can be made in a single call.

 

On Entry:          <cosCtlText$> Contains a list of 4 byte entries as follows:

                                                                        2 byte packed control ID

                                                                        2 byte packed message

On Exit:

 

 

COS.InitMsgFilter - Initializes a WM. Message filter

 

This function initializes a table of up to 42 control id’s and control notifications that are used to filter window messages (WM_MESSAGE) generated by a window, dialog, or control.  In order for a program to receive any window message (WM_MESSAGE), it MUST have a corresponding entry in this table.

 

On Entry:          <cosCtlText$> Contains a list of 6 byte entries as follows:

                                                                        4 byte window handle

                                                                        2 byte packed message

On Exit:

 

 

COS.AppendMsgFilter - Adds entries to a WM. Message filter

 

This function allows additional entries to be made to the command message filter as described by COS.InitMsgFilter.  Up to 42 entries can be made in a single call.

 

On Entry:          <cosCtlText$> Contains a list of 6 byte entries as follows:

                                                                        4 byte window handle

                                                                        2 byte packed message

On Exit:

 

 

COS.DialogHasFocus - Determines if any control contained in a specified dialog has the focus.

 

This function is used from within a message handler when a cosEN.LOSTFOCUS message is received to determine if the focus left the application (in which case we don’t validate) or just went to another control.

 

On Entry:

On Exit:            <cosState>       TRUE if a control in the dialog still has the focus

                                                FALSE if the focus has altogether left the dialog

 


COS.SetWindowPos - Moves a dialog to a window quadrant or the center of a

window.

 

On Entry:          <cosCWnd$>  The parent window (NullWord$ for screen)

that is used to position the dialog.

 

 <cosState>                  The quadrant to locate the window as follows:

                                                0 is centered

1 is upper left

2 is upper right

3 is lower right

4 is lower left

 

NOTE: This function has a windows counterpart, but due to an error, the functionality is different.  For the functionality of the windows SetWindowPos function use COS.SetWIndowPosEx instead.