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