home *** CD-ROM | disk | FTP | other *** search
/ Computer Select (Limited Edition) / Computer Select.iso / msj / v07n03 / toolhelp.exe / TASKMSTR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-01  |  4.2 KB  |  129 lines

  1. /*-------------------------------------------------------------*\
  2.  |  TASKMSTR.H:  Include file for TASKMSTR.EXE.                |
  3. \*-------------------------------------------------------------*/
  4.  
  5. //  Application metric values.
  6. //
  7. typedef struct tagAPPMETRICS
  8.     {
  9.     int sm_cxBorder;        // System metric values.
  10.     int sm_cyBorder;
  11.     int tx_cyLine;          // Text metric values.
  12.     int tx_xMargin;
  13.     int tx_yMargin;
  14.     int tx_xIconMargin;
  15.     int tx_xTaskText;       // (x, y) origin for task bar...
  16.     int tx_yTaskText;       // ...graph titles.
  17.     int tx_xModuleText;     // (x, y) origin for module bar...
  18.     int tx_yModuleText;     // ...graph titles.
  19.     int win_xMinTracking;   // Minimum window tracking size.
  20.     int win_yMinTracking;
  21.     int win_cxInit;         // Initial window size.
  22.     int win_cyInit;
  23.     int bar_cyHeight;
  24.     int lbTask_cyHeight;    // Task listbox item height.
  25.     int lbModule_cyHeight;  // Module listbox item height;
  26.     int xIcon;              // Icon placement info.
  27.     int yIcon;
  28.     }  APPMETRICS;
  29.  
  30. //  Application color values.
  31. //
  32. typedef struct tagAPPCOLORS
  33.     {
  34.     int   cColors;
  35.     DWORD rgbForeSelect;
  36.     DWORD rgbBackSelect;
  37.     DWORD rgbBlack;
  38.     DWORD rgbSolidColors[10];
  39.     }  APPCOLORS;
  40.  
  41. //  Application constants.
  42. //
  43. #define BUFSIZE 256
  44. #define SEG_INIT_COUNT 200
  45.  
  46.  
  47. //  Error handling defines.
  48. //
  49. #define STR_ERRBASE     (100)
  50. #define ERR_OK            (0)
  51. #define ERR_MISSING      ( 1)
  52. #define ERR_OUTOFMEMORY  ( 2)
  53. #define ERR_GLOBALINFO   ( 3)
  54. #define ERR_MODULELIST   ( 4)
  55. #define ERR_TASKLIST     ( 5)
  56.  
  57.  
  58. //  Application-specific messages.
  59. //
  60. #define AM_ERROR            (WM_USER + 1)
  61. #define AM_BUILDTASKLIST    (WM_USER + 2)
  62.  
  63. //  Task List information.
  64. #define WINTEXTLEN 64
  65.  
  66. typedef struct tagTASKLIST
  67.     {
  68.     TASKENTRY taskentry;
  69.     DWORD     dwDGroup;
  70.     DWORD     dwGlobal;
  71.     char      achWindowText[WINTEXTLEN + 1];
  72.     HICON     hIcon;
  73.     } TASKLIST;
  74.  
  75. typedef TASKLIST FAR * LPTASKLIST;
  76.  
  77.  
  78. // Retry for matching segment buffer size to
  79. // actual count of segments in system.
  80. //
  81. #define RETRY_SEGALLOC 3
  82. #define SEG_EXTRA      2   //  Extra space for segment shifting.
  83.  
  84.  
  85. // Create windowsx.h type of macro
  86. #define GlobalSizePtr(lp) \
  87.         (GlobalSize((GlobalPtrHandle(lp))))
  88.  
  89.  
  90. // Control IDs for listboxes.
  91. #define IDL_TASK      (1)
  92. #define IDL_MODULE    (2)
  93.  
  94. #define SEGTYPE_COUNT (7)  //  Count of segment types.
  95.  
  96. /*-------------------------------------------------------------*\
  97.  |                    Function Prototypes.                     |
  98. \*-------------------------------------------------------------*/
  99. long FAR  PASCAL TaskMstrWndProc (HWND, UINT, WPARAM, LPARAM);
  100. void FAR  PASCAL trBuildSegmentList (void);
  101. void FAR  PASCAL trBuildTaskList(void);
  102. void NEAR PASCAL trCalcTaskList(void);
  103. void NEAR PASCAL trCalcSegmentList(void);
  104. void NEAR PASCAL trFillTaskListbox(HWND hwndTask);
  105. void NEAR PASCAL trFillSegmentListbox(void);
  106. void FAR  PASCAL trInitMetrics(HDC hdc);
  107. void FAR  PASCAL trInitColors(void);
  108. BOOL FAR  PASCAL _export trToolHelpNotify (WORD wID, DWORD dwData);
  109. VOID NEAR PASCAL trDrawTaskItems (const DRAWITEMSTRUCT FAR*  lpdraw);
  110. VOID NEAR PASCAL trDrawModuleItems (const DRAWITEMSTRUCT FAR*  lpdraw);
  111.  
  112. VOID NEAR PASCAL trMain_OnCommand(HWND hwnd, int id, HWND hwndCtl,
  113.                                   UINT codeNotify);
  114. BOOL NEAR PASCAL trMain_OnCreate(HWND hwnd,
  115.                                  CREATESTRUCT FAR* lpCreateStruct);
  116. VOID NEAR PASCAL trMain_OnDestroy (HWND hwnd);
  117. VOID NEAR PASCAL trMain_OnDrawItem(HWND hwnd,
  118.                                    const DRAWITEMSTRUCT FAR* lpDrawItem);
  119.  
  120. VOID NEAR PASCAL trMain_GetMinMaxInfo(HWND hwnd,
  121.                                       MINMAXINFO FAR* lpMinMaxInfo);
  122. VOID NEAR PASCAL trMain_MeasureItem(HWND hwnd,
  123.                                     MEASUREITEMSTRUCT FAR* lpMeasureItem);
  124. VOID NEAR PASCAL trMain_Size(HWND hwnd, UINT state, int cx, int cy);
  125. VOID NEAR PASCAL trMain_SetFocus(HWND hwnd, HWND hwndOldFocus);
  126. VOID NEAR PASCAL trMain_Timer(HWND hwnd, UINT id);
  127. VOID NEAR PASCAL trMain_BuildTaskList(void);
  128. VOID NEAR PASCAL trMain_Error(HWND hwnd, WORD error);
  129.