home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / os2tk21j / c / samples / dllapi / dllapi.h__ / dllapi.h
Encoding:
C/C++ Source or Header  |  1993-03-12  |  11.3 KB  |  236 lines

  1. /*static char *SCCSID = "@(#)dllapi.h    6.13 92/02/18";*/
  2. /*==============================================================*\
  3.  *                                                              *
  4.  *  DLLAPI.H - DLL Sample PM application header file            *
  5.  *      (C) Copyright IBM Corporation 1992.                     *
  6.  *                                                              *
  7.  *--------------------------------------------------------------*
  8.  *                                                              *
  9.  *  This header file contains the application wide constants    *
  10.  *  and structure definitions.                                  *
  11.  *                                                              *
  12. \*==============================================================*/
  13. /*--------------------------------------------------------------*\
  14.  *  Include files, macros, defined constants, and externs       *
  15. \*--------------------------------------------------------------*/
  16. #define  INCL_WIN
  17. #define  INCL_HELP
  18. #define  INCL_WINDIALOGS            /* For dialog box functions */
  19. #define  INCL_WINMENU               /* For menu control function */
  20. #define  INCL_WINERRORS
  21. #define  INCL_GPI
  22. #define  INCL_DOSEXCEPTIONS         /* For exception management */
  23. #define  INCL_DOSPROCESS
  24. #define  INCL_DOSSIGNALS
  25. #define  INCL_DOSMISC
  26. #define  INCL_DOSMEMMGR             /* For memory management    */
  27. #define  INCL_DOSERRORS             /* For error code definition */
  28. #define  INCL_DOSNLS
  29. #include <os2.h>
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32. #include <string.h>
  33. #include "dllcomm.h"
  34.  
  35. /*--------------------------------------------------------------*\
  36.  * Resource IDs                                                 *
  37. \*--------------------------------------------------------------*/
  38. #define ID_RESOURCE                           1  /* resource identifier */
  39. #define ID_CHILDWIN                           2
  40. #define ID_NULL                               0
  41. #define IDR_BITMAP                            5
  42. #define IDC_BITMAP                            6
  43.  
  44. /*--------------------------------------------------------------*\
  45.  *  Menu item ids                                               *
  46. \*--------------------------------------------------------------*/
  47. #define IDM_HELPINDEX                       1010
  48. #define IDM_GENERALHELP                     1011
  49. #define IDM_TUTORIAL                        1012
  50. #define IDM_USINGHELP                       1013
  51. #define IDM_HELPPRODUCTINFO                 1014
  52.  
  53. #define IDM_MSGBOX                          1020
  54. #define IDM_VIEWSTRING                      1021
  55. #define IDM_SEARCH                          1022
  56. #define IDM_OPEN                            1023
  57. #define IDM_CALCUL                          1024
  58.  
  59. /*--------------------------------------------------------------*\
  60.  *  Help table and subtables                                    *
  61. \*--------------------------------------------------------------*/
  62. #define DLL_HELP_TABLE                      4000
  63.  
  64. /*--------------------------------------------------------------*\
  65.  *  Main window help panels                                     *
  66. \*--------------------------------------------------------------*/
  67. #define SUBTABLE_MAIN                       4100
  68. #define PANEL_MAIN                          4110
  69. #define PANEL_HELP                          4120
  70. #define PANEL_GENERALHELP                   4130
  71. #define PANEL_USINGHELP                     4140
  72. #define PANEL_TUTORIAL                      4150
  73. #define PANEL_HELPINDEX                     4160
  74. #define PANEL_HELPPRODUCTINFO               4170
  75. #define PANEL_KEYSHELP                      4180
  76.  
  77. #define PANEL_SEARCHHELP                    4190
  78. #define PANEL_OPENHELP                      4191
  79. #define PANEL_CALCULHELP                    4192
  80.  
  81. /*--------------------------------------------------------------*\
  82.  *  Enter text dialog help subtable                             *
  83. \*--------------------------------------------------------------*/
  84. #define SUBTABLE_PRODUCTINFODLG             4200
  85. #define PANEL_PRODUCTINFODLG                4210
  86. #define PANEL_PRODUCTINFO_OK                4220
  87.  
  88. #define SUBTABLE_OPENBOXDLG                 4230
  89. #define PANEL_OPENBOXDLG                    4231
  90. #define PANEL_OPENBOX_OK                    4232
  91.  
  92. #define SUBTABLE_CALCULBOXDLG               4235
  93. #define PANEL_CALCULBOXDLG                  4236
  94. #define PANEL_CALCULBOX_OK                  4237
  95.  
  96. /*--------------------------------------------------------------*\
  97.  *  Stringtable ids                                             *
  98. \*--------------------------------------------------------------*/
  99. #define IDS_APPNAME                          101
  100. #define IDS_HELPLIBRARYNAME                  102
  101. #define IDS_HELPWINDOWTITLE                  103
  102. #define IDS_TITLE                            104
  103. #define IDS_UNTITLED                         105
  104.  
  105. /*--------------------------------------------------------------*\
  106.  *  Message item ids
  107. \*--------------------------------------------------------------*/
  108. #define IDD_PRODUCTINFO                      152
  109. #define IDD_GETPATTERN                       153
  110. #define IDD_PATH                             154
  111. #define IDD_PATTERN                          155
  112. #define IDD_PATHTEXT                         156
  113. #define IDD_PATTERNTEXT                      157
  114. #define IDD_OPENFILE                         158
  115. #define IDD_DISPLAYTEXT                      159
  116. #define IDD_TEXT                             160
  117. #define IDD_GETMATHINFO                      170
  118. #define IDD_OPERAND1TEXT                     171
  119. #define IDD_OPERATIONTEXT                    172
  120. #define IDD_OPERAND2TEXT                     173
  121. #define IDD_OPERAND1                         174
  122. #define IDD_OPERATION                        175
  123. #define IDD_OPERAND2                         176
  124. #define IDD_DISPLAYVALUE                     177
  125. #define IDD_VALUE                            178
  126. #define IDD_DSPFILESTRUCT                    179
  127. #define IDD_ACCESSDIRT                       180
  128. #define IDD_ACCESSBACKUP                     190
  129.  
  130. /*--------------------------------------------------------------*\
  131.  *  Messagetable ids                                            *
  132. \*--------------------------------------------------------------*/
  133. #define IDMSG_INITFAILED                     301
  134. #define IDMSG_MAINWINCREATEFAILED            302
  135. #define IDMSG_CANNOTGETHPS                   303
  136. #define IDMSG_CANNOTLOADSTRING               304
  137. #define IDMSG_CANNOTLOADEXITLIST             305
  138. #define IDMSG_HELPLOADERROR                  306
  139. #define IDMSG_HELPDISPLAYERROR               307
  140. #define IDMSG_ERRORSETPATH                   308
  141. #define IDMSG_FILENOTFOUND                   309
  142. #define IDMSG_DRIVELOCKED                    310
  143. #define IDMSG_PATHNOTFOUND                   311
  144. #define IDMSG_BUFFEROVERFLOW                 312
  145. #define IDMSG_OPENFAILED                     313
  146. #define IDMSG_ACCESSGUARDPAGE                314
  147. #define IDMSG_COMMITTTOREAD                  315
  148. #define IDMSG_PROTECTIONERROR                316
  149. #define IDMSG_ERRORINVALIDDRIVE              317
  150. #define IDMSG_ACCESSDENIED                   318
  151. #define IDMSG_RETURNERROR                    319
  152. #define IDMSG_DSPTEXTERROR                   320
  153. #define IDMSG_DIVIDEZERO                     321
  154. #define IDMSG_ERROROPERAND                   322
  155. #define IDMSG_ERRORDIGIT                     323
  156.  
  157. /*--------------------------------------------------------------*\
  158.  *  Other constants                                             *
  159. \*--------------------------------------------------------------*/
  160. #define RETURN_SUCCESS            0      /* successful return in DosExit */
  161. #define RETURN_ERROR              1           /* error return in DosExit */
  162. #define BEEP_WARN_FREQ           60         /* frequency of warning beep */
  163. #define BEEP_WARN_DUR           100          /* duration of warning beep */
  164. #define MAXAPPNAMELEN            15
  165. #define HELPLIBRARYNAMELEN       20        /* The length of library name */
  166.  
  167. #define MAX_EDIT_BUFF            21    /* length of string to query size */
  168.  
  169. #define MAXTEXTLEN               40    /* maximum text length for window */
  170. #define MESSAGELEN              200       /* maximum length for messages */
  171. #define HORZ_INDENT              10
  172. #define VERT_TEXT_POS            15     /* from top to display text info */
  173.  
  174. /*--------------------------------------------------------------*\
  175.  *  Global variables                                            *
  176. \*--------------------------------------------------------------*/
  177. CHAR  szWindowText[MAXTEXTLEN];                  /* text drawn in window */
  178. HWND  hwndMainFrame;                  /* handle to the main frame window */
  179. HWND  hwndMain;                      /* handle to the main client window */
  180. HWND  hwndChild;                           /* handle to the child window */
  181. HAB   hab;                               /* anchor block for the process */
  182. HMQ   hmq;                       /* handle to the process' message queue */
  183. CHAR  szAppName[MAXAPPNAMELEN];    /* buffer for application name string */
  184. CHAR  szUntitled[MESSAGELEN];            /* buffer for "Untitled" string */
  185.       /* for help menu module */
  186. BOOL   fHelpEnabled;             /* flag to determine if help is enabled */
  187. static CHAR szLibName[HELPLIBRARYNAMELEN];
  188. static CHAR szWindowTitle[HELPLIBRARYNAMELEN];
  189. static HWND hwndHelpInstance;
  190.  
  191. OBJSTRUCT  ObjInfo;          /* Store Driver, Path & Pattern information */
  192. PFILELIST  pFindFile, pBackup, pFlList;           /* List of found files */
  193. SHORT      sStatus;                             /* Keep status of window */
  194. FILEINFO   FileInfo;                   /* Store file's text after opened */
  195. MATHELEMENT MathInfo;             /* Store calculator's element & result */
  196.  
  197. /*--------------------------------------------------------------*\
  198.  *  Entry point declarations                                    *
  199. \*--------------------------------------------------------------*/
  200. /* from dllapi.c */
  201. INT     main(VOID);
  202. MRESULT EXPENTRY MainWndProc(HWND, ULONG, MPARAM, MPARAM);
  203. VOID    MainCommand(HWND, MPARAM, MPARAM);
  204. VOID    MainPaint(HWND);
  205. VOID    MainControl(HWND, MPARAM, MPARAM);
  206. VOID    UserCommand(HWND, MPARAM, MPARAM);
  207. VOID    MessageBox(HWND, LONG, PSZ, LONG, BOOL);
  208. ULONG   GPFHandler(EXCEPTIONREPORTRECORD *,
  209.                    EXCEPTIONREGISTRATIONRECORD *,
  210.                    PCONTEXTRECORD,
  211.                    PVOID);
  212. /* from dlapi_dg.c */
  213. MRESULT EXPENTRY GetPatternDlgProc(HWND, ULONG, MPARAM, MPARAM);
  214. MRESULT EXPENTRY DispFileDlgProc (HWND, ULONG, MPARAM, MPARAM);
  215. VOID    DisplayFile (HWND, RECTL, PPFILELIST);
  216. MRESULT EXPENTRY OpenDlgProc(HWND, ULONG, MPARAM, MPARAM);
  217. MRESULT EXPENTRY DisplayDlgProc(HWND, ULONG, MPARAM, MPARAM);
  218. MRESULT EXPENTRY MathDlgProc(HWND, ULONG, MPARAM, MPARAM);
  219. MRESULT EXPENTRY ResultDlgProc(HWND, ULONG, MPARAM, MPARAM);
  220.  
  221. /* from dlapi_in.c */
  222. BOOL    Init(VOID);
  223. VOID APIENTRY ExitProc(ULONG);
  224.  
  225. /* from dlapi_hp.c */
  226. VOID    InitHelp(VOID);
  227. VOID    HelpHelpForHelp(MPARAM);
  228. VOID    HelpExtended(MPARAM);
  229. VOID    HelpKeys(MPARAM);
  230. VOID    HelpIndex(MPARAM);
  231. VOID    HelpAbout(MPARAM);
  232. VOID    DisplayHelpPanel(LONG);
  233. VOID    DestroyHelpInstance(VOID);
  234. VOID    FixSysMenu(HWND);
  235. MRESULT EXPENTRY AboutDlgProc(HWND, ULONG, MPARAM, MPARAM);
  236.