home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / pmshl.h < prev    next >
C/C++ Source or Header  |  1999-04-30  |  22KB  |  543 lines

  1. /****************************** Module Header ******************************\
  2. *
  3. * Module Name: PMSHL.H
  4. *
  5. * OS/2 Presentation Manager Shell constants, types, messages and
  6. * function declarations include file.
  7. *
  8. * Copyright (c) International Business Machines Corporation 1981, 1988-1992
  9. *
  10. * ===========================================================================
  11. *
  12. * The following symbols are used in this file for conditional sections.
  13. *
  14. *   INCL_SHLERRORS       defined if INCL_ERRORS is defined
  15. *   INCL_WINPROGRAMLIST  Include Program List Calls
  16. *   INCL_WINSHELLDATA    Include Presentation Manager profile calls
  17. *   INCL_WINSWITCHLIST   Include Switch List Calls
  18. *
  19. * ===========================================================================
  20. *
  21. * Comments at the end of each typedef line give the name tags used in
  22. * the assembler include version of this file.
  23. *
  24. * The assembler include version of this file excludes lines between XLATOFF
  25. * and XLATON comments.
  26. *
  27. \***************************************************************************/
  28.  
  29. /* NOINC */
  30. #if __IBMC__ || __IBMCPP__
  31.    #pragma info( none )
  32.    #ifndef __CHKHDR__
  33.       #pragma info( none )
  34.    #endif
  35.    #pragma info( restore )
  36. #endif
  37. #ifdef __cplusplus
  38.       extern "C" {
  39. #endif
  40. /* INC */
  41.  
  42. #define SHL_INCLUDED
  43.  
  44.  
  45. /*** if error definitions are required then allow Shell errors *************/
  46. #ifdef INCL_ERRORS
  47.    #define INCL_SHLERRORS
  48. #endif /* INCL_ERRORS */
  49.  
  50.  
  51. #ifndef SESMGR
  52.    /*** common types, constants and function declarations ******************/
  53.    
  54.    
  55.    /*** maximum title length ***********************************************/
  56.    #define MAXNAMEL 60
  57.    
  58.    
  59.    /*** program handle *****************************************************/
  60.    typedef LHANDLE HPROGRAM;       /* hprog */
  61.    typedef HPROGRAM *PHPROGRAM;
  62.    typedef LHANDLE HAPP;
  63.    
  64.    
  65.    /*** ini file handle ****************************************************/
  66.    typedef LHANDLE HINI;           /* hini */
  67.    typedef HINI *PHINI;
  68.    
  69.    
  70.    #define HINI_PROFILE         (HINI) NULL
  71.    #define HINI_USERPROFILE     (HINI) -1L
  72.    #define HINI_SYSTEMPROFILE   (HINI) -2L
  73.    #define HINI_USER    HINI_USERPROFILE
  74.    #define HINI_SYSTEM  HINI_SYSTEMPROFILE
  75.    
  76.    
  77.    typedef struct _PRFPROFILE    /* prfpro */
  78.    {
  79.       ULONG  cchUserName;
  80.       PSZ    pszUserName;
  81.       ULONG  cchSysName;
  82.       PSZ    pszSysName;
  83.    } PRFPROFILE;
  84.    typedef PRFPROFILE *PPRFPROFILE;
  85.    
  86. #endif  /* end #ifndef SESMGR */
  87.  
  88. #ifdef INCL_WINPROGRAMLIST
  89.    /*** program list section ***********************************************/
  90.    #ifndef SESMGR
  91.       
  92.       /*** maximum path length *********************************************/
  93.       #define MAXPATHL 128
  94.       
  95.       /*** root group handle ***********************************************/
  96.       #define SGH_ROOT      (HPROGRAM)-1L
  97.       
  98.       typedef struct _HPROGARRAY       /* hpga */
  99.       {
  100.          HPROGRAM ahprog[1];
  101.       } HPROGARRAY;
  102.       typedef HPROGARRAY *PHPROGARRAY;
  103.       
  104.    #endif  /* end of #ifndef SESMGR */
  105.    
  106.    typedef ULONG PROGCATEGORY;       /* progc */
  107.    
  108.    typedef PROGCATEGORY *PPROGCATEGORY;
  109.    
  110.    /*** values acceptable for PROGCATEGORY for PM groups *******************/
  111.    #define PROG_DEFAULT             (PROGCATEGORY)0
  112.    #define PROG_FULLSCREEN          (PROGCATEGORY)1
  113.    #define PROG_WINDOWABLEVIO       (PROGCATEGORY)2
  114.    #define PROG_PM                  (PROGCATEGORY)3
  115.    #define PROG_GROUP               (PROGCATEGORY)5
  116.    #define PROG_REAL                (PROGCATEGORY)4
  117.    #define PROG_VDM                 (PROGCATEGORY)4
  118.    #define PROG_WINDOWEDVDM         (PROGCATEGORY)7
  119.    #define PROG_DLL                 (PROGCATEGORY)6
  120.    #define PROG_PDD                 (PROGCATEGORY)8
  121.    #define PROG_VDD                 (PROGCATEGORY)9
  122.    #define PROG_WINDOW_REAL         (PROGCATEGORY)10
  123.    #define PROG_WINDOW_PROT         (PROGCATEGORY)11
  124.    #define PROG_30_STD              (PROGCATEGORY)11
  125.    #define PROG_WINDOW_AUTO         (PROGCATEGORY)12
  126.    #define PROG_SEAMLESSVDM         (PROGCATEGORY)13
  127.    #define PROG_30_STDSEAMLESSVDM   (PROGCATEGORY)13
  128.    #define PROG_SEAMLESSCOMMON      (PROGCATEGORY)14
  129.    #define PROG_30_STDSEAMLESSCOMMON (PROGCATEGORY)14
  130.    #define PROG_31_STDSEAMLESSVDM   (PROGCATEGORY)15
  131.    #define PROG_31_STDSEAMLESSCOMMON (PROGCATEGORY)16
  132.    #define PROG_31_ENHSEAMLESSVDM   (PROGCATEGORY)17
  133.    #define PROG_31_ENHSEAMLESSCOMMON (PROGCATEGORY)18
  134.    #define PROG_31_ENH              (PROGCATEGORY)19
  135.    #define PROG_31_STD              (PROGCATEGORY)20
  136.    #define PROG_DOS_GAME            (PROGCATEGORY)21
  137.    #define PROG_WIN_GAME            (PROGCATEGORY)22
  138.    #define PROG_DOS_MODE            (PROGCATEGORY)23
  139.    #define PROG_RESERVED            (PROGCATEGORY)255
  140.    
  141.    #ifndef SESMGR
  142.       
  143.       typedef struct _PROGTYPE         /* progt */
  144.       {
  145.          PROGCATEGORY progc;
  146.          ULONG        fbVisible;
  147.       } PROGTYPE;
  148.       typedef PROGTYPE *PPROGTYPE;
  149.       
  150.       
  151.       /*** visibility flag for PROGTYPE structure **************************/
  152.       #define SHE_VISIBLE         0x00
  153.       #define SHE_INVISIBLE       0x01
  154.       #define SHE_RESERVED        0xFF
  155.       
  156.       /*** Protected group flag for PROGTYPE structure *********************/
  157.       #define SHE_UNPROTECTED     0x00
  158.       #define SHE_PROTECTED       0x02
  159.       
  160.       
  161.       
  162.       /*** Structures associated with 'Prf' calls **************************/
  163.       typedef struct _PROGDETAILS    /* progde */
  164.       {
  165.          ULONG     Length;         /* set this to sizeof(PROGDETAILS)  */
  166.          PROGTYPE  progt;
  167.          PSZ       pszTitle;       /* any of the pointers can be NULL  */
  168.          PSZ       pszExecutable;
  169.          PSZ       pszParameters;
  170.          PSZ       pszStartupDir;
  171.          PSZ       pszIcon;
  172.          PSZ       pszEnvironment; /* this is terminated by  /0/0      */
  173.          SWP       swpInitial;     /* this replaces XYWINSIZE          */
  174.       } PROGDETAILS;
  175.       typedef  PROGDETAILS *PPROGDETAILS;
  176.       
  177.       typedef struct _PROGTITLE             /* progti */
  178.       {
  179.          HPROGRAM hprog;
  180.          PROGTYPE progt;
  181.          PSZ      pszTitle;
  182.       } PROGTITLE;
  183.       typedef PROGTITLE *PPROGTITLE;
  184.       
  185.       /*** Program List API Function Definitions ***************************/
  186.       
  187.       
  188.       /*** Program List API available 'Prf' calls **************************/
  189.       
  190.       ULONG APIENTRY PrfQueryProgramTitles(HINI hini,
  191.                                            HPROGRAM hprogGroup,
  192.                                            PPROGTITLE pTitles,
  193.                                            ULONG cchBufferMax,
  194.                                            PULONG pulCount);
  195.       
  196.       /*********************************************************************/
  197.       /*  NOTE: string information is concatanated after the array of      */
  198.       /*        PROGTITLE structures so you need to allocate storage       */
  199.       /*        greater than sizeof(PROGTITLE)*cPrograms to query programs */
  200.       /*        in a group.                                                */
  201.       /*                                                                   */
  202.       /*  PrfQueryProgramTitles recommended usage to obtain titles of all  */
  203.       /*  programs in a group (Hgroup=SGH_ROOT is for all groups):         */
  204.       /*                                                                   */
  205.       /*  BufLen = PrfQueryProgramTitles(Hini, Hgroup,                     */
  206.       /*                                  (PPROGTITLE)NULL, 0, &Count);    */
  207.       /*                                                                   */
  208.       /*  Alocate buffer of  Buflen                                        */
  209.       /*                                                                   */
  210.       /*  Len = PrfQueryProgramTitles(Hini, Hgroup, (PPROGTITLE)pBuffer,   */
  211.       /*                               BufLen, pCount);                    */
  212.       /*                                                                   */
  213.       /*********************************************************************/
  214.       
  215.       HPROGRAM APIENTRY PrfAddProgram(HINI hini,
  216.                                       PPROGDETAILS pDetails,
  217.                                       HPROGRAM hprogGroup);
  218.       
  219.       BOOL     APIENTRY PrfChangeProgram(HINI hini,
  220.                                          HPROGRAM hprog,
  221.                                          PPROGDETAILS pDetails);
  222.       
  223.       ULONG    APIENTRY PrfQueryDefinition(HINI hini,
  224.                                            HPROGRAM hprog,
  225.                                            PPROGDETAILS pDetails,
  226.                                            ULONG cchBufferMax);
  227.       
  228.       /*********************************************************************/
  229.       /*  NOTE: string information is concatanated after the PROGDETAILS   */
  230.       /*        field structure so you need to allocate storage greater    */
  231.       /*        than sizeof(PROGDETAILS) to query programs                 */
  232.       /*                                                                   */
  233.       /*  PrfQueryDefinition recomended usage:                             */
  234.       /*                                                                   */
  235.       /*  bufferlen = PrfQueryDefinition(Hini,Hprog,(PPROGDETAILS)NULL,0)  */
  236.       /*                                                                   */
  237.       /*  Alocate buffer of bufferlen bytes                                */
  238.       /*  set Length field (0 will be supported)                           */
  239.       /*                                                                   */
  240.       /*  (PPROGDETAILS)pBuffer->Length=sizeof(PPROGDETAILS)               */
  241.       /*                                                                   */
  242.       /*  len = PrfQueryDefinition(Hini, Hprog, (PPROGDETAILS)pBuffer,     */
  243.       /*      bufferlen)                                                   */
  244.       /*********************************************************************/
  245.       
  246.       BOOL     APIENTRY PrfRemoveProgram(HINI hini,
  247.                                          HPROGRAM hprog);
  248.       
  249. #ifdef __cplusplus
  250.       ULONG    APIENTRY PrfQueryProgramHandle(HINI hini,
  251.                                               PCSZ  pszExe,
  252.                                               PHPROGARRAY phprogArray,
  253.                                               ULONG cchBufferMax,
  254.                                               PULONG pulCount);
  255. #else
  256.       ULONG    APIENTRY PrfQueryProgramHandle(HINI hini,
  257.                                               PSZ pszExe,
  258.                                               PHPROGARRAY phprogArray,
  259.                                               ULONG cchBufferMax,
  260.                                               PULONG pulCount);
  261. #endif
  262.       
  263. #ifdef __cplusplus
  264.       HPROGRAM APIENTRY PrfCreateGroup(HINI hini,
  265.                                        PCSZ  pszTitle,
  266.                                        UCHAR chVisibility);
  267. #else
  268.       HPROGRAM APIENTRY PrfCreateGroup(HINI hini,
  269.                                        PSZ pszTitle,
  270.                                        UCHAR chVisibility);
  271. #endif
  272.       
  273.       BOOL     APIENTRY PrfDestroyGroup(HINI hini,
  274.                                         HPROGRAM hprogGroup);
  275.       
  276. #ifdef __cplusplus
  277.       PROGCATEGORY  APIENTRY PrfQueryProgramCategory(HINI hini,
  278.                                                      PCSZ  pszExe);
  279. #else
  280.       PROGCATEGORY  APIENTRY PrfQueryProgramCategory(HINI hini,
  281.                                                      PSZ pszExe);
  282. #endif
  283.       
  284. #ifdef __cplusplus
  285.       HAPP APIENTRY WinStartApp(HWND hwndNotify,
  286.                                 PPROGDETAILS pDetails,
  287.                                 PCSZ  pszParams,
  288.                                 PVOID Reserved,
  289.                                 ULONG fbOptions);
  290. #else
  291.       HAPP APIENTRY WinStartApp(HWND hwndNotify,
  292.                                 PPROGDETAILS pDetails,
  293.                                 PSZ pszParams,
  294.                                 PVOID Reserved,
  295.                                 ULONG fbOptions);
  296. #endif
  297.       
  298.       /*** bit values for Options parameter ********************************/
  299.       #define SAF_VALIDFLAGS  0x001F
  300.       
  301.       #define SAF_INSTALLEDCMDLINE  0x0001     /* use installed parameters */
  302.       #define SAF_STARTCHILDAPP     0x0002     /* related application      */
  303.       #define SAF_MAXIMIZED         0x0004     /* Start App maximized */
  304.       #define SAF_MINIMIZED         0x0008     /* Start App minimized, if !SAF_MAXIMIZED */
  305.       #define SAF_BACKGROUND        0x0010     /* Start app in the background */
  306.       
  307.       
  308.       BOOL APIENTRY WinTerminateApp(HAPP happ);
  309.       
  310.    #endif /* end of #ifndef SESMGR */
  311. #endif /* INCL_WINPROGRAMLIST */
  312.  
  313.  
  314. /*** switch list section ***************************************************/
  315.  
  316. typedef LHANDLE HSWITCH;        /* hsw */
  317. typedef HSWITCH *PHSWITCH;
  318.  
  319. #ifndef SESMGR
  320.    #if (defined(INCL_WINSWITCHLIST) || !defined(INCL_NOCOMMON))
  321.       
  322.       typedef struct _SWCNTRL          /* swctl */
  323.       {
  324.          HWND     hwnd;
  325.          HWND     hwndIcon;
  326.          HPROGRAM hprog;
  327.          PID      idProcess;
  328.          ULONG    idSession;
  329.          ULONG    uchVisibility;
  330.          ULONG    fbJump;
  331.          CHAR     szSwtitle[MAXNAMEL+4];
  332.          ULONG    bProgType;
  333.       } SWCNTRL;
  334.       
  335.       typedef SWCNTRL *PSWCNTRL;
  336.       
  337.       /*** visibility flag for SWCNTRL structure ***************************/
  338.       #define SWL_VISIBLE    0x04
  339.       #define SWL_INVISIBLE  0x01
  340.       #define SWL_GRAYED     0x02
  341.       
  342.       /*** jump flag for SWCNTRL structure *********************************/
  343.       #define SWL_JUMPABLE    0x02
  344.       #define SWL_NOTJUMPABLE 0x01
  345.       
  346.       
  347.       /*** Switching Program functions *************************************/
  348.       HSWITCH APIENTRY WinAddSwitchEntry(PSWCNTRL);
  349.       ULONG   APIENTRY WinRemoveSwitchEntry(HSWITCH);
  350.       
  351.    #endif  /* not INCL_NOCOMMON */
  352.    
  353.    #ifdef INCL_WINSWITCHLIST
  354.       
  355.       typedef struct _SWENTRY          /* swent */
  356.       {
  357.          HSWITCH hswitch;
  358.          SWCNTRL swctl;
  359.       } SWENTRY;
  360.       typedef SWENTRY *PSWENTRY;
  361.       
  362.       typedef struct _SWBLOCK          /* swblk */
  363.       {
  364.          ULONG    cswentry;
  365.          SWENTRY aswentry[1];
  366.       } SWBLOCK;
  367.       typedef SWBLOCK *PSWBLOCK;
  368.       
  369.       
  370.       /*** 32-bit versions of these APIs have 32-bit parameters *********/
  371.       ULONG   APIENTRY WinChangeSwitchEntry(HSWITCH hswitchSwitch,
  372.                                             PSWCNTRL pswctlSwitchData);
  373.       
  374.       HSWITCH  APIENTRY WinCreateSwitchEntry(HAB hab,
  375.                                              PSWCNTRL pswctlSwitchData);
  376.       
  377. #ifdef __cplusplus
  378.       ULONG   APIENTRY WinQuerySessionTitle(HAB hab,
  379.                                             ULONG usSession,
  380.                                             PCSZ  pszTitle,
  381.                                             ULONG usTitlelen);
  382. #else
  383.       ULONG   APIENTRY WinQuerySessionTitle(HAB hab,
  384.                                             ULONG usSession,
  385.                                             PSZ pszTitle,
  386.                                             ULONG usTitlelen);
  387. #endif
  388.       
  389.       ULONG   APIENTRY WinQuerySwitchEntry(HSWITCH hswitchSwitch,
  390.                                            PSWCNTRL pswctlSwitchData);
  391.       
  392.       HSWITCH  APIENTRY WinQuerySwitchHandle(HWND hwnd,
  393.                                              PID pidProcess);
  394.       ULONG   APIENTRY WinQuerySwitchList(HAB hab,
  395.                                           PSWBLOCK pswblkSwitchEntries,
  396.                                           ULONG usDataLength);
  397.       
  398.       ULONG   APIENTRY WinQueryTaskSizePos(HAB hab,
  399.                                            ULONG usScreenGroup,
  400.                                            PSWP pswpPositionData);
  401.       
  402. #ifdef __cplusplus
  403.       ULONG   APIENTRY WinQueryTaskTitle(ULONG usSession,
  404.                                          PCSZ  pszTitle,
  405.                                          ULONG usTitlelen);
  406. #else
  407.       ULONG   APIENTRY WinQueryTaskTitle(ULONG usSession,
  408.                                          PSZ pszTitle,
  409.                                          ULONG usTitlelen);
  410. #endif
  411.       
  412.       ULONG   APIENTRY WinSwitchToProgram(HSWITCH hswitchSwHandle);
  413.       
  414.       
  415.    #endif /* end of INCL_WINSWITCHLIST */
  416.    
  417.    #ifdef INCL_WINSHELLDATA
  418.       
  419.       /*** OS2.INI Access functions ****************************************/
  420.       
  421. #ifdef __cplusplus
  422.       LONG   APIENTRY PrfQueryProfileInt(HINI hini,
  423.                                          PCSZ  pszApp,
  424.                                          PCSZ  pszKey,
  425.                                          LONG  sDefault);
  426. #else
  427.       LONG   APIENTRY PrfQueryProfileInt(HINI hini,
  428.                                          PSZ pszApp,
  429.                                          PSZ pszKey,
  430.                                          LONG  sDefault);
  431. #endif
  432.       
  433. #ifdef __cplusplus
  434.       ULONG  APIENTRY PrfQueryProfileString(HINI hini,
  435.                                             PCSZ  pszApp,
  436.                                             PCSZ  pszKey,
  437.                                             PCSZ  pszDefault,
  438.                                             PVOID pBuffer,
  439.                                             ULONG cchBufferMax);
  440. #else
  441.       ULONG  APIENTRY PrfQueryProfileString(HINI hini,
  442.                                             PSZ pszApp,
  443.                                             PSZ pszKey,
  444.                                             PSZ pszDefault,
  445.                                             PVOID pBuffer,
  446.                                             ULONG cchBufferMax);
  447. #endif
  448.       
  449. #ifdef __cplusplus
  450.       BOOL   APIENTRY PrfWriteProfileString(HINI hini,
  451.                                             PCSZ  pszApp,
  452.                                             PCSZ  pszKey,
  453.                                             PCSZ  pszData);
  454. #else
  455.       BOOL   APIENTRY PrfWriteProfileString(HINI hini,
  456.                                             PSZ pszApp,
  457.                                             PSZ pszKey,
  458.                                             PSZ pszData);
  459. #endif
  460.       
  461. #ifdef __cplusplus
  462.       BOOL   APIENTRY PrfQueryProfileSize(HINI hini,
  463.                                           PCSZ  pszApp,
  464.                                           PCSZ  pszKey,
  465.                                           PULONG pulReqLen);
  466. #else
  467.       BOOL   APIENTRY PrfQueryProfileSize(HINI hini,
  468.                                           PSZ pszApp,
  469.                                           PSZ pszKey,
  470.                                           PULONG pulReqLen);
  471. #endif
  472.       
  473. #ifdef __cplusplus
  474.       BOOL   APIENTRY PrfQueryProfileData(HINI hini,
  475.                                           PCSZ  pszApp,
  476.                                           PCSZ  pszKey,
  477.                                           PVOID pBuffer,
  478.                                           PULONG pulBuffLen);
  479. #else
  480.       BOOL   APIENTRY PrfQueryProfileData(HINI hini,
  481.                                           PSZ pszApp,
  482.                                           PSZ pszKey,
  483.                                           PVOID pBuffer,
  484.                                           PULONG pulBuffLen);
  485. #endif
  486.       
  487. #ifdef __cplusplus
  488.       BOOL   APIENTRY PrfWriteProfileData(HINI hini,
  489.                                           PCSZ  pszApp,
  490.                                           PCSZ  pszKey,
  491.                                           PVOID pData,
  492.                                           ULONG cchDataLen);
  493. #else
  494.       BOOL   APIENTRY PrfWriteProfileData(HINI hini,
  495.                                           PSZ pszApp,
  496.                                           PSZ pszKey,
  497.                                           PVOID pData,
  498.                                           ULONG cchDataLen);
  499. #endif
  500.       
  501. #ifdef __cplusplus
  502.       HINI   APIENTRY PrfOpenProfile(HAB hab,
  503.                                      PCSZ  pszFileName);
  504. #else
  505.       HINI   APIENTRY PrfOpenProfile(HAB hab,
  506.                                      PSZ pszFileName);
  507. #endif
  508.       
  509.       BOOL   APIENTRY PrfCloseProfile(HINI hini);
  510.       
  511.       BOOL   APIENTRY PrfReset(HAB hab,
  512.                                PPRFPROFILE pPrfProfile);
  513.       
  514.       BOOL   APIENTRY PrfQueryProfile(HAB hab,
  515.                                       PPRFPROFILE pPrfProfile);
  516.       
  517.       /*** public message, broadcast on WinReset ***************************/
  518.       #define PL_ALTERED 0x008E  /* WM_SHELLFIRST + 0E */
  519.       
  520.    #endif /* INCL_WINSHELLDATA */
  521.    
  522.    #ifdef INCL_SHLERRORS
  523.       #include <pmerr.h>
  524.    #endif /* INCL_SHLERRORS */
  525.    
  526. #endif /* of #ifndef SESMGR */
  527.  
  528.  
  529. /* NOINC */
  530. #ifdef __cplusplus
  531.         }
  532. #endif
  533. #if __IBMC__ || __IBMCPP__
  534.    #pragma info( none )
  535.    #ifndef __CHKHDR__
  536.       #pragma info( restore )
  537.    #endif
  538.    #pragma info( restore )
  539. #endif
  540. /* INC */
  541.  
  542. /**************************** end of file **********************************/
  543.