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