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

  1. /*
  2.  * Page Selection - INITIALIZATION 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 that registers the Page
  10.  * control window class.  When used within a dynamic-link library,
  11.  * this function is called when the library is first loaded.
  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. /* global variables */
  31. HANDLE      hPageInst;
  32.  
  33. /* */
  34.  
  35. /*
  36.  * PageInit( hInst ) : BOOL;
  37.  *
  38.  *    hInst       handle to dll instance
  39.  *
  40.  * This function registers the control class and saves the dll
  41.  * instance handle, if necessary.  Note that this function always
  42.  * returns TRUE, regardless of teh success or failure of the
  43.  * RegisterClass function.
  44.  *
  45.  */
  46.  
  47. BOOL FAR PASCAL PageInit(
  48.    HANDLE      hInst )
  49. {
  50.    WNDCLASS    WndClass;
  51.  
  52.    /* register slider class if not already registered */
  53.    if ( hPageInst == NULL ) {
  54.  
  55.       /* define slider class structure */
  56.       WndClass.lpszClassName =   PAGE_NAME;
  57.       WndClass.hCursor =         LoadCursor( NULL, IDC_ARROW );
  58.       WndClass.lpszMenuName =    NULL;
  59.       WndClass.style =           PAGE_CLASSSTYLE;
  60.       WndClass.lpfnWndProc =     PageWndFn;
  61.       WndClass.hInstance =       hInst;
  62.       WndClass.hIcon =           NULL;
  63.       WndClass.cbWndExtra =      PAGE_WNDEXTRA;
  64.       WndClass.hbrBackground =   (HBRUSH)(PAGE_COLOR);
  65.       WndClass.cbClsExtra =      PAGE_CLASSEXTRA;
  66.  
  67.       /* register slider window class */
  68.       RegisterClass( &WndClass );
  69.  
  70.       /* save results */
  71.       hPageInst = hInst;
  72.  
  73.    } 
  74.  
  75.    /* return final result */
  76.    return( TRUE );
  77.  
  78. }
  79.  
  80. /* */
  81.  
  82. /*
  83.  * WEP( wValue ) : WORD;
  84.  *
  85.  *        wValue        system exit value
  86.  *
  87.  * This function is called when the DLL is unloaded by the system.
  88.  * It enables the library to perform any cleanup necessary.
  89.  *
  90.  */
  91.  
  92. WORD FAR PASCAL WEP(
  93.     WORD        wValue )
  94. {
  95.     WORD        wResult;
  96.  
  97.     /* process exit value */
  98.     switch( wValue )
  99.         {
  100.     case WEP_FREE_DLL : /* DLL is being released */
  101.     case WEP_SYSTEM_EXIT : /* system is being shut down */
  102.     default :
  103.         wResult = 1;
  104.         break;
  105.     }
  106.  
  107.     /* return result */
  108.     return( wResult );
  109.  
  110. }
  111.