home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CNRBAS.ZIP / CNRBASE.H < prev    next >
Text File  |  1993-01-01  |  6KB  |  132 lines

  1. /*********************************************************************
  2.  *                                                                   *
  3.  * MODULE NAME :  cnrbase.h              AUTHOR:  Rick Fishman       *
  4.  * DATE WRITTEN:  10-09-92                                           *
  5.  *                                                                   *
  6.  * DESCRIPTION:                                                      *
  7.  *                                                                   *
  8.  *  Common definitions and function prototypes for CNRBASE.EXE       *
  9.  *                                                                   *
  10.  * HISTORY:                                                          *
  11.  *                                                                   *
  12.  *  10-09-92 - File Created                                          *
  13.  *  01-01-93   Took out pszFileName and hptrIcon from CNRITEM -      *
  14.  *               will use the fields in the MINIRECORDCORE struct.   *
  15.  *             Added fTrue to satisfy new C Set/2++ compiler in      *
  16.  *               while( fTrue ) statements. The new compiler does    *
  17.  *               not allow while( TRUE ) or for( ; ; ) statements.   *
  18.  *                                                                   *
  19.  *  Rick Fishman                                                     *
  20.  *  Code Blazers, Inc.                                               *
  21.  *  4113 Apricot                                                     *
  22.  *  Irvine, CA. 92720                                                *
  23.  *  CIS ID: 72251,750                                                *
  24.  *                                                                   *
  25.  *********************************************************************/
  26.  
  27. /*********************************************************************/
  28. /*------------------- APPLICATION DEFINITIONS -----------------------*/
  29. /*********************************************************************/
  30.  
  31. #define ID_FIRST_DIRWINDOW  1         // Id of first Directory frame window
  32.  
  33. #define ID_RESOURCES        1         // Id of frame wnd resources in .RC file
  34.  
  35. #define CNR_DIRECTORY       30        // The start of our show
  36.  
  37. #define IDM_ICON            1101      // Menu options
  38. #define IDM_NAME            1102
  39. #define IDM_TREE            1103
  40. #define IDM_DETAILS         1104
  41. #define IDM_TEXT            1105
  42.  
  43. #define UM_CONTAINER_FILLED WM_USER   // Posted by Fill thread to primary thread
  44.  
  45. #define DEBUG_FILENAME      "cnrbase.dbg"
  46.  
  47. #define DIRECTORY_WINCLASS  "CnrBaseSample"
  48.  
  49. #define PROGRAM_TITLE       "CNRBASE Container Sample"
  50.  
  51. #define HABERR( hab )       (ERRORIDERROR( WinGetLastError( hab ) ))
  52.  
  53. #define ANCHOR( hwnd )      (WinQueryAnchorBlock( hwnd ))
  54.  
  55. #define HWNDERR( hwnd )      \
  56.             (ERRORIDERROR( WinGetLastError( WinQueryAnchorBlock( hwnd ) ) ))
  57.  
  58. #define INSTDATA( hwnd )     (WinQueryWindowPtr( hwnd, 0 ))
  59.  
  60. #define PARENT( hwnd )       (WinQueryWindow( hwnd, QW_PARENT ))
  61.  
  62. #define GRANDPARENT( hwnd )  (WinQueryWindow( WinQueryWindow(hwnd, QW_PARENT)))
  63.  
  64. /**********************************************************************/
  65. /*---------------------------- STRUCTURES ----------------------------*/
  66. /**********************************************************************/
  67.  
  68. typedef struct _CNRITEM               // CONTAINER RECORD STRUCTURE
  69. {
  70.   MINIRECORDCORE rc;                  // Base information
  71.   CDATE          date;                // Date of file
  72.   CTIME          time;                // Time of file
  73.   ULONG          cbFile;              // File size
  74.   CHAR           szFileName[CCHMAXPATH + 1]; // File name
  75.   ULONG          attrFile;            // Attributes of this file
  76.  
  77. } CNRITEM, *PCNRITEM;
  78.  
  79. #define EXTRA_RECORD_BYTES (sizeof( CNRITEM ) - sizeof( MINIRECORDCORE ))
  80.  
  81.  
  82. typedef struct _INSTANCE              // CONTAINER'S CLIENT WINDOW INSTANCE DATA
  83. {
  84.     BOOL fShutdown;                     // Main thread wants to shut down
  85.     BOOL fContainerFilled;              // Fill thread has completed
  86.     CHAR szCnrTitle[ CCHMAXPATH + 20 ]; // Container title
  87.     CHAR szDirectory[ CCHMAXPATH + 1 ]; // Directory being displayed
  88.  
  89. } INSTANCE, *PINSTANCE;
  90.  
  91.  
  92. typedef struct _THREADPARMS          // PARAMETERS TO PASS TO SECONDARY THREAD
  93. {
  94.     HWND hwndClient;                 // Client window handle
  95.  
  96. } THREADPARMS, *PTHREADPARMS;
  97.  
  98. /**********************************************************************/
  99. /*----------------------- FUNCTION PROTOTYPES ------------------------*/
  100. /**********************************************************************/
  101.  
  102. // In common.c
  103.  
  104. VOID SetWindowTitle( HWND hwndClient, PSZ szFormat, ... );
  105. VOID Msg( PSZ szFormat, ... );
  106.  
  107. // In create.c
  108.  
  109. HWND CreateDirectoryWin( PSZ szDirectory );
  110. HWND CreateContainer( HWND hwndClient, PSZ szDirectory );
  111.  
  112. // In populate.c
  113.  
  114. VOID PopulateContainer( PVOID pThreadParms );
  115.  
  116. /**********************************************************************/
  117. /*------------------------ GLOBAL VARIABLES --------------------------*/
  118. /**********************************************************************/
  119.  
  120. #ifdef GLOBALS_DEFINED
  121. #  define DATADEF
  122. #else
  123. #  define DATADEF extern
  124. #endif
  125.  
  126. DATADEF INT iWinCount;           // Number of directory windows created
  127. DATADEF BOOL fTrue;              // Used for while( fTrue ) to satisfy CSet2++
  128.  
  129. /***********************************************************************
  130.  *                   E N D     O F     S O U R C E                     *
  131.  **********************************************************************/
  132.