home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1995 November / PCWK1195.iso / inne / podstawy / os2 / nakladki / pc2v190.exe / SOURCE.ZIP / Source / PC2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-01  |  59.7 KB  |  1,009 lines

  1. /***********************************************************************\
  2.  *                                PC2.c                                *
  3.  *           Copyright (C) by Stangl Roman, 1993, 1994, 1995           *
  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_WIN                /* Environment include files */
  13. #define         INCL_GPI
  14. #define         INCL_DOS
  15. #define         INCL_DOSERRORS
  16. #define         INCL_DOSPROCESS
  17. #include        <os2.h>
  18.  
  19. #include        <stdio.h>               /* C Set++ include files */
  20. #include        <stdlib.h>
  21. #include        <string.h>
  22. #include        <ctype.h>
  23. #include        <memory.h>
  24. #endif /* IPFC */
  25.  
  26. /*                                                                     *\
  27.  * Because the dialog editor takes the first macro definition of mul-  *
  28.  * tiple definitions of the same value, we have to put the dialog      *
  29.  + controls definition first.                                          *
  30. \*                                                                     */
  31.  
  32. #define PIID_PROGRAMDIALOG      400     /* Program installation notebook dialog */
  33. #define PINB_NOTEBOOK           401
  34.  
  35. #define PIID_PAGE1              402     /* First notebook page */
  36. #define PIGRP_PROGRAM           403     /* Program data group */
  37. #define PIEF_PROGRAMTITLE       404
  38. #define PIEF_PATHFILENAME       405
  39. #define PIEF_DIRECTORY          406
  40. #define PIEF_PARAMETERS         407
  41. #define PIMLE_DOSSETTINGS       408
  42. #define PIPB_WINFILEDLG         409
  43. #define PIPB_SETTINGSDLG        410
  44.  
  45. #define PIID_PAGE2              420     /* Second notebook page */
  46. #define PIGRP_TYPE              421     /* Program type group */
  47. #define PIRB_SHELL              422
  48. #define PIRB_OS2FULLSCREEN      423
  49. #define PIRB_OS2WINDOW          424
  50. #define PIRB_PM                 425
  51. #define PIRB_DOSFULLSCREEN      426
  52. #define PIRB_DOSWINDOW          427
  53. #define PIRB_WPSOBJECT          428
  54. #define PIRB_WINOS2             429
  55.  
  56. #define PIGRP_WINOS2            440     /* Seamless WIN-OS2 settings */
  57. #define PIRB_WINREAL            441
  58. #define PIRB_WINSTANDARD        442
  59. #define PIRB_WIN386ENHANCED     443
  60. #define PICB_WINSEPARATE        444
  61.  
  62. #define PIID_PAGE3              460     /* Third notebook page */
  63. #define PIGRP_STYLE             461     /* Program style group */
  64. #define PIRB_DEFAULTSTYLE       462
  65. #define PIRB_MAXIMIZED          463
  66. #define PIRB_MINIMIZED          464
  67. #define PICB_INVISIBLE          465
  68. #define PICB_NOAUTOCLOSE        466
  69. #define PICB_BACKGROUND         467
  70. #define PICB_AUTOSTART          468
  71. #define PIGRP_SIZEPOSITION      469     /* User defined size & position */
  72. #define PICB_SIZEPOSITION       460
  73. #define PIEF_X                  471
  74. #define PIEF_Y                  472
  75. #define PIEF_XSIZE              473
  76. #define PIEF_YSIZE              474
  77.  
  78. #define PIID_PAGE4              480     /* Forth notebook page */
  79. #define PIGRP_HOTKEY            481     /* Hotkey settings group */
  80. #define PIEF_SESSIONTITLE       482
  81. #define PICB_HOTKEYENABLED      483
  82. #define PIRB_WSMAXIMIZED        484
  83. #define PIRB_WSRESTORE          485
  84. #define PIRB_NONE               486
  85. #define PIRB_CTRL               487
  86. #define PIRB_ALT                488
  87. #define PICBX_HOTKEY            489
  88. #define PIGRP_DESKTOP           490
  89. #define PICB_DONTMOVE           491
  90. #define PIGRP_WINDOWLIST        492
  91. #define PILB_WINDOWLIST         493
  92.  
  93. #define PIID_PAGE5              500     /* Fifth notebook page */
  94. #define PIGRP_PROCESSPRIORITY   501     /* Process priority */
  95. #define PIRB_IDLETIME           502
  96. #define PIRB_REGULAR            503
  97. #define PIRB_NOCHANGE           504
  98. #define PIRB_TIMECRITICAL       505
  99. #define PIRB_FOREGROUNDSERVER   506
  100. #define PIEF_PRIORITYDELTA      507
  101. #define PIHSB_PRIORITYDELTA     508
  102.  
  103. #define PIID_PAGE6              510     /* Sixth notebook page */
  104. #define PIGRP_ENVIRONMENT       511     /* Process environment */
  105. #define PIMLE_ENVIRONMENT       512     /* Additions/Replacement of PC/2's environment for
  106.                                            the started session */
  107.  
  108. #define PIID_EXAMPLE1           540
  109. #define PIID_EXAMPLE2           541
  110. #define PIID_EXAMPLE3           542
  111. #define PIID_EXAMPLE4           543
  112. #define PIID_EXAMPLE5           544
  113.  
  114. #define ADID_ABOUTDIALOG        550     /* About program dialog */
  115.  
  116. #define DDID_DESKTOPDIALOG      600     /* Desktop configuration dialog */
  117. #define DDNB_NOTEBOOK           601
  118.  
  119. #define DDID_PAGE1              620     /* First notebook page */
  120. #define DDGRP_VIRTUALDESKTOP    621
  121. #define DDCB_VIRTUALDESKTOP     622
  122. #define DDCB_MOVEDESKTOP        623
  123. #define DDCB_EXPANDWPS          624
  124. #define DDCB_CLICK2MOVE         625
  125. #define DDCB_OVERVIEW           626
  126. #define DDSB_HORIZONTALDESKTOPS 627
  127. #define DDSB_VERTICALDESKTOPS   628
  128. #define DDEF_SCROLLPERCENTAGE   629
  129. #define DDHSB_SCROLLPERCENTAGE  630
  130. #define DDGRP_POPUP             631
  131. #define DDRB_BUTTON1CLICK       632
  132. #define DDRB_BUTTON1DBLCLK      633
  133. #define DDCB_SELECTFIRSTITEM    634
  134. #define DDGRP_SLIDINGFOCUS      635
  135. #define DDCB_SLIDINGFOCUS       636
  136. #define DDCB_PRESERVEZORDER     637
  137. #define DDGRP_OVERVIEWWINDOW    638
  138. #define DDCB_HIDETITLEBAR       639
  139. #define DDCB_HIDESMARTICONBAR   640
  140.  
  141. #define DDID_PAGE2              650     /* Second notebook page */
  142. #define DDGRP_PHYSICALDESKTOP   651
  143. #define DDCB_BUTTON2ZORDER      652
  144. #define DDCB_KEEPONTOP          653
  145. #define DDCB_USESPOOLER         654
  146. #define DDEF_DESKTOPNAME        655
  147. #define DDEF_WINDOWLISTNAME     656
  148. #define DDGRP_BACKGROUNDBITMAP  657
  149. #define DDCB_BACKGROUNDBITMAP   658
  150. #define DDEF_BACKGROUNDBITMAP   659
  151. #define DDPB_WINFILEDLG         660
  152. #define DDRB_BITMAPNORMAL       661
  153. #define DDRB_BITMAPSCALED       662
  154. #define DDRB_BITMAPTILED        663
  155. #define DDSB_BITMAPTILEDCOUNT   664
  156.  
  157. #define DDID_PAGE3              680
  158. #define DDGRP_GENERAL           681
  159. #define DDCB_NORMALSHUTDOWN     682
  160. #define DDCB_IGNOREAUTOSTART    683
  161. #define DDCB_HOTKEY4PC2ONLY     684
  162.  
  163. #define CDID_CONFIGDIALOG       700     /* Configuration menu dialog */
  164. #define CDGRP_PROGRAM           701     /* Submenu/Program installation group */
  165. #define CDLB_MENUPROGRAM        702
  166. #define CDID_LEVELUP            703
  167. #define CDID_LEVELDOWN          704
  168. #define CDID_ADDMENU            705
  169. #define CDID_ADDPROGRAM         706
  170. #define CDID_CHANGEENTRY        707
  171. #define CDID_REMOVEENTRY        708
  172. #define CDID_RESORT             709
  173. #define CDID_ADDCONTROL         710
  174.  
  175. #define CDID_HELP_1             711     /* Help pages */
  176. #define CDID_HELP_2             712
  177.  
  178. #define RDID_RESORTDIALOG       750     /* Resort menuentries dialog */
  179. #define RDPB_MOVE               751     /* Move pushbutton */
  180. #define RDGRP_SOURCEMENU        755     /* Move from menu */
  181. #define RDLB_SOURCEMENU         756
  182. #define RDGRP_DESTINATIONMENU   760     /* Move into menu */
  183. #define RDLB_DESTINATIONMENU    761
  184.  
  185. #define MIID_MENUDIALOG         800     /* Menu installation dialog */
  186. #define MIGRP_PROGRAM           801     /* Menu data group */
  187. #define MIEF_MENUTITLE          802
  188.  
  189. #define MIID_HELP_1             810     /* Help page */
  190.  
  191. #define MDID_CONTROLDIALOG      850     /* PC/2 Menu-Control dialog */
  192. #define MDGRP_CTRL              851
  193. #define MDRB_CTRL_CONFIGMENU    852
  194. #define MDRB_CTRL_CONFIGDESKTOP 853
  195. #define MDRB_CTRL_ABOUT         854
  196. #define MDRB_CTRL_SHUTDOWN      855
  197. #define MDRB_CTRL_HELP          856
  198. #define MDRB_CTRL_EXIT          857
  199. #define MDRB_CTRL_SPOOLER       858
  200. #define MDRB_CTRL_BRKSEPARATOR  859
  201. #define MDRB_CTRL_SEPARATOR     860
  202.  
  203. #define SDID_SHUTDOWNDIALOG     900     /* OS/2 ShutDown dialog */
  204. #define SDID_SHUTDOWNMESSAGE    901     /* Message diaplayed a ShutDown */
  205.  
  206. #define SUID_STARTUPDIALOG      950     /* Request parameters from user before launching
  207.                                            an application */
  208. #define SUTF_STARTUPPROGRAM     951     /* Application to be started */
  209. #define SUTF_STARTUPINFO        952     /* Info to the user what to do */
  210. #define SUTF_STARTUPPARAMETERS  953     /* Info to the user of current parameters */
  211. #define SUEF_STARTUPPARAMETERS  954     /* Entryfield for user data */
  212.  
  213. #define WPID_WPS2PC2DIALOG      1000    /* WPS 2 PC2 dialog */
  214. #define WPTF_EXTRACTEDOBJECTS   1001    /* Text for listbox */
  215. #define WPLB_EXTRACTEDOBJECTS   1002    /* Listbox of WPS objects extracted */
  216. #define WPTF_STATUSBITMAP       1003    /* Text for status bitmap */
  217. #define WPBM_STATUSBITMAP       1004    /* Status bitmap */
  218. #define WPBM_EMPTY              1005    /* First status bitmap (empty listbox) */
  219. #define WPBM_FULL               1006    /* Second status bitmap (filled listbox) */
  220. #define WPPB_CLEAR              1007    /* Clear all WPS objects extracted up to now */
  221. #define WPPB_HELP               1008    /* Help */
  222.  
  223. /*                                                                     *\
  224.  * Now we can safely define more macros with values already occuring   *
  225.  * in the dialog controls definition, because the dialog editor only   *
  226.  * takes the first definition.                                         *
  227. \*                                                                     */
  228.  
  229.                                         /* Draw the reduced Virtual Desktop layout into the
  230.                                            in memory presentation space to avoid flickering.
  231.                                            For debugging purposes it may be useful to draw
  232.                                            the same things directly into the client area's
  233.                                            presentation space, to be able the see what the
  234.                                            drawing does. So you may want to replace pHP->hpsMemory
  235.                                            by hpsClient then. */
  236. #ifdef  SLOWVIDEO
  237. #define         HPSDRAW         hpsClient
  238. #else
  239. #define         HPSDRAW         pHP->hpsMemory
  240. #endif /* SLOWVIDEO */
  241.  
  242.                                         /* PC/2 semaphore to avoid loading PC/2 twice */
  243. #define         PC2_SEM "\\SEM32\\PC2_SEM.SEM"
  244. #define         DESKTOP_CLASS   "#37"   /* Class name of the "Desktop" window handle (which
  245.                                            is reserved in the Toolkit) but it's a container */
  246.  
  247.                                         /* Oveview window frame creation flags */
  248. #define         FCF_OVERVIEWWINDOW          FCF_ICON | FCF_SIZEBORDER | FCF_TASKLIST | FCF_MENU | \
  249.                                             FCF_TITLEBAR | FCF_HIDEBUTTON | FCF_ACCELTABLE |      \
  250.                                             FCF_NOBYTEALIGN | FCF_AUTOICON
  251.                                         /* Spooler window frame creation flags */
  252. #define         FCF_SPOOLERWINDOW           FCF_ICON | FCF_SIZEBORDER | FCF_TITLEBAR |            \
  253.                                             FCF_HIDEBUTTON | FCF_NOBYTEALIGN | FCF_AUTOICON
  254.                                         /* WPS 2 PC/2 window frame creation flags */
  255. #define         FCF_WPS2PC2WINDOW           FCF_BORDER | FCF_TITLEBAR | FCF_SYSMENU
  256.  
  257.                                         /* Define an additional session type of WPS object
  258.                                            representing any object */
  259. #define         PROG_WPSOBJECT              21
  260.                                         /* Defined SSF_CONTROL_AUTOSTART additional to SSF_CONTROL_* */
  261. #define         SSF_CONTROL_AUTOSTART       0x4000
  262. #define         FAPPTYP_WINDOWSPROT31       0x1000
  263.                                         /* Number of KEYDATA hotkeys defined for PC/2 */
  264. #define         KEYDATACOUNT                72
  265.  
  266. #define         CLASSNAMESIZE               7
  267. #define         SWP_MOVEWINDOWVISIBLE       0x20000000
  268. #define         SWP_NOMOVE                  0x40000000
  269. #define         SWP_MOVEWINDOW              0x80000000
  270.  
  271.                                         /* All notebook dialog pages that are loaden into any of
  272.                                            PC/2's notebooks are 200 * 150 dialog units in size.
  273.                                            This dialog units are used to size the notebook so that
  274.                                            a notebook dialog page fits into the notebook area where
  275.                                            dialogs are loaded into. The dialog window is somewhat
  276.                                            larger as required on 8514/A and VGA displays to have
  277.                                            some spare place to size the notebook within */
  278. #define         NOTEBOOKPAGE_CX             200
  279. #define         NOTEBOOKPAGE_CY             150
  280.  
  281.                                         /* Used for font selection */
  282. #define         LCID_FONT                   1
  283.  
  284. #define         DRT_WPS2PC2                 "DRT_OBJECT"
  285. #define         DRM_WPS2PC2                 "DRM_WPS2PC2"
  286. #define         DRF_WPS2PC2                 "DRF_WPS2PC2"
  287. #define         RMF_WPS2PC2                 "<"DRM_WPS2PC2","DRF_WPS2PC2">"
  288.  
  289.                                         /* Debug details flags */
  290. #define         DEBUG_NO                    0
  291. #define         DEBUG_LOW                   1
  292. #define         DEBUG_ENTRY                 2
  293. #define         DEBUG_FULL                  3
  294.  
  295. /*--------------------------------------------------------------------------------------*\
  296.  *                                                                                      *
  297.  * +-----+-----+-----+                                                                  *
  298.  * | www |    www========== Some windows, only two seen by the user on the display.     *
  299.  * | www |     |     |                                                                  *
  300.  * +-----+-----www---+===== Virtual Desktop (9fold-size of physical Desktop).           *
  301.  * |     | www wwww  |                                                                  *
  302.  * |  +----www | ww  |                                                                  *
  303.  * +--|ww  www-+-----+                                                                  *
  304.  * |  |ww   |============== Physical Desktop somewhere within virtual Desktop. The      *
  305.  * |  +-----+  |     |      physical Desktop is the part of the virtual Desktop which   *
  306.  * +-----+-----+-----+      the user visually can see, therefor large parts of the      *
  307.  *                          virtual Desktop can't be ssen by the user. He must use      *
  308.  * his pointing device, the slide the physical Desktop around the virtual Desktop, by   *
  309.  * moving the pointer over the surrounding rows and columns of the physical screen.     *
  310.  *                                                                                      *
  311. \*------------------------------------------------------------------------------------- */
  312.                                         /* Status bits defined for bitmapped ulMoveFlag */
  313.                                         /* Set if we move all windows right (our physical
  314.                                            Desktop will move left on the virtual Desktop) */
  315. #define         MOVEXR              0x0001
  316.                                         /* Set if we move all windows left */
  317. #define         MOVEXL              0x0002
  318.                                         /* Set if we move all windows up (our physical
  319.                                            Desktop will move down on the virtual Desktop */
  320. #define         MOVEYU              0x0004
  321.                                         /* Set if we move all windows down */
  322. #define         MOVEYD              0x0008
  323.                                         /* Set if we are to move all windows, but the
  324.                                            CLICK2MOVE flag is set, and therefor we require
  325.                                            a click before we really move */
  326. #define         MOVED4CLICK         0x0010
  327.  
  328.                                         /* Status bits defined for bitmapped ulStatusFlag */
  329.                                         /* Before writing ulStatusFlag to PC2.INI it is anded
  330.                                            with WRITEMASK to write only permanent flags */
  331. #define         WRITEMASK           0x00FFFFFF
  332.                                         /* Permanent flags */
  333.                                         /* Set if the user requested a sliding focus */
  334. #define         SLIDINGFOCUS        0x00000001
  335.                                         /* Set if the user requested a virtual Desktop */
  336. #define         VIRTUALDESKTOP      0x00000002
  337.                                         /* Set if the user also wants the WPS to move */
  338. #define         MOVEDESKTOP         0x00000004
  339.                                         /* Set if the user wants to click before Desktop
  340.                                            moves */
  341. #define         CLICK2MOVE          0x00000008
  342.                                         /* Set if the user wants an overview window */
  343. #define         OVERVIEW            0x00000010
  344.                                         /* Set if sliding focus should preserve the Z-order of
  345.                                            the windows */
  346. #define         PRESERVEZORDER      0x00000020
  347.                                         /* Set if mouse button 2 click downs on titlebars should
  348.                                            set the window to the bottom of all windows */
  349. #define         BUTTON2ZORDER       0x00000040
  350.                                         /* Set if overview window should be the topmost window,
  351.                                            even when another window has the focus */
  352. #define         KEEPONTOP           0x00000080
  353.                                         /* Set if the WPS should be expanded to the whole Virtual Desktop */
  354. #define         EXPANDWPS           0x00000100
  355.                                         /* Set if a bitmap is set for PM Background */
  356. #define         BACKGROUNDBITMAP    0x00000200
  357.                                         /* Set if the first item of the Popup-Menu should be selected */
  358. #define         SELECTFIRSTITEM     0x00000400
  359.                                         /* Set if the user wants to hide PC/2's titlebar */
  360. #define         HIDETITLEBAR        0x00000800
  361.                                         /* Set if the user wants to hide PC/2's smarticon bar */
  362. #define         HIDESMARTICONBAR    0x00001000
  363.                                         /* Set if the user wants PC/2's Spooler Window even when
  364.                                            PC/2 is running on top of the WPS */
  365. #define         SHOWSPOOLERWINDOW   0x00002000
  366.                                         /* Set if the user wants normal OS/2 shutdown, that is
  367.                                            the user gets asked as you would select shutdown from
  368.                                            the WPS's conext menu */
  369. #define         NORMALSHUTDOWN      0x00004000
  370.                                         /* Set if Autostart should be ignored when invoking PC/2
  371.                                            (e.g. for debugging purposes) */
  372. #define         IGNOREAUTOSTART     0x00008000
  373.                                         /* Set if Hotkeys should be detected only when either PC/2,
  374.                                            the Window List or the WPS has the focus */
  375. #define         HOTKEY4PC2ONLY      0x00010000
  376.  
  377.                                         /* Flags only used during PC/2 running */
  378.                                         /* Set if /INSTALL commandline parameter was given */
  379. #define         INSTALLATIONHELP    0x01000000
  380.                                         /* Set when configuration dialog should be displayed,
  381.                                            because Popup-Menu is empty */
  382. #define         DISPLAYCONFIGDIALOG 0x02000000
  383.                                         /* Set when used closed PC/2 via Window List, in this case
  384.                                            ignore current WM_QUIT to shutdown PC/2 which than posts
  385.                                            WM_QUIT to itself again */
  386. #define         QUITFROMWINDOWLIST  0x04000000
  387.                                         /* Set when PC/2 is the WPS process running */
  388. #define         PC2RUNNINGASWPS     0x08000000
  389.                                         /* Set when a internal error forces us to close PC/2 */
  390. #define         PC2EMERGENCYEXIT    0x10000000
  391.                                         /* Set when the Spooler or PMSPL.DLL can't be accessed */
  392. #define         PC2SPOOLERERROR     0x20000000
  393.  
  394.                                         /* Background bitmap style flag (lower USHORT contains tile count */
  395.                                         /* Normal style */
  396. #define         BITMAPNORMAL        0x00010000
  397.                                         /* Scaled */
  398. #define         BITMAPSCALED        0x00020000
  399.                                         /* Tiled */
  400. #define         BITMAPTILED         0x00040000
  401.  
  402.                                         /* Bitmapped flag for ulThreadReady flag, that is used by
  403.                                            the client window procedure to serialize access to the
  404.                                            working thread, to avoid queueing of work */
  405.                                         /* Working thread is just doing his work of enumerating
  406.                                            windows for new, moved, sized or destroyed windows  */
  407. #define         THREADWINDOWBUSY    0x00000001
  408.                                         /* Working thread is just doing his work of moving from
  409.                                            one Virtual Desktop to another */
  410. #define         THREADMOVEBUSY      0x00000002
  411.                                         /* Working thread was busy when more window enumeration
  412.                                            requests were available, save fact and do the work
  413.                                            when not busy */
  414. #define         THREADWINDOWQUEUED  0x00000004
  415.  
  416. /*--------------------------------------------------------------------------------------*\
  417.  *                                                                                      *
  418.  * Style definitions for DrawWindow() functions.                                        *
  419.  *                                                                                      *
  420. \*------------------------------------------------------------------------------------- */
  421.  
  422. #define         BACKGROUND_WND  0x0001  /* Set for 3D effect of a deeper than surface window */
  423. #define         FOREGROUND_WND  0x0002  /* Set for 3D effect of a higher than surface window */
  424. #define         BORDERONLY_WND  0x0001  /* Set if only the border of a window should be drawn */
  425.  
  426. #define         VISIBLE         0x01    /* Set if window visible on overview window */
  427. #define         FRAMECLASS      0X02    /* Set if window has a known frame class */
  428.  
  429. #define         EF_SIZE255      255
  430. #define         LENDOSSETTINGS  8192    /* Length of all DOS settings of a session */
  431. #define         LENENVSETTINGS  8192    /* Lenght of user added/replaced environment */
  432. #define         LENENVENTRY     1024    /* Length of a single EnvironmentVariable=Value entry */
  433.  
  434. typedef struct  _SESSIONDATA            SESSIONDATA;
  435. typedef struct  _MENUDATA               MENUDATA;
  436. typedef struct  _COMMANDLINEPARAMS      COMMANDLINEPARAMS;
  437. typedef struct  _HOOKPARAMETERS         HOOKPARAMETERS;
  438. typedef struct  _NBPAGE                 NBPAGE;
  439. typedef struct  _KEYDATA                KEYDATA;
  440. typedef struct  _WINDOWDATA             WINDOWDATA;
  441. typedef struct  _WINDOWS                WINDOWS;
  442. typedef struct  _SPOOLERRECORD          SPOOLERRECORD;
  443. typedef struct  _SPOOLEROBJECT          SPOOLEROBJECT;
  444. typedef struct  _WPSOBJECTLIST          WPSOBJECTLIST;
  445.  
  446.                                         /* OS/2 3.00 WAPR+ supports the new APIs DosSetExtLIBPATH
  447.                                            (DOSCALL1.998) and DosQueryExtLIBPATH (DOSCALL1.999)
  448.                                            to dynamically modify the search sequence for locating
  449.                                            dynamic link libraries (DLLs). PC/2 tries dynamic linking
  450.                                            of these APIs, instead of statically linking, for
  451.                                            compatibility with OS/2 2.x.
  452.                                            To my surprise, these APIs seem to be in a 16:16 segment,
  453.                                            APIENTRY does not work (at the time I write this I have
  454.                                            no documentation that emphasis or denys this)  */
  455. #define         BEGINLIBPATH    1
  456. #define         ENDLIBPATH      2
  457. typedef APIRET  (APIENTRY16 DOSSETEXTLIBPATH)     (PSZ pszExtLIBPATH, ULONG ulFlags);
  458. typedef APIRET  (APIENTRY16 DOSQUERYEXTLIBPATH)   (PSZ pszExtLIBPATH, ULONG ulFlags);
  459.  
  460. typedef void    (EXPENTRY PFFUNCPTR1)   (void);
  461. typedef BOOL    (EXPENTRY PFFUNCPTR2)   (HAB hab, PQMSG pqmsg, ULONG option);
  462. typedef void    (EXPENTRY PFFUNCPTR3)   (HAB hab, PSMHSTRUCT pSmh, BOOL bInterTask);
  463. typedef PCH     (EXPENTRY PFFUNCPTR4)   (HWND hwndClient, HWND hwnd, PSZ pcIn, USHORT usIn,\
  464.                                          USHORT *pusOut, USHORT *pusWinMode);
  465. typedef ULONG   (EXPENTRY PFFUNCPTR5)   (HMODULE hDLLPc2Hook);
  466.  
  467. #define         ENTRYSUBMENU    0       /* Popup-Menu entry is a (sub)menu */
  468. #define         ENTRYMENUITEM   1       /* Popup-Menu entry is a program */
  469. #define         ENTRYCONTROL    2       /* Popup-Menu entry is a PC/2 configuration control */
  470. #define         ENTRYEMPTY      3       /* Popup-Menu entry is empty */
  471.  
  472. #define         WPSOBJECTPROGRAM 0      /* WPSOBJECTLIST entry for WPProgram Objects */
  473. #define         WPSOBJECTFOLDER 1       /* WPSOBJECTLIST entry for WPFolder Objects */
  474. #define         WPSOBJECTOBJECT 2       /* WPSOBJECTLIST entry for any other WPS Objects */
  475.  
  476. #define         CTRL_CONFIGMENU         "Config ~Menu"
  477. #define         CTRL_CONFIGDESKTOP      "Config ~Desktop"
  478. #define         CTRL_ABOUT              "~About PC/2"
  479. #define         CTRL_SHUTDOWN           "~ShutDown OS/2"
  480. #define         CTRL_HELP               "~Help\tF1"
  481. #define         CTRL_EXIT               "E~xit\tF3"
  482. #define         CTRL_SPOOLER            "PC/2 Spoo~ler"
  483. #define         CTRL_BREAKSEPARATOR     "-- Vert. Break --"
  484. #define         CTRL_SEPARATOR          "--- Separator ---"
  485.  
  486. #define         PAGE_1          0       /* Index of 1st notebook page */
  487. #define         PAGE_2          1
  488. #define         PAGE_3          2
  489. #define         PAGE_4          3
  490. #define         PAGE_5          4
  491. #define         PAGE_6          5
  492.  
  493. struct  _KEYDATA                        /* Structure that defined 1 hotkey */
  494. {
  495. USHORT          usFlags;                /* Keyboard control codes: KC_CTRL, KC_ALT,... */
  496. USHORT          usCh;                   /* Keyboard character value: 0, 1,... */
  497. UCHAR           ucScanCode;             /* Keyboard character scan code */
  498. BOOL            bUsed;                  /* True if this hotkey is defined */
  499. MENUDATA        *pMenuData;             /* Pointer to MenuData structure where is Hotkey
  500.                                            is defined */
  501. };
  502.  
  503. struct _SESSIONDATA                     /* Control structure to start a new session */
  504. {
  505. ULONG           id;                     /* Session ID for menu ressources */
  506. UCHAR           PgmTitle[MAXNAMEL+1];   /* Session title */
  507.                                         /* Session (sub)title on window's titlebar */
  508. UCHAR           WindowTitle[MAXNAMEL+1];
  509. UCHAR           PgmName[EF_SIZE255+1];  /* Session path and filename */
  510.                                         /* Session working directory */
  511. UCHAR           PgmDirectory[EF_SIZE255+1];
  512.                                         /* Session parameter */
  513. UCHAR           PgmInputs[EF_SIZE255+1];
  514. PSZ             PgmDosSettings;         /* DOS Settings for OS/2 DOS and WIN-OS2 sessions */
  515. PSZ             PgmEnvironment;         /* Optional environment addition/replacement of environment
  516.                                            inherited from PC/2 to the started application */
  517. USHORT          SessionType;            /* Session type */
  518. USHORT          PgmControl;             /* Session control */
  519. USHORT          FgBg;                   /* Start session in foreground/background */
  520. SHORT           InitXPos;               /* X position */
  521. SHORT           InitYPos;               /* Y position */
  522. SHORT           InitXSize;              /* X size */
  523. SHORT           InitYSize;              /* Y size */
  524. KEYDATA         KeyData;                /* Hotkey data, if none defined, usCh=0, bUsed=0, pMenuData=NULL */
  525. ULONG           SwpFlag;                /* Activation on hotkey SWP flag: SWP_RESTORE or SWP_MAXIMIZE,
  526.                                            SWP_NOMOVE */
  527. USHORT          PriorityClass;          /* Priority Class */
  528. SHORT           PriorityDelta;          /* Priority Delta */
  529. };
  530.  
  531. struct _MENUDATA                        /* Control structure to build popup menu */
  532. {
  533. USHORT          Item;                   /* MENUITEM or SUBMENU */
  534. HWND            hwndItem;               /* Window handle within Popup-Menu */
  535. ULONG           id;                     /* Session ID for menu ressources */
  536. PSZ             PgmTitle;               /* Session title */
  537. PSZ             WindowTitle;            /* Session (sub)title on window's titlebar */
  538. PSZ             PgmName;                /* Session path and filename */
  539. PSZ             PgmDirectory;           /* Session working directory */
  540. PSZ             PgmInputs;              /* Session parameter */
  541. PSZ             PgmDosSettings;         /* Session settings for DOS applications */
  542. PSZ             PgmEnvironment;         /* Session environment settings */
  543. USHORT          SessionType;            /* Session type */
  544. USHORT          PgmControl;             /* Session control */
  545. USHORT          FgBg;                   /* Start session in foreground/background */
  546. SHORT           InitXPos;               /* X position */
  547. SHORT           InitYPos;               /* Y position */
  548. SHORT           InitXSize;              /* X size */
  549. SHORT           InitYSize;              /* Y size */
  550. KEYDATA         KeyData;                /* Hotkey data, if none defined, usCh=0, bUsed=0, pMenuData=NULL */
  551. ULONG           SwpFlag;                /* Activation on hotkey SWP flag: SWP_RESTORE or SWP_MAXIMIZE,
  552.                                            SWP_NOMOVE */
  553. USHORT          PriorityClass;          /* Priority Class */
  554. SHORT           PriorityDelta;          /* Priority Delta */
  555. MENUDATA        *Back;                  /* Pointer to previous menu */
  556. MENUDATA        *Submenu;               /* Pointer to a submenu */
  557. MENUDATA        *Next;                  /* Pointer to next menu */
  558. };
  559.  
  560. struct  _COMMANDLINEPARAMS
  561. {
  562. UCHAR           ucPgmTitle[MAXNAMEL+1]; /* Session title */
  563. UCHAR           ucPBefore[MAXNAMEL+1];  /* Parameters before user requested parameter */
  564. UCHAR           ucPUser[128];           /* User requested parameter */
  565. UCHAR           ucPAfter[MAXNAMEL+1];   /* Parameters after user requested parameter */
  566. };
  567.  
  568. struct  _NBPAGE                         /* Notebook pages setup data */
  569. {
  570. PFNWP           pDialogWndProc;         /* Window procedure of a  notebook page */
  571. HWND            hwndNBPage;             /* Window handle of a notebook page */
  572. ULONG           ulIDPage;               /* ID of notebook page */
  573. PSZ             pszStatusLine;          /* Status line text */
  574. PSZ             pszTab;                 /* Tab text */
  575. ULONG           ulIDDialogPage;         /* ID of a dialog resource */
  576. ULONG           ulIDFocus;              /* ID of control to receive focus */
  577. };
  578.  
  579. struct  _WINDOWDATA                     /* All we need to know about a certain window */
  580. {
  581. UCHAR           ucPgmTitle[MAXNAMEL+1]; /* Session title on titlebar */
  582.                                         /* Session title in Window List */
  583. UCHAR           ucWindowTitle[MAXNAMEL+1];
  584.                                         /* Session's class name */
  585. UCHAR           ucClassName[CLASSNAMESIZE];
  586. SWP             swpWindow;              /* Window's SWP structure */
  587. KEYDATA         KeyData;                /* Hotkey data */
  588. ULONG           SwpFlag;                /* Activation on hotkey SWP flag: SWP_RESTORE or SWP_MAXIMIZE,
  589.                                            SWP_NOMOVE */
  590. HSWITCH         hswitchWindow;          /* Switch handle of the window */
  591. ULONG           ulStatus;               /* Status on overview window */
  592. };
  593.  
  594. struct  _WINDOWS                        /* All windows on PM are traced here */
  595. {
  596. ULONG           ulDesktop;              /* Index of Desktop in WINDOWDATA[] */
  597. ULONG           ulWindowList;           /* Index of Window List in WINDOWDATA[] */
  598. ULONG           ulWindowLast;           /* Index of last window in WINDOWDATA[] */
  599. WINDOWDATA      wdWindow[128];          /* Assume 128 windows maximum */
  600. };
  601.  
  602. struct  _HOOKPARAMETERS
  603. {
  604. TIB             *pTib;                  /* TIB of PC/2 */
  605. PIB             *pPib;                  /* PIB of PC/2 */
  606. KEYDATA         *pKeyData;              /* Hotkeys allowed for PC/2 */
  607. HAB             habPc2;                 /* Anchor block handle of PC/2 */
  608. HMQ             hmqPc2;                 /* Message queue handle of PC/2 */
  609. HPS             hpsMemory;              /* Presentation space in a memory DC to draw
  610.                                            Overview window into and clip it into the
  611.                                            Overview window's client area afterwards, to
  612.                                            avoid the flickering of drawing in the client
  613.                                            area directly */
  614. HBITMAP         hbmMemory;              /* Bitmap handle of in memory presentation space */
  615. HWND            hwndFrame;              /* PC/2's overview window frame */
  616. HWND            hwndClient;             /* PC/2's overview window client to send/post
  617.                                            messages to */
  618. HWND            hwndThread;             /* PC/2's working thread window handle to
  619.                                            send/post messages to */
  620. HWND            hwndSpooler;            /* PC/2's spooler window handle to send/post
  621.                                            messages to when PC/2 runs as a WPS replacement */
  622. HWND            hwndSpoolerContainer;   /* Handle of the container which is the client of PC/2's
  623.                                            spooler window */
  624. HWND            hwndPopupMenu;          /* Handle of popup menu window */
  625. HWND            hwndMenu;               /* Handle of overview window menu */
  626. HWND            hwndHelp;               /* Help window handle */
  627. HWND            hwndWPS;                /* WPS window handle where mouse clicks on WPS
  628.                                            can be found */
  629. HWND            hwndDesktop;            /* PM window handle where mouse clicks on Desktop
  630.                                            can be found */
  631. HWND            hwndWindowList;         /* Window List window handle to avoid changing its
  632.                                            Z-order in the WinSendMsgHook() */
  633. HWND            hwndActiveWindow;       /* Top level window that was active, before PC/2
  634.                                            detected an event that results in a change of
  635.                                            the active window and input focus */
  636. MENUDATA        *pPopupMenu;            /* First entry of linked list of menus */
  637. MENUDATA        *pMenuData;             /* This pointer points to the current level of
  638.                                            Submenus and Menuitems within the configuration
  639.                                            dialog procedure */
  640. SPOOLEROBJECT   *pSpoolerObjectRoot;    /* This pointer points the the first SPOOLEROBJECT filled
  641.                                            by enumerating the printer queue or NULL */
  642. SPOOLEROBJECT   *pSpoolerObject;        /* This pointer points the the current SPOOLEROBJECTs list,
  643.                                            which contains all selected container records or NULL */
  644. WINDOWS         Windows;                /* Trace all windows here */
  645. USHORT          MenuDataId;             /* Create linked list by starting with ID ID_POPUPMENU */
  646. USHORT          PriorityClass;          /* PC/2's standard Priority Class */
  647. SHORT           PriorityDelta;          /* PC/2's stantard Priority Delta */
  648.                                         /* Path of PC2.INI */
  649. UCHAR           ucFilenameINI[CCHMAXPATH];
  650. UCHAR           ucPathDLL[CCHMAXPATH];  /* Path to PC/2 DLLs */
  651.                                         /* Name of Desktop, f.e. OS/2 2.0 Desktop */
  652. UCHAR           ucDesktopName[MAXNAMEL+1];
  653.                                         /* Name of Task List, f.e. Window List */
  654. UCHAR           ucWindowListName[MAXNAMEL+1];
  655.                                         /* Name of PM background bitmap */
  656. UCHAR           ucBackgroundBitmap[MAXNAMEL+1];
  657.                                         /* Font used for Popup-Menu (set by dropping font onto
  658.                                            smart icons) */
  659. UCHAR           ucPopupMenuFont[MAXNAMEL+1];
  660.                                         /* Font for overview window */
  661. UCHAR           ucPC2WindowFont[MAXNAMEL+1];
  662.                                         /* Font for spooler window */
  663. UCHAR           ucPC2SpoolerFont[MAXNAMEL+1];
  664. ULONG           ulBackgroundBitmapFlag; /* Upper USHORT contains PM background bitmap style flag,
  665.                                            lower USHORT contains tile count */
  666. ULONG           ProcessId;              /* PC/2's process ID */
  667. ULONG           ulScrollPercentage;     /* Percentage of physical Desktop used to scroll
  668.                                            through virtual Desktop (25, 50, 75, 100 %) */
  669. ULONG           ulHorizontalDesktops;   /* Number of horizontal Desktops */
  670. ULONG           ulVerticalDesktops;     /* Number of vertical Desktops */
  671. ULONG           ulStatusFlag;           /* Bitmapped status flag */
  672. ULONG           ulClickFlag;            /* WM_BUTTON1CLICK for a single click, and
  673.                                            WM_BUTTON1DBLCLK for a double click */
  674. ULONG           ulLogicalDriveMap;      /* Bitmapped flag for all drives available locally */
  675. ULONG           ulOverviewFCF;          /* FCF_OVEVIEWWINDOW or user modification */
  676. ULONG           ulSpoolerFCF;           /* FCF_SPOOLERWINDOW or user modification (currently not used) */
  677. ULONG           ulDebug;                /* Debug status flag */
  678. LONG            lSplitbarPosition;      /* Splitbar position in pixel of spooler container splitbar */
  679. LONG            SlidingXFactor;         /* Sliding offset in pixel for horizontal movements */
  680. LONG            SlidingYFactor;         /* Sliding offset in pixel for vertical movements */
  681. float           fScaleX, fScaleY;       /* Reduce factor to reduce horizontal size of virtual
  682.                                            Desktop to horizonal client window size */
  683. SWP             swpScreen;              /* The screen dimensions */
  684. SWP             swpPC2;                 /* Overview window size and position */
  685. SWP             swpPC2Client;           /* Overview window client's size and position */
  686. SWP             swpPC2Spooler;          /* Spooler window size and position */
  687. POINTL          ptlOrigin;              /* Coordinates (0|0) within client area */
  688. POINTL          LLHotBorder;            /* Lower left coordinates that force sliding in x & y direction */
  689. POINTL          URHotBorder;            /* Upper right coordinates that force sliding in -x & -y direction */
  690. POINTL          DesktopSize;            /* Size of the physical Desktop screen */
  691. POINTL          VirtualDesktopPos;      /* Position of the physical Desktop within the virtual */
  692. POINTL          VirtualDesktopMin;      /* Lower left position of whole virtual Desktop */
  693. POINTL          VirtualDesktopMax;      /* Upper right position of whole virtual Desktop */
  694. HMODULE         hDLLPc2Hook;            /* PC2HOOK.DLL handle */
  695. HMODULE         hDLLPc2Spooler;         /* PC2SPOOL.DLL handle */
  696. FILE            *Pc2Profile;            /* Open the profile, where the user entered menu
  697.                                            data is stored, with this handle */
  698.                                         /* DOSCALL1.998 DOSSETEXTLIBPATH API introduced
  699.                                            with OS/2 WARP+ */
  700. DOSSETEXTLIBPATH    *DosSetExtLIBPATH;
  701.                                         /* DOSCALL1.999 DOSQUERYTEXTLIBPATH API introduced
  702.                                            with OS/2 WARP+ */
  703. DOSQUERYEXTLIBPATH  *DosQueryExtLIBPATH;
  704. };
  705.  
  706. struct  _SPOOLERRECORD                  /* Within the spooler window container spooler objects
  707.                                            are stored as SPOOLERRECORD objects */
  708. {
  709. MINIRECORDCORE  MiniRec;                /* A (MINI)RECORDCORE must be the first element of any
  710.                                            type of container window structure */
  711. SPOOLEROBJECT   *pSpoolerObject;        /* Pointer to the linked list of SPOOLEROBJECTs that
  712.                                            controls the SPOOLERRECORD list used by the container internally */
  713. PSZ             pszQueue;               /* Pointer to the queue name column of a spooler container record */
  714. PSZ             pszQueueStatus;         /* Pointer to the queue status column */
  715. PSZ             pszQueueComment;        /* Pointer to the queue comment column */
  716. PSZ             pszQueueDriver;         /* Pointer to the queue status column */
  717. PSZ             pszJob;                 /* Pointer to the job name column */
  718. PSZ             pszJobNumber;           /* Pointer to the job identification number in ASCII */
  719. PSZ             pszJobStatus;           /* Pointer to the job status column */
  720. PSZ             pszJobComment;          /* Pointer to the job document comment */
  721. ULONG           ulJob;                  /* Job identification number */
  722. };
  723.  
  724. struct  _SPOOLEROBJECT                  /* PC/2 internal structure that is a copy of the list used
  725.                                            within the container to control the container objects to
  726.                                            avoid message exchange with the container, when updating
  727.                                            the spooler data */
  728. {
  729. SPOOLEROBJECT   *pSpoolerObjectNext;    /* Pointer to the next SPOOLEROBJECT (next row in container) */
  730. SPOOLEROBJECT   *pSpoolerObjectBack;    /* Pointer to the previous SPOOLEROBJECT */
  731. BOOL            bInQueue;               /* TRUE if current job found during queue enumeration */
  732. SPOOLERRECORD   *pSpoolerRecord;        /* Pointer to a SPOOLERRECORD that is used within the container
  733.                                            to represent a row in the spooler container details view */
  734. };
  735.  
  736. struct  _WPSOBJECTLIST                  /* LIST structure of WPS objects extracted by WPS2PC2.DLL
  737.                                            into shared memory, which is used in PC2.EXE to create
  738.                                            menuitems from */
  739. {
  740. ULONG           ulType;                 /* WPSOBJECT* type value of list element */
  741. WPSOBJECTLIST   *pNext;                 /* Pointer to next LIST element */
  742. WPSOBJECTLIST   *pFolder;               /* Pointer to LIST of elements within the current folder */
  743. VOID            *pData;                 /* Pointer to data item of LIST, e. g. variable length
  744.                                            PROGDETAILS or UCHAR[] structures */
  745. };
  746.  
  747.  
  748. #define ID_PC2MAINWINDOW        256
  749. #define ID_PC2THREADWINDOW      257
  750. #define ID_PC2SPOOLERWINDOW     258
  751. #define ID_PC2POPUPMENU         259
  752. #define ID_PC2SPOOLERCONTAINER  260
  753. #define ID_WPS2PC2MAINWINDOW    261
  754.  
  755. #define PC2_CLASSNAME           "PC2 - Main"
  756. #define PC2_CLASSNAME_THREAD    "PC2 - Thread"
  757. #define PC2_CLASSNAME_SPOOLER   "PC2 - Spooler"
  758. #define PC2_CLASSNAME_WPS2PC2   "PC2 - WPS 2 PC/2"
  759.  
  760. #define PC2_OVERVIEW_WINDOW     "PC/2 Overview"
  761. #define PC2_SPOOLER_WINDOW      "PC/2 Spooler"
  762. #define PC2_WPS2PC2_WINDOW      "WPS 2 PC/2"
  763.  
  764. #define PC2_WPS2PC2_HELP        "WPS2PC2.HLP"
  765.  
  766. #define ID_SPOOLERPOPUPMENU     270     /* Popup Menu for PC/2 spooler window container */
  767. #define ID_SPOOLERREFRESH       271     /* Refresh spooler window */
  768. #define ID_SPOOLERHOLDJOB       272     /* Pause a print job */
  769. #define ID_SPOOLERRELEASEJOB    273     /* Release a print job */
  770. #define ID_SPOOLERDELETEJOB     274     /* Delete a print job */
  771. #define ID_SPOOLERHOLDQUEUE     275     /* Pause a printer queue */
  772. #define ID_SPOOLERRELEASEQUEUE  276     /* Release a printer queue */
  773. #define ID_SPOOLERHELP          277     /* Help for PC/2 spooler window */
  774.  
  775. #define ID_PC2SETUP             300     /* Defines for PopUp Menu, that is popped up after
  776.                                            the user presses mouse button 1 on DESKTOP */
  777. #define ID_CONFIGDIALOG         301     /* User pressed Configure Menu */
  778. #define ID_ABOUTDIALOG          302     /* User pressed About PC/2 */
  779. #define ID_EXIT                 303     /* User pressed F3 to exit PC/2 */
  780. #define ID_SHUTDOWN             304     /* User pressed ShutDown OS/2 */
  781. #define ID_DESKTOPDIALOG        305     /* User pressed Configure Desktop */
  782. #define ID_HELP                 306     /* ID used for HELP panels */
  783. #define ID_SPOOLER              307     /* User pressed PC/2 Spooler */
  784. #define ID_DEBUG                308     /* User pressed Debug toggle key */
  785. #define ID_EMERGENCYEXIT        309     /* User pressed ALT+CTRL+F3 to exit PC/2 in
  786.                                            an undocumented way. This is for testing
  787.                                            or debugging only, useful when running as WPS */
  788.  
  789. #define ID_ICONEXIT             310     /* Exit PC/2 smarticon */
  790. #define ID_ICONMOVE             311     /* Move smarticon */
  791. #define ID_ICONHIDE             312     /* Hide window smarticon */
  792. #define ID_ICONZORDERTOP        313     /* Set window behind HWND_TOP smarticon */
  793. #define ID_ICONZORDERBOTTOM     314     /* Set window behind HWND_BOTTOM smarticon */
  794. #define ID_ICONCLOSE            315     /* Close window smarticon */
  795. #define ID_ICONMAXIMIZE         316     /* Maximize window smarticon */
  796. #define ID_ICONMINIMIZE         317     /* Minimize window smarticon */
  797. #define ID_ICONRESTORE          318     /* Restore window smarticon */
  798. #define ID_ICONSHUTDOWN         319     /* Shutdown OS/2 smarticon */
  799. #define ID_ICONHELP             320     /* Help PC/2 window smarticon */
  800.  
  801. #define ID_MOVEPOINTER          330     /* Pointer active while moving windows on
  802.                                            overview window is enabled */
  803. #define ID_ACTIONPOINTER        331     /* Pointer active while performing actions (except
  804.                                            moving) on windows */
  805.  
  806. #define ID_POPUPMENU            1500    /* ID used by first user entered entry in the
  807.                                            popup menu. It is incremented by 1 by tracing
  808.                                            through the linked list for each entry (submenu
  809.                                            or menuitem). */
  810. #define USERITEMFIRST           ID_POPUPMENU
  811. #define USERITEMLAST            ID_POPUPMENU+1499
  812.  
  813.                                         /* IDs used for HELP panels */
  814. #define MAIN_HELP_TABLE         3001
  815. #define MAIN_HELP_SUBTABLE      3002
  816. #define ID_FAQ                  3003
  817. #define ID_GENERALHELP          3004
  818. #define ID_CONCEPTSHELP         3005
  819. #define ID_USINGHELP            3006
  820. #define ID_ERRORHELP            3007
  821. #define ID_INSTALLATIONHELP     3008
  822. #define ID_OVERVIEWHELP         3009
  823. #define ID_COMPATIBILITY        3010
  824.  
  825.  
  826.                                         /* PC/2 error messages help panel IDs */
  827. #define HELP_CREATEWINDOW       3100    /* PM environment creation failed */
  828. #define HELP_PC2LOADED          3101    /* PC/2 already loaded */
  829. #define HELP_DLLLOADED          3102    /* Can't load from PC2HOOK.DLL */
  830. #define HELP_PC2INI             3103    /* Can't load from PC2.INI */
  831. #define HELP_PC2SPOOLDLL        3104    /* Can't load from PC2SPOOL.DLL */
  832. #define HELP_PC2THREAD          3105    /* Can't start second thread */
  833. #define HELP_PC2CFG             3106    /* Can't load from PC2.CFG */
  834. #define HELP_PC2HOOK            3107    /* Can't load/unload hooks */
  835. #define HELP_CREATEDIALOG       3108    /* WinDlgBox failed */
  836. #define HELP_SETPATH            3109    /* Can't change current directory */
  837. #define HELP_PRIORITY           3110    /* Can't change our priority */
  838. #define HELP_LAUNCH             3111    /* Error when starting a session */
  839. #define HELP_MEDIA              3112    /* Error during DosDevIOCtl */
  840. #define HELP_PC2RUNNINGASWPS    3113    /* Can't close PC/2 when running as WPS */
  841.  
  842. #define HELP_HMERROR            3150    /* HM_ERROR detected */
  843. #define HELP_PC2HELP            3151    /* Can't load from PC2.HLP */
  844.  
  845. #define HELP_PC2LOADED_SUBTABLE         3201
  846. #define HELP_DLLLOADED_SUBTABLE         3202
  847. #define HELP_PC2INI_SUBTABLE            3203
  848. #define HELP_PC2SPOOLDLL_SUBTABLE       3204
  849. #define HELP_PC2THREAD_SUBTABLE         3205
  850. #define HELP_PC2CFG_SUBTABLE            3206
  851. #define HELP_PC2HOOK_SUBTABLE           3207
  852. #define HELP_CREATEDIALOG_SUBTABLE      3208
  853. #define HELP_SETPATH_SUBTABLE           3209
  854. #define HELP_PRIORITY_SUBTABLE          3210
  855. #define HELP_LAUNCH_SUBTABLE            3211
  856. #define HELP_MEDIA_SUBTABLE             3212
  857. #define HELP_PC2RUNNINGASWPS_SUBTABLE   3213
  858.  
  859.                                         /* New messages for the configuration menu dialog */
  860.                                         /* Load the current level into configuration listbox */
  861. #define WM_LOADPOPUPMENU        WM_USER+1
  862.                                         /* Initialize the input queue hook */
  863. #define WM_LOADHOOK             WM_USER+2
  864.                                         /* Save Popup-Menu to Profile */
  865. #define WM_SAVEPOPUPMENU        WM_USER+3
  866.                                         /* Load Popup-Menu from Profile */
  867. #define WM_SETPOPUPMENU         WM_USER+4
  868.                                         /* Display Popup-Menu on Desktop */
  869. #define WM_POPUPMENU            WM_USER+5
  870.  
  871.                                         /* Insert an item to the linked list */
  872. #define MM_INSERTITEMMENUITEM   WM_USER+6
  873.                                         /* Change the first item of a Submenu to an item */
  874. #define MM_INSERTITEMSUBMENU    WM_USER+7
  875.                                         /* Move an item of a Submenu to another position */
  876. #define MM_MOVEMENUITEM         WM_USER+8
  877.                                         /* ShutDown message to ShutDown dialog */
  878. #define WM_SHUTDOWN             WM_USER+9
  879.                                         /* Program Type configuration of Program Installation
  880.                                            dialog */
  881. #define WM_SETUPPROGRAMTYPE     WM_USER+10
  882.                                         /* Program Priority configuration of Program Installation
  883.                                            dialog */
  884. #define WM_SETUPPROGRAMPRIORITY WM_USER+11
  885.                                         /* Program Size & Position configuration of Program
  886.                                            Installation dialog */
  887. #define WM_SETUPSIZEPOSITION    WM_USER+12
  888.                                         /* Hotkey settings to be initialized by Program
  889.                                            Installation dialot */
  890. #define WM_SETUPHOTKEY          WM_USER+13
  891.                                         /* Query and set desktop window handle */
  892. #define WM_SETDESKTOPHANDLE     WM_USER+14
  893.                                         /* Sent by PC2HOOK.DLL if windows need to be moved */
  894. #define WM_DESKTOPMOVE          WM_USER+15
  895.                                         /* Sent by Program Installation dialog to dialog window
  896.                                            procedure to initialize notebook pages with user data */
  897. #define WM_SETUPNOTEBOOKPAGES   WM_USER+16
  898.                                         /* Sent by PC2Hook.DLL when a WM_CHAR message was detected
  899.                                            that is used by the Hotkey function */
  900. #define WM_HOTKEY               WM_USER+17
  901.                                         /* Sent by PC2Hook.DLL when mouse clicks are detected on
  902.                                            PM that would display the window list on the WPS */
  903. #define WM_WINDOWLIST           WM_USER+18
  904.                                         /* Sent by PC2Hook.DLL when the pointer is positioned on
  905.                                            a surrounding row and/or column and the Desktop should
  906.                                            be moved */
  907. #define WM_MOVEREQUEST          WM_USER+19
  908.                                         /* Sent to working thread window to resize WPS */
  909. #define WM_EXPANDWPS            WM_USER+20
  910.                                         /* Sent to main window and passed to working thread
  911.                                            from PC2HOOK.DLL when a frame window's z order should
  912.                                            be adjusted because of a button 2 click on titlebar */
  913. #define WM_ZORDER               WM_USER+21
  914.                                         /* Sent to working thread to start applications that have
  915.                                            the autostart flag */
  916. #define WM_AUTOSTART            WM_USER+22
  917.                                         /* Sent to working thread to change the PM background bitmap */
  918. #define WM_BACKGROUNDBITMAP     WM_USER+23
  919.                                         /* Sent by working thread to indicate he finished his work */
  920. #define WM_THREADREADY          WM_USER+24
  921.                                         /* Sent by working thread to client window when startup finished */
  922. #define WM_THREADSTARTUPREADY   WM_USER+25
  923.                                         /* Sent to working thread to reinitialize to root of all drives */
  924. #define WM_SETDRIVEROOT         WM_USER+26
  925.                                         /* Sent to spooler window to bring to top of Z-order */
  926. #define WM_SHOWSPOOLER          WM_USER+27
  927.                                         /* Sent to spooler window to refresh the container holding
  928.                                            the real-time status of the printer queues */
  929. #define WM_REFRESHSPOOLER       WM_USER+28
  930.                                         /* Sent to Overview Window to change FCF_* flags */
  931. #define WM_OVERVIEWFCF          WM_USER+29
  932.                                         /* Initialize PC/2 main window */
  933. #define WM_PC2STARTUP           WM_USER+30
  934. #define WM_PC2STARTUPSCREEN     WM_USER+31
  935. #define WM_PC2STARTUPMEMORYDC   WM_USER+32
  936. #define WM_PC2STARTUPTHREAD     WM_USER+33
  937.  
  938.                                         /* Procedures */
  939. extern BOOL             WinStartUp(HAB *pHab, HMQ *pHmq);
  940. extern BOOL             WinStartHelp(HAB hab, UCHAR *pHelpfile, HWND *pHwndHelp, HWND HwndFrame);
  941. extern BOOL             WinCloseDown(HWND *pHwndHelp, HAB *pHab, HMQ *pHmq);
  942. extern void             StartSession(SESSIONDATA *SessionData);
  943. extern BOOL             LoadMenuData2SessionData(MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  944. extern BOOL             LoadSessionData2MenuData(MENUDATA *pMenuData, SESSIONDATA *pSessionData);
  945. extern MENUDATA         *AllocateMenuData(void);
  946. extern void             LoadMenu(MENUDATA *pMenuData);
  947. extern void             SaveMenu(MENUDATA *pMenuData);
  948. extern MRESULT          SetPopupMenu(ULONG msg, MPARAM mp1, MPARAM mp2);
  949. extern MENUDATA         *SearchItem(MENUDATA *pMD, ULONG *id);
  950. extern MENUDATA         *SearchTitle(MENUDATA *pMD, WINDOWDATA *pWD, BOOL *pbFlag);
  951. extern void             SearchAutoStartItem(MENUDATA *pMD);
  952. extern void             InstallFilename2Dialog(HWND hwndDlg, UCHAR *pucFullFileName, BOOL bObject);
  953. extern void             DisableDialogItem(HWND hwndDlg, USHORT usDialogIDs[], USHORT usItemCount, ULONG ulStyle);
  954. extern ULONG            INIAccess(UCHAR *pucFilenameINI, BOOL bRead);
  955. extern void             DrawWindow(HPS hpsClient, SWP *pswpWindow, ULONG ulWindowColor, ULONG ulTextColor, ULONG ulStyle, PSZ pszWindowName);
  956. extern UCHAR            *ImportDosSettings(UCHAR *pucSettings, ULONG *pulLength, BOOL bImport);
  957. extern ULONG            LoadProgDetails2MenuData(MENUDATA *pMenuData, PROGDETAILS *pProgDetails);
  958. extern ULONG            SetDriveRoot(void);
  959. extern ULONG            ConvertWPSObjectList2MenuData(MENUDATA *pMenuData, WPSOBJECTLIST *pListRoot);
  960.  
  961.                                         /* Pc2Spool.c */
  962. extern ULONG            RefreshSpooler(void);
  963. extern SPOOLERRECORD    *QuerySelectedRecords(SPOOLERRECORD *pSelectedSpoolerRecord);
  964. extern void             NotifySelectedRecords(ULONG ulActionCode);
  965.  
  966.                                         /* Dynamic linked functions */
  967. extern PFFUNCPTR1       *pSetParameters;
  968. extern PFFUNCPTR2       *pInputHook;
  969. extern PFFUNCPTR3       *pWinSendMsgHook;
  970.  
  971.                                         /* PC/2's working thread */
  972. extern void _Optlink    PC2_Thread(void *ThreadArg);
  973.  
  974.                                         /* Window procedures */
  975. extern MRESULT  EXPENTRY PC2_MainWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  976. extern MRESULT  EXPENTRY PI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  977. extern MRESULT  EXPENTRY PI_SubclassedDialogProcedure(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  978. extern MRESULT  EXPENTRY PI_NotebookProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  979. extern MRESULT  EXPENTRY AD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  980. extern MRESULT  EXPENTRY MI_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  981. extern MRESULT  EXPENTRY CD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  982. extern MRESULT  EXPENTRY SD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  983. extern MRESULT  EXPENTRY SU_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  984. extern MRESULT  EXPENTRY RD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  985. extern MRESULT  EXPENTRY DD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  986. extern MRESULT  EXPENTRY DD_NotebookProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  987. extern MRESULT  EXPENTRY MD_DialogProcedure(HWND hwndDlg, ULONG msg, MPARAM mp1, MPARAM mp2);
  988. extern MRESULT  EXPENTRY SubclassedMenuWindowProc(HWND hwndMenu, ULONG msg, MPARAM mp1, MPARAM mp2);
  989. extern MRESULT  EXPENTRY SubclassedListboxWindowProc(HWND hwndLB, ULONG msg, MPARAM mp1, MPARAM mp2);
  990.  
  991.                                         /* Application hooks */
  992. BOOL                     HelpHook(HAB hab, ULONG ulMode, ULONG ulTopic, ULONG ulSubTopic, PRECTL prectlPosition);
  993.  
  994.                                         /* Working thread (object) window procedures */
  995. extern MRESULT  EXPENTRY PC2_ThreadWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  996.  
  997.                                         /* Spooler window procedures */
  998. extern MRESULT  EXPENTRY PC2_SpoolerWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  999. extern MRESULT  EXPENTRY SubclassedContainerWindowProc(HWND hwndMenu, ULONG msg, MPARAM mp1, MPARAM mp2);
  1000.  
  1001.                                         /* Pointer to PC/2 control structure loaded from PC2HOOK.DLL */
  1002. extern HOOKPARAMETERS   *pHP;
  1003.  
  1004.                                         /* Pointer to OS/2 APIs dynamically linked */
  1005. extern DOSSETEXTLIBPATH *DosSetExtLIBPATH;
  1006. extern DOSQUERYEXTLIBPATH
  1007.                         *DosQueryExtLIBPATH;
  1008.  
  1009.