home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 7.ddi / INCLUDE / PMSHL.H$ / PMSHL.bin
Encoding:
Text File  |  1989-11-06  |  14.0 KB  |  402 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: PMSHL.H
  4. *
  5. * OS/2 Presentation Manager Shell constants, types, messages and
  6. * function declarations
  7. *
  8. * Copyright (c) 1989-1990, Microsoft Corporation.  All rights reserved.
  9. *
  10. * ===========================================================================
  11. *
  12. * The following symbols are used in this file for conditional sections.
  13. *
  14. *   INCL_WINSHELLDATA    Include Presentation Manager profile calls
  15. *   INCL_SHLERRORS       defined if INCL_ERRORS is defined
  16. *   INCL_WINSWITCHLIST   Include Switch List Calls
  17. *   INCL_WINPROGRAMLIST  Include Program List Calls
  18. *
  19. \***************************************************************************/
  20.  
  21. /* common types, constants and function declarations */
  22.  
  23. #ifndef PMSHL_COMMON_INCLUDED
  24. #define PMSHL_COMMON_INCLUDED
  25.  
  26. /* maximum title length */
  27. #define MAXNAMEL 60
  28.  
  29. /* window size structure */
  30. typedef struct _XYWINSIZE {    /* xywin */
  31.     SHORT x;
  32.     SHORT y;
  33.     SHORT cx;
  34.     SHORT cy;
  35.     USHORT fsWindow;
  36. } XYWINSIZE;
  37. typedef XYWINSIZE FAR *PXYWINSIZE;
  38.  
  39. /* Definitions for fsWindow */
  40. #define XYF_NOAUTOCLOSE     0x0008
  41. #define XYF_MINIMIZED        0x0004
  42. #define XYF_MAXIMIZED        0x0002
  43. #define XYF_INVISIBLE        0x0001
  44. #define XYF_NORMAL        0X0000
  45.  
  46. /* program handle */
  47. typedef LHANDLE HPROGRAM;    /* hprog */
  48. typedef HPROGRAM FAR * PHPROGRAM;
  49.  
  50. /* ini file handle */
  51. typedef LHANDLE HINI;        /* hini */
  52. typedef HINI FAR * PHINI;
  53.  
  54.  
  55. #define HINI_PROFILE        (HINI) NULL
  56. #define HINI_USERPROFILE    ((HINI) -1L)
  57. #define HINI_SYSTEMPROFILE    ((HINI) -2L)
  58.  
  59. #define HINI_USER    HINI_USERPROFILE
  60. #define HINI_SYSTEM    HINI_SYSTEMPROFILE
  61.  
  62. #endif /* PMSHL_COMMON_INCLUDED */
  63.  
  64. #if (defined(INCL_WINPROGRAMLIST) && !defined(INCL_WINPROGRAMLIST_INCLUDED))
  65. #define INCL_WINPROGRAMLIST_INCLUDED
  66. /* maximum path length */
  67. #define MAXPATHL 128
  68.  
  69. /* root group handle */
  70. #define SGH_ROOT    (HPROGRAM) (-1L)
  71.  
  72. typedef struct _HPROGARRAY {    /* hpga */
  73.     HPROGRAM ahprog[1];
  74. } HPROGARRAY;
  75. typedef HPROGARRAY FAR *PHPROGARRAY;
  76.  
  77. typedef CHAR PROGCATEGORY;    /* progc */
  78. typedef PROGCATEGORY FAR *PPROGCATEGORY;
  79.  
  80. /* values acceptable for PROGCATEGORY for PM groups */
  81. #define PROG_DEFAULT        (PROGCATEGORY) 0
  82. #define PROG_FULLSCREEN     (PROGCATEGORY) 1
  83. #define PROG_WINDOWABLEVIO    (PROGCATEGORY) 2
  84. #define PROG_PM         (PROGCATEGORY) 3
  85. #define PROG_GROUP        (PROGCATEGORY) 5
  86. #define PROG_REAL        (PROGCATEGORY) 4   /* was 7 */
  87. #define PROG_DLL        (PROGCATEGORY) 6
  88. #define PROG_RESERVED        (PROGCATEGORY) 255
  89.  
  90. /* visibility flag for PROGTYPE structure */
  91. #define SHE_VISIBLE   (BYTE) 0x00
  92. #define SHE_INVISIBLE (BYTE) 0x01
  93. #define SHE_RESERVED  (BYTE) 0xFF
  94.  
  95. /* Protected group flag for PROGTYPE structure */
  96. #define SHE_UNPROTECTED (BYTE) 0x00
  97. #define SHE_PROTECTED    (BYTE) 0x02
  98.  
  99. typedef struct _PROGTYPE {    /* progt */
  100.     PROGCATEGORY progc;
  101.     UCHAR         fbVisible;
  102. } PROGTYPE;
  103. typedef PROGTYPE FAR *PPROGTYPE;
  104.  
  105. typedef struct _PROGRAMENTRY {    /* proge */
  106.     HPROGRAM hprog;
  107.     PROGTYPE progt;
  108.     CHAR     szTitle[MAXNAMEL+1];
  109. } PROGRAMENTRY;
  110. typedef PROGRAMENTRY FAR *PPROGRAMENTRY;
  111.  
  112. typedef struct _PIBSTRUCT {    /* pib */
  113.     PROGTYPE  progt;
  114.     CHAR      szTitle[MAXNAMEL+1];
  115.     CHAR      szIconFileName[MAXPATHL+1];
  116.     CHAR      szExecutable[MAXPATHL+1];
  117.     CHAR      szStartupDir[MAXPATHL+1];
  118.     XYWINSIZE xywinInitial;
  119.     USHORT      res1;
  120.     LHANDLE   res2;
  121.     USHORT      cchEnvironmentVars;
  122.     PCH      pchEnvironmentVars;
  123.     USHORT      cchProgramParameter;
  124.     PCH      pchProgramParameter;
  125. } PIBSTRUCT;
  126. typedef  PIBSTRUCT FAR *PPIBSTRUCT;
  127.  
  128. /***************************************************************************/
  129. /*                                                                            */
  130. /*  Structures associated with 'Prf' calls                                    */
  131. /*                                                                            */
  132. /***************************************************************************/
  133.  
  134. typedef struct _PROGDETAILS { /* progde */
  135.     ULONG      Length;        /* set this to sizeof(PROGDETAILS) */
  136.     PROGTYPE  progt;
  137.     USHORT      pad1[3];        /* ready for 32-bit PROGTYPE       */
  138.     PSZ      pszTitle;        /* any of the pointers can be NULL */
  139.     PSZ      pszExecutable;
  140.     PSZ      pszParameters;
  141.     PSZ      pszStartupDir;
  142.     PSZ      pszIcon;
  143.     PSZ      pszEnvironment;    /* this is terminated by  /0/0       */
  144.     SWP      swpInitial;        /* this replaces XYWINSIZE       */
  145.     USHORT      pad2[5];        /* ready for 32-bit SWP        */
  146. } PROGDETAILS;
  147. typedef PROGDETAILS FAR *PPROGDETAILS;
  148.  
  149. typedef struct _PROGTITLE {    /* progti */
  150.     HPROGRAM hprog;
  151.     PROGTYPE progt;
  152.     USHORT     pad1[3];    /* padding ready for 32-bit PROGTYPE */
  153.     PSZ     pszTitle;
  154. } PROGTITLE;
  155. typedef PROGTITLE FAR *PPROGTITLE;
  156.  
  157. typedef struct _QFEOUTBLK {    /* qfeout */
  158.     USHORT     Total;
  159.     USHORT     Count;
  160.     HPROGRAM ProgramArr[1];
  161. } QFEOUTBLK;
  162. typedef QFEOUTBLK far *PQFEOUTBLK;
  163.  
  164. /* Program List API Function Definitions */
  165.  
  166. /***  Program Use */
  167.  
  168. BOOL    APIENTRY WinQueryProgramTitles(HAB hab, HPROGRAM hprogGroup,
  169.                        PPROGRAMENTRY aprogeBuffer,
  170.                        USHORT usBufferLen, PUSHORT pusTotal);
  171.  
  172. /***  Single Program Manipulation */
  173. HPROGRAM  APIENTRY WinAddProgram(HAB hab, PPIBSTRUCT ppibProgramInfo,
  174.                  HPROGRAM hprogGroupHandle);
  175.  
  176. USHORT    APIENTRY WinQueryDefinition(HAB hab, HPROGRAM hprogProgHandle,
  177.                     PPIBSTRUCT ppibProgramInfo,
  178.                     USHORT usMaxLength);
  179.  
  180. /***  Group Manipulation */
  181. HPROGRAM  APIENTRY WinCreateGroup(HAB hab, PSZ pszTitle , UCHAR ucVisibility,
  182.                   ULONG flres1, ULONG flres2);
  183. /***************************************************************************/
  184. /*                                                                            */
  185. /*  Program List API available 'Prf' calls                                    */
  186. /*                                                                            */
  187. /***************************************************************************/
  188.  
  189. ULONG APIENTRY PrfQueryProgramTitles(HINI hini, HPROGRAM hprogGroup,
  190.                      PPROGTITLE pTitles, ULONG cchBufferMax,
  191.                      PULONG pulCount);
  192.  
  193. /****************************************************************************/
  194. /*                                        */
  195. /*  NOTE: string information is concatanated after the array of PROGTITLE   */
  196. /*      structures so you need to allocate storage greater than        */
  197. /*      sizeof(PROGTITLE)*cPrograms to query programs in a group        */
  198. /*                                        */
  199. /*  PrfQueryProgramTitles recommended usage to obtain titles of all progams */
  200. /*  in a group (Hgroup=SGH_ROOT is for all groups):                */
  201. /*                                        */
  202. /*  BufLen = PrfQueryProgramTitles(Hini, Hgroup,                */
  203. /*                         (PPROGTITLE) NULL, 0, &Count); */
  204. /*                                        */
  205. /*  Alocate buffer of  Buflen                            */
  206. /*                                        */
  207. /*  Len = PrfQueryProgramTitles(Hini, Hgroup, (PPROGTITLE)pBuffer, BufLen,  */
  208. /*                                   pCount); */
  209. /*                                        */
  210. /****************************************************************************/
  211.  
  212. HPROGRAM APIENTRY PrfAddProgram(HINI hini, PPROGDETAILS pDetails,
  213.                 HPROGRAM hprogGroup);
  214. BOOL     APIENTRY PrfChangeProgram(HINI hini, HPROGRAM hprog,
  215.                    PPROGDETAILS pDetails);
  216.  
  217. /***************************************************************************/
  218. /*  when adding/changing programs the PROGDETAILS Length field should be   */
  219. /*  set to sizeof(PROGDETAILS)                                             */
  220. /***************************************************************************/
  221.  
  222. ULONG     APIENTRY PrfQueryDefinition(HINI hini, HPROGRAM hprog,
  223.                      PPROGDETAILS pDetails, ULONG cchBufferMax);
  224.  
  225. /****************************************************************************/
  226. /*                                        */
  227. /*  NOTE: string information is concatanated after the PROGDETAILS field    */
  228. /*      structure so you need to allocate storage greater than        */
  229. /*      sizeof(PROGDETAILS) to query programs                 */
  230. /*                                        */
  231. /*  PrfQueryDefinition recomended usage:                    */
  232. /*                                        */
  233. /*  bufferlen = PrfQueryDefinition(Hini, Hprog, (PPROGDETAILS) NULL, 0)     */
  234. /*                                        */
  235. /*  Alocate buffer of bufferlen bytes                        */
  236. /*  set Length field (0 will be supported)                    */
  237. /*                                        */
  238. /*  (PPROGDETAILS)pBuffer->Length=sizeof(PPROGDETAILS)                */
  239. /*                                        */
  240. /*  len = PrfQueryDefinition(Hini, Hprog, (PPROGDETAILS)pBuffer, bufferlen) */
  241. /*                                        */
  242. /****************************************************************************/
  243.  
  244. BOOL     APIENTRY PrfRemoveProgram(HINI hini, HPROGRAM hprog);
  245. ULONG     APIENTRY PrfQueryProgramHandle(HINI hini, PSZ pszExe,
  246.                     PHPROGARRAY phprogArray,
  247.                     ULONG cchBufferMax, PULONG pulCount);
  248. HPROGRAM APIENTRY PrfCreateGroup(HINI hini, PSZ pszTitle, UCHAR chVisibility);
  249. BOOL     APIENTRY PrfDestroyGroup(HINI hini, HPROGRAM hprogGroup);
  250. PROGCATEGORY APIENTRY PrfQueryProgramCategory(HINI hini, PSZ pszExe);
  251.  
  252. #endif /* INCL_WINPROGRAMLIST */
  253.  
  254. #if ((defined(INCL_WINSWITCHLIST) || !defined(INCL_NOCOMMON)) && !defined(INCL_WINSWITCHLIST_INCLUDED))
  255. #define INCL_WINSWITCHLIST_INCLUDED
  256.  
  257. typedef LHANDLE HSWITCH;    /* hsw */
  258. typedef HSWITCH FAR *PHSWITCH;
  259.  
  260. /* visibility flag for SWCNTRL structure */
  261. #define SWL_VISIBLE   (BYTE) 0x04
  262. #define SWL_INVISIBLE (BYTE) 0x01
  263. #define SWL_GRAYED    (BYTE) 0x02
  264.  
  265. /* visibility flag for SWCNTRL structure */
  266. #define SWL_JUMPABLE    (BYTE) 0x02
  267. #define SWL_NOTJUMPABLE (BYTE) 0x01
  268.  
  269. typedef struct _SWCNTRL {    /* swctl */
  270.     HWND     hwnd;
  271.     HWND     hwndIcon;
  272.     HPROGRAM hprog;
  273.     USHORT     idProcess;
  274.     USHORT     idSession;
  275.     UCHAR     uchVisibility;
  276.     UCHAR     fbJump;
  277.     CHAR     szSwtitle[MAXNAMEL+1];
  278.     BYTE     fReserved;       /* To align on word boundary */
  279. } SWCNTRL;
  280. typedef SWCNTRL FAR *PSWCNTRL;
  281.  
  282. /*** Switching Program functions */
  283. HSWITCH APIENTRY WinAddSwitchEntry(PSWCNTRL);
  284. USHORT    APIENTRY WinRemoveSwitchEntry(HSWITCH);
  285.  
  286. #endif  /* not INCL_NOCOMMON */
  287.  
  288. #if (defined(INCL_WINSWITCHLIST) && !defined(INCL_WINSWITCHLIST_INCLUDED))
  289. #define INCL_WINSWITCHLIST_INCLUDED
  290.  
  291. typedef struct _SWENTRY {    /* swent */
  292.     HSWITCH hswitch;
  293.     SWCNTRL swctl;
  294. } SWENTRY;
  295. typedef SWENTRY FAR *PSWENTRY;
  296.  
  297. typedef struct _SWBLOCK {    /* swblk */
  298.     USHORT     cswentry;
  299.     SWENTRY aswentry[1];
  300. } SWBLOCK;
  301. typedef SWBLOCK FAR *PSWBLOCK;
  302.  
  303. USHORT    APIENTRY WinChangeSwitchEntry(HSWITCH hswitchSwitch,
  304.                       PSWCNTRL pswctlSwitchData);
  305. HSWITCH APIENTRY WinCreateSwitchEntry(HAB, PSWCNTRL);
  306. USHORT    APIENTRY WinQuerySessionTitle(HAB hab, USHORT usSession,
  307.                       PSZ pszTitle, USHORT usTitlelen);
  308. USHORT    APIENTRY WinQuerySwitchEntry(HSWITCH hswitchSwitch,
  309.                     PSWCNTRL pswctlSwitchData);
  310. HSWITCH APIENTRY WinQuerySwitchHandle(HWND hwnd, PID usProcess);
  311. USHORT    APIENTRY WinQuerySwitchList(HAB hab, PSWBLOCK pswblkSwitchEntries,
  312.                     USHORT usDataLength);
  313. USHORT    APIENTRY WinQueryTaskSizePos(HAB hab, USHORT usScreenGroup,
  314.                      PSWP pswpPositionData);
  315. USHORT    APIENTRY WinQueryTaskTitle(USHORT usSession, PSZ pszTitle,
  316.                    USHORT usTitlelen);
  317. USHORT    APIENTRY WinSwitchToProgram(HSWITCH hswitchSwHandle);
  318.  
  319. #endif
  320.  
  321. /* if error definitions are required then allow Shell errors */
  322. #ifdef INCL_ERRORS
  323.     #define INCL_SHLERRORS
  324. #endif /* INCL_ERRORS */
  325.  
  326. #if (defined(INCL_WINSHELLDATA) && !defined(INCL_WINSHELLDATA_INCLUDED))
  327. #define INCL_WINSHELLDATA_INCLUDED
  328.  
  329. /*** OS2.INI Access functions */
  330. SHORT    APIENTRY WinQueryProfileInt(HAB hab, PSZ pszAppName,
  331.                     PSZ pszKeyName, SHORT sDefault);
  332. USHORT    APIENTRY WinQueryProfileString(HAB hab, PSZ pszAppName,
  333.                        PSZ pszKeyName, PSZ pszDefault,
  334.                        PVOID pProfileString,
  335.                        USHORT usMaxPstring);
  336. BOOL    APIENTRY WinWriteProfileString(HAB hab, PSZ pszAppName,
  337.                        PSZ pszKeyName, PSZ pszValue);
  338. USHORT    APIENTRY WinQueryProfileSize(HAB hab, PSZ pszAppName, PSZ pszKeyName,
  339.                      PUSHORT pusValue);
  340. BOOL    APIENTRY WinQueryProfileData(HAB hab, PSZ pszAppName, PSZ pszKeyName,
  341.                      PVOID pValue, PUSHORT pusSize);
  342. BOOL    APIENTRY WinWriteProfileData(HAB hab, PSZ pszAppName, PSZ pszKeyName,
  343.                      PVOID pValue, USHORT usSize);
  344.  
  345. /***************************************************************************/
  346. /*                                                                            */
  347. /*  INI file access API available calls 'Prf'                                 */
  348. /*                                                                            */
  349. /***************************************************************************/
  350.  
  351. typedef struct _PRFPROFILE { /* prfpro */
  352.     ULONG  cchUserName;
  353.     PSZ    pszUserName;
  354.     ULONG  cchSysName;
  355.     PSZ    pszSysName;
  356. } PRFPROFILE;
  357. typedef PRFPROFILE FAR *PPRFPROFILE;
  358.  
  359. SHORT APIENTRY PrfQueryProfileInt(HINI hini, PSZ pszApp, PSZ pszKey,
  360.                   SHORT sDefault);
  361. ULONG APIENTRY PrfQueryProfileString(HINI hini, PSZ pszApp, PSZ pszKey,
  362.                      PSZ pszDefault, PVOID pBuffer,
  363.                      ULONG cchBufferMax);
  364. BOOL  APIENTRY PrfWriteProfileString(HINI hini, PSZ pszApp, PSZ pszKey,
  365.                      PSZ pszData);
  366. BOOL  APIENTRY PrfQueryProfileSize(HINI hini, PSZ pszApp, PSZ pszKey,
  367.                    PULONG pulReqLen);
  368. BOOL  APIENTRY PrfQueryProfileData(HINI hini, PSZ pszApp, PSZ pszKey,
  369.                    PVOID pBuffer, PULONG pulBuffLen);
  370.  
  371. BOOL  APIENTRY PrfWriteProfileData(HINI hini, PSZ pszApp, PSZ pszKey,
  372.                    PVOID pData, ULONG cchDataLen);
  373.  
  374. HINI  APIENTRY PrfOpenProfile(HAB hab, PSZ pszFileName);
  375. BOOL  APIENTRY PrfCloseProfile(HINI hini);
  376. BOOL  APIENTRY PrfReset(HAB hab, PPRFPROFILE pPrfProfile);
  377. BOOL  APIENTRY PrfQueryProfile(HAB hab, PPRFPROFILE pPrfProfile);
  378.  
  379. /* new public message, broadcast on PrfReset() */
  380. #define PL_ALTERED 0x008E  /* WM_SHELLFIRST + 0E */
  381.  
  382. #endif /* INCL_WINSHELLDATA */
  383.  
  384. #if (defined(INCL_SHLERRORS) && !defined(INCL_SHLERRORS_INCLUDED))
  385. #define INCL_SHLERRORS_INCLUDED
  386.  
  387. #include <pmerr.h>
  388.  
  389. #endif /* INCL_SHLERRORS */
  390.  
  391. typedef LHANDLE HAPP;
  392.  
  393. HAPP APIENTRY WinInstStartApp(HINI hini, HWND hwndNotifyWindow,
  394.                   USHORT cCount, PSZ far * aszApplication,
  395.                   PSZ pszCmdLine, PVOID pData, USHORT fsOptions);
  396.  
  397. BOOL APIENTRY WinTerminateApp(HAPP happ);
  398.  
  399. /* bit values for Options parameter of WinInstStartAppl */
  400. #define SAF_INSTALLEDCMDLINE  0x0001 /* use installed parameters */
  401. #define SAF_STARTCHILDAPP     0x0002 /* related application     */
  402.