home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / p / pc2.zip / SOURCE.ZIP / SOURCE / PC2.H < prev    next >
Text File  |  1993-03-09  |  11KB  |  234 lines

  1. /***********************************************************************\
  2.  *                                PC2.c                                *
  3.  *                 Copyright (C) by Stangl Roman, 1993                 *
  4.  * This Code may be freely distributed, provided the Copyright isn't   *
  5.  * removed, under the conditions indicated in the documentation.       *
  6.  *                                                                     *
  7.  * PC2.h        Program Commander/2 header file.                       *
  8.  *                                                                     *
  9. \***********************************************************************/
  10.  
  11. #ifndef IPFC                            /* Don't include if we compile HLP files */
  12. #define         INCL_WINDIALOGS         /* Environment include files */
  13. #define         INCL_WIN
  14. #define         INCL_DOSFILEMGR
  15. #define         INCL_DOSSESMGR
  16. #define         INCL_DOSPROCESS
  17. #define         INCL_DOSERRORS
  18. #define         INCL_DOSSEMAPHORES
  19. #define         INCL_DOSMODULEMGR
  20. #include        <os2.h>
  21.  
  22. #include        <stdio.h>               /* C Set/2 include files */
  23. #include        <stdlib.h>
  24. #include        <string.h>
  25. #include        <ctype.h>
  26. #endif
  27.  
  28. #define         EF_SIZE60       60
  29. #define         EF_SIZE255      255
  30.  
  31. typedef void (EXPENTRY PFFUNCPTR1)(HWND hD, HWND hP);
  32. typedef BOOL (EXPENTRY PFFUNCPTR2)(HAB hab, PQMSG pqmsg, ULONG option);
  33. typedef struct _SESSIONDATA     SESSIONDATA;
  34. typedef struct _MENUDATA        MENUDATA;
  35.  
  36. #define         ENTRYSUBMENU    0
  37. #define         ENTRYMENUITEM   1
  38. #define         ENTRYEMPTY      2
  39.  
  40. struct _SESSIONDATA                     /* Control structure to start a new session */
  41. {
  42. ULONG           id;                     /* Session ID for menu ressources */
  43. UCHAR           PgmTitle[EF_SIZE60+1];  /* Session title */
  44. UCHAR           PgmName[EF_SIZE255+1];  /* Session path and filename */
  45.                                         /* Session working directory */
  46. UCHAR           PgmDirectory[EF_SIZE255+1];
  47.                                         /* Session parameter */
  48. UCHAR           PgmInputs[EF_SIZE255+1];
  49. UCHAR           PgmDosSettings[2049];   /* DOS Settings for DOS sessions */
  50. USHORT          SessionType;            /* Session type */
  51. USHORT          PgmControl;             /* Session control */
  52. USHORT          FgBg;                   /* Start session in foreground/background */
  53. USHORT          InitXPos;               /* X position */
  54. USHORT          InitYPos;               /* Y position */
  55. USHORT          InitXSize;              /* X size */
  56. USHORT          InitYSize;              /* Y size */
  57. ULONG           PriorityClass;          /* Priority of started session */
  58. LONG            PriorityDelta;          /* Delta priority of started session */
  59. };
  60.  
  61. struct _MENUDATA                        /* Control structure to build popup menu */
  62. {
  63. USHORT          Item;                   /* MENUITEM or SUBMENU */
  64. HWND            hwndItem;               /* Window handle within Popup-Menu */
  65. ULONG           id;                     /* Session ID for menu ressources */
  66. PSZ             PgmTitle;               /* Session title */
  67. PSZ             PgmName;                /* Session path and filename */
  68. PSZ             PgmDirectory;           /* Session working directory */
  69. PSZ             PgmInputs;              /* Session parameter */
  70. PSZ             PgmDosSettings;         /* Session settings for DOS applications */
  71. USHORT          SessionType;            /* Session type */
  72. USHORT          PgmControl;             /* Session control */
  73. USHORT          FgBg;                   /* Start session in foreground/background */
  74. USHORT          InitXPos;               /* X position */
  75. USHORT          InitYPos;               /* Y position */
  76. USHORT          InitXSize;              /* X size */
  77. USHORT          InitYSize;              /* Y size */
  78. ULONG           PriorityClass;          /* Priority of started session */
  79. LONG            PriorityDelta;          /* Delta priority of started session */
  80. MENUDATA        *Back;                  /* Pointer to previous menu */
  81. MENUDATA        *Submenu;               /* Pointer to a submenu */
  82. MENUDATA        *Next;                  /* Pointer to next menu */
  83. };
  84.  
  85. #define ID_PC2MAINWINDOW        256
  86. #define ID_OS2LOGO              257
  87.  
  88. #define PC2_CLASSNAME           "PC2"
  89.  
  90. #define ID_PC2SETUP             300     /* Defines for PopUp Menu, that is popped up after
  91.                                            the user presses mouse button 1 on DESKTOP */
  92. #define ID_CONFIGDIALOG         301     /* User pressed Configure PC/2 */
  93. #define ID_ABOUTDIALOG          302     /* User pressed About PC/2 */
  94. #define ID_EXIT                 303     /* User pressed F3 to exit PC/2 */
  95.  
  96. #define PIID_PROGRAMDIALOG      500     /* Program installation dialog */
  97. #define PIGRP_PROGRAM           501     /* Program data group */
  98. #define PIEF_PROGRAMTITLE       502
  99. #define PIEF_PATHFILENAME       503
  100. #define PIEF_DIRECTORY          504
  101. #define PIEF_PARAMETERS         505
  102. #define PIEF_DOSSETTINGS        506
  103. #define PIPB_WINFILEDLG         507
  104.  
  105. #define PIGRP_TYPE              510     /* Program type group */
  106. #define PIRB_SHELL              511
  107. #define PIRB_OS2FULLSCREEN      512
  108. #define PIRB_OS2WINDOW          513
  109. #define PIRB_PM                 514
  110. #define PIRB_DOSFULLSCREEN      515
  111. #define PIRB_DOSWINDOW          516
  112.  
  113. #define PIGRP_STYLE             520     /* Program style group */
  114. #define PIRB_DEFAULTSTYLE       521
  115. #define PIRB_MAXIMIZED          522
  116. #define PIRB_MINIMIZED          523
  117. #define PIRB_SIZEPOSITION       524
  118. #define PIRB_INVISIBLE          525
  119. #define PIRB_NOAUTOCLOSE        526
  120. #define PIRB_BACKGROUND         527
  121.  
  122. #define PIGRP_SIZEPOSITION      530     /* User defined size & position */
  123. #define PIEF_X                  531
  124. #define PIEF_Y                  532
  125. #define PIEF_XSIZE              533
  126. #define PIEF_YSIZE              534
  127.  
  128. #define PIGRP_PROCESSPRIORITY   540     /* Process priority */
  129. #define PIRB_IDLETIME           541
  130. #define PIRB_REGULAR            542
  131. #define PIRB_NOCHANGE           543
  132. #define PIRB_TIMECRITICAL       544
  133. #define PIRB_FOREGROUNDSERVER   545
  134. #define PILB_DELTAPRIORITY      546
  135. #define PICB_CHILDPROCESS       547
  136.  
  137. #define PIID_HELP_1             550     /* Help pages */
  138. #define PIID_HELP_2             551
  139. #define PIID_HELP_3             552
  140. #define PIID_HELP_4             553
  141. #define PIID_HELP_5             554
  142. #define PIID_HELP_6             555
  143.  
  144. #define ADID_ABOUTDIALOG        600     /* About program dialog */
  145.  
  146. #define CDID_CONFIGDIALOG       700     /* Configuration menu dialog */
  147. #define CDGRP_PROGRAM           701     /* Submenu/Program installation group */
  148. #define CDLB_MENUPROGRAM        702
  149. #define CDID_LEVELUP            703
  150. #define CDID_LEVELDOWN          704
  151. #define CDID_ADDMENU            705
  152. #define CDID_ADDPROGRAM         706
  153. #define CDID_CHANGEENTRY        707
  154. #define CDID_REMOVEENTRY        708
  155.  
  156. #define CDID_HELP_1             710     /* Help pages */
  157. #define CDID_HELP_2             711
  158.  
  159. #define MIID_MENUDIALOG         800     /* Menu installation dialog */
  160. #define MIGRP_PROGRAM           801     /* Menu data group */
  161. #define MIEF_MENUTITLE          802
  162.  
  163. #define MIID_HELP_1             810     /* Help pages */
  164.  
  165. #define ID_POPUPMENU            1000    /* ID used by first user entered entry in the
  166.                                            popup menu. It is incremented by 1 by tracing
  167.                                            through the linked list for each entry (submenu
  168.                                            or menuitem). */
  169. #define USERITEMFIRST           ID_POPUPMENU
  170. #define USERITEMLAST            ID_POPUPMENU+100
  171.  
  172. #define ID_HELP                 2000    /* ID used for HELP panels */
  173. #define MAIN_HELP_TABLE         2001
  174. #define MAIN_HELP_SUBTABLE      2002
  175. #define ID_GENERALHELP          2003
  176. #define ID_CONCEPTSHELP         2004
  177. #define ID_USINGHELP            2005
  178. #define ID_ERRORHELP            2006
  179. #define ID_ERRORHELP_1          2007
  180. #define ID_INSTALLATIONHELP     2008
  181.  
  182.                                         /* New messages for the configuration menu dialog */
  183.                                         /* Load the current level into configuration listbox */
  184. #define WM_LOADPOPUPMENU        WM_USER+1
  185.                                         /* Initialize the input queue hook */
  186. #define WM_LOADHOOK             WM_USER+2
  187.                                         /* Save Popup-Menu to Profile */
  188. #define WM_SAVEPOPUPMENU        WM_USER+3
  189.                                         /* Load Popup-Menu from Profile */
  190. #define WM_SETPOPUPMENU         WM_USER+4
  191.                                         /* Display Popup-Menu on Desktop */
  192. #define WM_POPUPMENU            WM_USER+5
  193.  
  194.                                         /* Insert an item to the linked list */
  195. #define MM_INSERTITEMMENUITEM   WM_USER+6
  196.                                         /* Change the first item of a Submenu to an item */
  197. #define MM_INSERTITEMSUBMENU    WM_USER+7
  198.  
  199.                                         /* Procedures */
  200. extern int      main(int argc, char *argv[], char *envp[]);
  201. extern BOOL     WinStartUp(HAB *pHab, HMQ *pHmq);
  202. extern BOOL     WinStartHelp(HAB hab, HWND *pHwndHelp);
  203. extern BOOL     WinCloseDown(HWND *pHwndHelp, HAB *pHab, HMQ *pHmq);
  204. extern void     StartSession(SESSIONDATA *SessionData);
  205. extern BOOL     SetPriority(PSZ pszProcess, ULONG PriorityClass, LONG PriorityDelta);
  206. extern BOOL     LoadMenuData2SessionData(BOOL Empty, MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  207. extern BOOL     LoadSessionData2MenuData(MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  208. extern MENUDATA *AllocateMenuData(void);
  209. extern void     LoadMenu(MENUDATA *pMenuData);
  210. extern void     SaveMenu(MENUDATA *pMenuData);
  211. extern BOOL     SetPopupMenu(MENUDATA *pMD, ULONG msg, LONG id);
  212. extern MENUDATA *SearchItem(MENUDATA *pMD, ULONG *id);
  213.  
  214.                                         /* Window procedures */
  215. extern MRESULT  EXPENTRY PC2_MainWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  216. extern MRESULT  EXPENTRY PI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  217. extern MRESULT  EXPENTRY AD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  218. extern MRESULT  EXPENTRY MI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  219. extern MRESULT  EXPENTRY CD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  220.  
  221. extern HAB              hab;            /* Handle of PM anchor block */
  222. extern HMQ              hmq;            /* Handle of message queue */
  223. extern HWND             hwndFrame;
  224. extern HWND             hwndClient;
  225. extern HWND             hwndPopupMenu;  /* Handel of popup menu window */
  226. extern HWND             hwndHelp;
  227. extern SESSIONDATA      SessionData;
  228. extern MENUDATA         *pPopupMenu;    /* First entry of linked list of menus */
  229. extern USHORT           DialogResult;   /* Result of last dialog */
  230. extern USHORT           MenuDataId;     /* Id of the items in the Popup-Menu and linked list */
  231. extern FILE             *Pc2Profile;    /* Profile filename */
  232. extern SWP              swpScreen;      /* The screen dimensions */
  233.  
  234.