Contents Questions UDO5
The Online Help file for COPS

For Programmers

How do I recognize COPS?

If you define cpx_init() as

        CPX_INFO * cdecl cpx_init( XCPB *xcpb, LONG magic, LONG version );
you can determine whether the CPX is running under COPS or XCONTROL by way of the parameters <magic> und <version>:

     WORD is_COPS( LONG magic, LONG version )
     {
        if (( magic == 'COPS' ) && ( version >= 0x10000L )) /* COPS? */
           return( 1 );
     
        return( 0 );                                     /* XCONTROL */
     }
If COPS has been recognized, the CPX can draw a 512 * 384 pixel object tree and send it to Xform_do().

Also, you have the following extension for cpx_call():

        WORD cdecl cpx_call( GRECT *work, DIALOG *dialog );
<dialog> is a pointer to the window dialog structure. The window dialog is opened by COPS after cpx_init() with wdlg_create() and wdlg_open(). The GRECT <work> and the object tree are outside the visible area of the screen until the first call to Xform_do() or until returning from cpx_call().