Watcom C Library Reference : _dwDeleteOnClose, _dwSetAboutDlg, _dwSetAppTitle, _dwSetConTitle, _dwShutDown, _dwYield

 

 

 

 

_dwDeleteOnClose,

 

Synopsis : #include <wdefwin.h> 

              int _dwDeleteOnClose ( int handle );

 


Description : The _dwDeleteOnclose function tells the console window that it should close itself when the corresponding file is closed. The argument handle is the handle associated with me opened console.


The _dwDeleteOnClose function is one of the support functions that can be called from an application using WATCOM's default windowing support.

 

 

Returns : The _dwDeleteOnClose function returns 1 if it was successful and 0 if not.

 

 

See Also : _dwSetAboutDlg, _dwSetAppTitle, _dwSetConTitle, _dwShutDown, _dwYield

 


Example :

#include <wdefwin.h> 

#include <stdio.h>


void main( )

{
    FILE     *sec;
   

    _dwSetAboutDlg( "Hello World About Dialog",

                        "About Hello World\n"
                        "Copyright 1994 by WATCOM\n" );

 

    _dwSetAppTitle( "Hello World Application Title" );

    _dwSetConTitle( 0, "Hello World Console Title" );

    printf( "Hello World\n" );

 

    sec = fopen( "CON", "r+" );

    _dwSet_ConTitle( fileno ( sec ), "Hello World Second Console Title" ); 

    _dwDeleteOnClose( fileno ( sec ) );

    fprintf( sec, "Hello to second console\n" );

    fprintf( sec, "Press Enter to close this console\n" );

    fflush(' sec );

    fgetc ( sec );

    fclose( sec );

}

 

Classification : WATCOM
Systems : Win, OS/2 2.x, NT

 

 

 

 

 

_dwSetAboutDlg

 

Synopsis : #include <wdefwin.h> 

              int _dwSetAboutDlg( const char *title, const char *text ):


Description : The _dwSetAboutDlg function sets the "About" dialog box of the default windowing system. The argument title points to the string that will replace the current title. If title is NULL then the title will not be replaced. The argument text points to a string which will be placed in the "About" box. To get multiple lines, embed a new line after each logical line in the string. If text is NULL, then the current text in the "About" box will not be replaced.


The _dwSetAboutDlg function is one of the support functions that can be called from an application using WATCOM's default windowing support.

 

 

Returns : The _dwSetAboutDlg function returns 1 if it was successful and 0 if not.

 

 

See Also : _dwDeleteOnClose, _dwSetAppTitle, _dwSetConTitle, _dwShutDown _dwYield

 


Example :

#include <wdefwin.h> 

#include <stdio.h>

 

void main( )

{
    FILE     *sec;


    _dwSetAboutDlg( "Hello World About Dialog",

                        "About Hello World\n"

                        "Copyright 1994 by WATCOM\n" ); 

    _dwSetAppTitle( "Hello World Application Title" );

    _dwSetConTitle( 0, "Hello World Console Title" );

    printf( "Hello World\n" );

 

    sec = fopen( "CON", "r+" );

    _dwSetConTitle( fileno ( sec ), "Hello World Second Console Title" ); 

    _dwDeleteOnClose( fileno ( sec ) );

    fprintf( sec, "Hello to second console\n" );

    fprintf( sec, "Press Enter to close this console\n" );

    fflush( sec );

    fgetc( sec );

    fclose( sec );

}

 

Classification : WATCOM
Systems : Win, OS/2 2.x, NT

 

 

 

 

 

_dwSetAppTitle

 

Synopsis : #include <wdefwin.h> 

              int _dwSetAppTitle( const char *title );


Description : The _dwSetAppTitle function sets the main window's title. The argument title point to the string that will replace the current title. The _dwSetAppTitle function is one of the support functions that can be called from an application using WATCOM's default windowing support.

 

 

Returns : The _dwSetAppTitle function returns 1 if it was successful and 0 if not.

 

 

See Also : _dwDeleteOnClose, _dwSetAboutDlg, _dwSetConTitle, _dwShutDown, _dwYield

Example :

#include <wdefwin.h> 

#include <stdio.h>


void main( )

{
    FILE     *sec;


    _dwSetAboutDlg( "Hello World About Dialog",
                        "About Hello World\n"
                        "Copyright 1994 by WATCOM\n" );

    _dwSetAppTitle( "Hello World Application Title" );

    _dwSetConTitle( 0, "Hello World Console Title" );

    printf( "Hello World\n" );

 

    sec = fopen( "CON", "r+" );

    _dwSetConTitle( fileno ( sec ), "Hello World Second Console Title" ); 

    _dwDeleteOnClose( fileno ( sec ) );

    fprintf( sec, "Hello to second console\n" );

    fprintf( sec, "Press Enter to close this console\n" );

    fflush( sec );

    fgetc( sec );

    fclose( sec );

}

 

Classification : WATCOM
Systems : Win, OS/2 2.x, NT

 

 

 

 

 

_dwSetConTitle

 

Synopsis : #include <wdefwin.h> 

              int _dwSetConTitle( int handle, const char *title );

 


Description : The _dwSetConTitle function sets the console window's title which corresponds to handle passed to it. The argument handle is the handle associated with the opened console. The argument title points to the string that will replace the current title.


The _dwSetConTitle function is one of the support functions that can be called from a application using WATCOM's default windowing support.

 

 

Returns : The _dwSetConTitle function returns 1 if it was successful and 0 if not.

 

 

See Also : _dwDeleteOnclose, _dwSetAboutDig, _dwSetAppTitle, _dwShutDown, _dwYield

 


Example :

#include <wdefwin.h> 

#include <stdio.h>


void main( )

{
    FILE     *sec;


    _dwSetAboutDlg( "Hello World About Dialog",
                        "About Hello World\n"
                        "Copyright 1994 by WATCOM\n" );

    _dwSetAppTitle( "Hello World Application Title" );

    _dwSet ConTitle( 0, "Hello World Console Title" );

    printf( "Hello World\n" );

 

    sec = fopen( "CON", "r+" );

    _dwSetConTitle( fileno ( sec ), "Hello World Second Console Title" ); 

    _dwDeleteOnClose( fileno ( sec ) ) ;

    fprintf( sec, "Hello to second console\n" );

    fprintf( sec, "Press Enter to close this console\n" );

    fflush( sec );

    fgetc( sec ) ;

    fclose( sec );

}

 

Classification : WATCOM
Systems : Win, OS/2 2.x, NT

 

 

 

 

 

_dwShutDown

 

Synopsis : #include <wdefwin.h> 

              int _dwShutDown ( void );

Description : The _dwShutDown function shuts down the default windowing I/O system. The application will continue to execute but no windows will be available for output. Care should be exercised when using this function since any subsequent output may cause unpredictable results.


When the application terminates, it will not be necessary to manually close the main window.


The _dwShutDown function is one of the support functions that can be called from an application using WATCOM's default windowing support.

 

 

Returns : The _dwShutDown function returns 1 if it was successful and 0 if not.

 

 

See Also : _dwDeleteOnclose, _dwSetAboutDlg, _dwSetAppTitle, _dwSetConTitle, _dwYield

 


Example :

#include <wdefwin.h> 

#include <stdio.h>


void main( )

{
    FILE     *sec;


    _dwSetAboutDlg( "Hello World About Dialog",
                        "About Hello World\n"
                        "Copyright 1994 by WATCOM\n" );

    _dwSetAppTitle( "Hello World Application Title" );

    _dwSetConTitle( 0, "Hello World Console Title" );

    printf( "Hello World\n" );

 

    sec = fopen( "CON", "r+" );

    _dwSetConTitle( fileno ( sec ), "Hello World Second Console Title" ); 

    _dwDeleteOnClose( fileno ( sec ) );

    fprintf( sec, "Hello to second console\n" );

    fprintf( sec, "Press Enter to close this console\n");

    fflush( sec );

    fgetc( sec );

    fclose( sec );

    _dwShut Down( );

    /* do more computing that does not involve console input/output */

}

 

Classification : WATCOM
Systems : Win, OS/2 2.x, NT

 

 

 

 

 

_dwYield

 

Synopsis : #include <wdefwin.h> 

              int _dwYield( void );

 


Description : The _dwYield function yields control back to the operating system, thereby giving other processes a chance to run.

 

The _dwYield function is one of the support functions that can be called from an application using WATCOM's default windowing support.

 

 

Returns : The _dwYield function returns 1 if it was successful and 0 if not.

 

 

See Also : _dwDeleteOnClose, _dwSetAboutDig, _dwSetAppTitle, _dwSetConTitle, _dwShutDown

 


Example :

#include <wdefwin.h> 

#include <stdio.h>


void main( )

{
    int     i;
    for( i = 0; i < 1000; i++ ) {
        /* give other processes a chance to run */

        _dwYield( );

 

        /* do CPU-intensive calculation */
        /*    .    */

        /*    .    */

        /*    .    */
    }

}

 

Classification : WATCOM
Systems : Win, OS/2 2.x, NT

 

 

 

 

 

 

 

 

This manual describes the WATCOM C library for DOS, Windows, and OS/2, It includes the Standard C Library (as defined in the ANSI C Standard).

 

WATCOM C Language Reference manual describes the ANSI C Programming language and extensions to it which are supported by WATCOM C/C++ (32bit)

 

 

 

728x90
반응형
Posted by 전화카드
,