home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / MSJV5-6.ZIP / FORM2.ZIP / PAGE4.C < prev    next >
C/C++ Source or Header  |  1990-11-01  |  2KB  |  81 lines

  1. /*
  2.  * Page Selection - INFO MODULE
  3.  *
  4.  * LANGUAGE      : Microsoft C5.1
  5.  * MODEL         : small
  6.  * ENVIRONMENT   : Microsoft Windows 3.0 SDK
  7.  * STATUS        : operational
  8.  *
  9.  * This module defines the function responsible for returning a data
  10.  * structure that describes the control library.  This data structure
  11.  * can be used by other applications when working with the control.
  12.  *
  13.  *    Eikon Systems, Inc.
  14.  *    989 East Hillsdale Blvd, Suite 260
  15.  *    Foster City, California 94404
  16.  *    415-349-4664
  17.  *
  18.  * 11/30/89 1.00 - Kevin P. Welch - initial creation.
  19.  *
  20.  */
  21.  
  22. #define  NOCOMM
  23.  
  24. #include <windows.h>
  25. #include <control.h>
  26.  
  27. #include "page.h"
  28. #include "page.d"
  29.  
  30. /* */
  31.  
  32. /*
  33.  * PageInfo( VOID ) : HANDLE;
  34.  *
  35.  * This function returns a handle to an information block
  36.  * which describes the page selection control.  Included in the
  37.  * information returned is the suggested size of the
  38.  * control, default style flags, and other useful data.
  39.  *
  40.  */
  41.  
  42. HANDLE FAR PASCAL PageInfo( VOID )
  43. {
  44.    HANDLE      hCtlInfo;
  45.    LPCTLINFO   lpCtlInfo;
  46.  
  47.    /* allocate memory for information structure */
  48.    hCtlInfo = GlobalAlloc( GMEM_MOVEABLE, (DWORD)sizeof(CTLINFO) );
  49.    if ( hCtlInfo ) {
  50.  
  51.       /* lock it down */
  52.       lpCtlInfo = (LPCTLINFO)GlobalLock( hCtlInfo );
  53.       if ( lpCtlInfo ) {
  54.  
  55.          /* define Information */
  56.          lpCtlInfo->wCtlTypes = 1;
  57.          lpCtlInfo->wVersion = PAGE_VERSION;
  58.          lstrcpy( lpCtlInfo->szClass, PAGE_NAME );
  59.          lstrcpy( lpCtlInfo->szTitle,
  60.             "Page Selection Control\nby Kevin P. Welch" );
  61.  
  62.          lpCtlInfo->Type[0].wType = CT_STD;
  63.          lpCtlInfo->Type[0].wWidth = 48;
  64.          lpCtlInfo->Type[0].wHeight = 70;
  65.          lpCtlInfo->Type[0].dwStyle = PAGE_WNDSTYLE;
  66.          lstrcpy( lpCtlInfo->Type[0].szDescr, "Standard" );
  67.  
  68.          /* unlock data */
  69.          GlobalUnlock( hCtlInfo );
  70.  
  71.       } else {
  72.          GlobalFree( hCtlInfo );
  73.          hCtlInfo = NULL;
  74.       }
  75.  
  76.    }
  77.  
  78.    /* return final result */
  79.    return( hCtlInfo );
  80. }
  81.