home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / PMSHL.H < prev    next >
C/C++ Source or Header  |  1995-08-30  |  21KB  |  539 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. #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. /* XLATON */
  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_RESERVED            (PROGCATEGORY)255
  137.    
  138.    #ifndef SESMGR
  139.       
  140.       typedef struct _PROGTYPE         /* progt */
  141.       {
  142.          PROGCATEGORY progc;
  143.          ULONG        fbVisible;
  144.       } PROGTYPE;
  145.       typedef PROGTYPE *PPROGTYPE;
  146.       
  147.       
  148.       /*** visibility flag for PROGTYPE structure **************************/
  149.       #define SHE_VISIBLE         0x00
  150.       #define SHE_INVISIBLE       0x01
  151.       #define SHE_RESERVED        0xFF
  152.       
  153.       /*** Protected group flag for PROGTYPE structure *********************/
  154.       #define SHE_UNPROTECTED     0x00
  155.       #define SHE_PROTECTED       0x02
  156.       
  157.       
  158.       
  159.       /*** Structures associated with 'Prf' calls **************************/
  160.       typedef struct _PROGDETAILS    /* progde */
  161.       {
  162.          ULONG     Length;         /* set this to sizeof(PROGDETAILS)  */
  163.          PROGTYPE  progt;
  164.          PSZ       pszTitle;       /* any of the pointers can be NULL  */
  165.          PSZ       pszExecutable;
  166.          PSZ       pszParameters;
  167.          PSZ       pszStartupDir;
  168.          PSZ       pszIcon;
  169.          PSZ       pszEnvironment; /* this is terminated by  /0/0      */
  170.          SWP       swpInitial;     /* this replaces XYWINSIZE          */
  171.       } PROGDETAILS;
  172.       typedef  PROGDETAILS *PPROGDETAILS;
  173.       
  174.       typedef struct _PROGTITLE             /* progti */
  175.       {
  176.          HPROGRAM hprog;
  177.          PROGTYPE progt;
  178.          PSZ      pszTitle;
  179.       } PROGTITLE;
  180.       typedef PROGTITLE *PPROGTITLE;
  181.       
  182.       /*** Program List API Function Definitions ***************************/
  183.       
  184.       
  185.       /*** Program List API available 'Prf' calls **************************/
  186.       
  187.       ULONG APIENTRY PrfQueryProgramTitles(HINI hini,
  188.                                            HPROGRAM hprogGroup,
  189.                                            PPROGTITLE pTitles,
  190.                                            ULONG cchBufferMax,
  191.                                            PULONG pulCount);
  192.       
  193.       /*********************************************************************/
  194.       /*  NOTE: string information is concatanated after the array of      */
  195.       /*        PROGTITLE structures so you need to allocate storage       */
  196.       /*        greater than sizeof(PROGTITLE)*cPrograms to query programs */
  197.       /*        in a group.                                                */
  198.       /*                                                                   */
  199.       /*  PrfQueryProgramTitles recommended usage to obtain titles of all  */
  200.       /*  programs 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,   */
  208.       /*                               BufLen, pCount);                    */
  209.       /*                                                                   */
  210.       /*********************************************************************/
  211.       
  212.       HPROGRAM APIENTRY PrfAddProgram(HINI hini,
  213.                                       PPROGDETAILS pDetails,
  214.                                       HPROGRAM hprogGroup);
  215.       
  216.       BOOL     APIENTRY PrfChangeProgram(HINI hini,
  217.                                          HPROGRAM hprog,
  218.                                          PPROGDETAILS pDetails);
  219.       
  220.       ULONG    APIENTRY PrfQueryDefinition(HINI hini,
  221.                                            HPROGRAM hprog,
  222.                                            PPROGDETAILS pDetails,
  223.                                            ULONG cchBufferMax);
  224.       
  225.       /*********************************************************************/
  226.       /*  NOTE: string information is concatanated after the PROGDETAILS   */
  227.       /*        field structure so you need to allocate storage greater    */
  228.       /*        than sizeof(PROGDETAILS) to query programs                 */
  229.       /*                                                                   */
  230.       /*  PrfQueryDefinition recomended usage:                             */
  231.       /*                                                                   */
  232.       /*  bufferlen = PrfQueryDefinition(Hini,Hprog,(PPROGDETAILS)NULL,0)  */
  233.       /*                                                                   */
  234.       /*  Alocate buffer of bufferlen bytes                                */
  235.       /*  set Length field (0 will be supported)                           */
  236.       /*                                                                   */
  237.       /*  (PPROGDETAILS)pBuffer->Length=sizeof(PPROGDETAILS)               */
  238.       /*                                                                   */
  239.       /*  len = PrfQueryDefinition(Hini, Hprog, (PPROGDETAILS)pBuffer,     */
  240.       /*      bufferlen)                                                   */
  241.       /*********************************************************************/
  242.       
  243.       BOOL     APIENTRY PrfRemoveProgram(HINI hini,
  244.                                          HPROGRAM hprog);
  245.       
  246. #ifdef __cplusplus
  247.       ULONG    APIENTRY PrfQueryProgramHandle(HINI hini,
  248.                                               PCSZ  pszExe,
  249.                                               PHPROGARRAY phprogArray,
  250.                                               ULONG cchBufferMax,
  251.                                               PULONG pulCount);
  252. #else
  253.       ULONG    APIENTRY PrfQueryProgramHandle(HINI hini,
  254.                                               PSZ pszExe,
  255.                                               PHPROGARRAY phprogArray,
  256.                                               ULONG cchBufferMax,
  257.                                               PULONG pulCount);
  258. #endif
  259.       
  260. #ifdef __cplusplus
  261.       HPROGRAM APIENTRY PrfCreateGroup(HINI hini,
  262.                                        PCSZ  pszTitle,
  263.                                        UCHAR chVisibility);
  264. #else
  265.       HPROGRAM APIENTRY PrfCreateGroup(HINI hini,
  266.                                        PSZ pszTitle,
  267.                                        UCHAR chVisibility);
  268. #endif
  269.       
  270.       BOOL     APIENTRY PrfDestroyGroup(HINI hini,
  271.                                         HPROGRAM hprogGroup);
  272.       
  273. #ifdef __cplusplus
  274.       PROGCATEGORY  APIENTRY PrfQueryProgramCategory(HINI hini,
  275.                                                      PCSZ  pszExe);
  276. #else
  277.       PROGCATEGORY  APIENTRY PrfQueryProgramCategory(HINI hini,
  278.                                                      PSZ pszExe);
  279. #endif
  280.       
  281. #ifdef __cplusplus
  282.       HAPP APIENTRY WinStartApp(HWND hwndNotify,
  283.                                 PPROGDETAILS pDetails,
  284.                                 PCSZ  pszParams,
  285.                                 PVOID Reserved,
  286.                                 ULONG fbOptions);
  287. #else
  288.       HAPP APIENTRY WinStartApp(HWND hwndNotify,
  289.                                 PPROGDETAILS pDetails,
  290.                                 PSZ pszParams,
  291.                                 PVOID Reserved,
  292.                                 ULONG fbOptions);
  293. #endif
  294.       
  295.       /*** bit values for Options parameter ********************************/
  296.       #define SAF_VALIDFLAGS  0x001F
  297.       
  298.       #define SAF_INSTALLEDCMDLINE  0x0001     /* use installed parameters */
  299.       #define SAF_STARTCHILDAPP     0x0002     /* related application      */
  300.       #define SAF_MAXIMIZED         0x0004     /* Start App maximized */
  301.       #define SAF_MINIMIZED         0x0008     /* Start App minimized, if !SAF_MAXIMIZED */
  302.       #define SAF_BACKGROUND        0x0010     /* Start app in the background */
  303.       
  304.       
  305.       BOOL APIENTRY WinTerminateApp(HAPP happ);
  306.       
  307.    #endif /* end of #ifndef SESMGR */
  308. #endif /* INCL_WINPROGRAMLIST */
  309.  
  310.  
  311. /*** switch list section ***************************************************/
  312.  
  313. typedef LHANDLE HSWITCH;        /* hsw */
  314. typedef HSWITCH *PHSWITCH;
  315.  
  316. #ifndef SESMGR
  317.    #if (defined(INCL_WINSWITCHLIST) || !defined(INCL_NOCOMMON))
  318.       
  319.       typedef struct _SWCNTRL          /* swctl */
  320.       {
  321.          HWND     hwnd;
  322.          HWND     hwndIcon;
  323.          HPROGRAM hprog;
  324.          PID      idProcess;
  325.          ULONG    idSession;
  326.          ULONG    uchVisibility;
  327.          ULONG    fbJump;
  328.          CHAR     szSwtitle[MAXNAMEL+4];
  329.          ULONG    bProgType;
  330.       } SWCNTRL;
  331.       
  332.       typedef SWCNTRL *PSWCNTRL;
  333.       
  334.       /*** visibility flag for SWCNTRL structure ***************************/
  335.       #define SWL_VISIBLE    0x04
  336.       #define SWL_INVISIBLE  0x01
  337.       #define SWL_GRAYED     0x02
  338.       
  339.       /*** jump flag for SWCNTRL structure *********************************/
  340.       #define SWL_JUMPABLE    0x02
  341.       #define SWL_NOTJUMPABLE 0x01
  342.       
  343.       
  344.       /*** Switching Program functions *************************************/
  345.       HSWITCH APIENTRY WinAddSwitchEntry(PSWCNTRL);
  346.       ULONG   APIENTRY WinRemoveSwitchEntry(HSWITCH);
  347.       
  348.    #endif  /* not INCL_NOCOMMON */
  349.    
  350.    #ifdef INCL_WINSWITCHLIST
  351.       
  352.       typedef struct _SWENTRY          /* swent */
  353.       {
  354.          HSWITCH hswitch;
  355.          SWCNTRL swctl;
  356.       } SWENTRY;
  357.       typedef SWENTRY *PSWENTRY;
  358.       
  359.       typedef struct _SWBLOCK          /* swblk */
  360.       {
  361.          ULONG    cswentry;
  362.          SWENTRY aswentry[1];
  363.       } SWBLOCK;
  364.       typedef SWBLOCK *PSWBLOCK;
  365.       
  366.       
  367.       /*** 32-bit versions of these APIs have 32-bit parameters *********/
  368.       ULONG   APIENTRY WinChangeSwitchEntry(HSWITCH hswitchSwitch,
  369.                                             PSWCNTRL pswctlSwitchData);
  370.       
  371.       HSWITCH  APIENTRY WinCreateSwitchEntry(HAB hab,
  372.                                              PSWCNTRL pswctlSwitchData);
  373.       
  374. #ifdef __cplusplus
  375.       ULONG   APIENTRY WinQuerySessionTitle(HAB hab,
  376.                                             ULONG usSession,
  377.                                             PCSZ  pszTitle,
  378.                                             ULONG usTitlelen);
  379. #else
  380.       ULONG   APIENTRY WinQuerySessionTitle(HAB hab,
  381.                                             ULONG usSession,
  382.                                             PSZ pszTitle,
  383.                                             ULONG usTitlelen);
  384. #endif
  385.       
  386.       ULONG   APIENTRY WinQuerySwitchEntry(HSWITCH hswitchSwitch,
  387.                                            PSWCNTRL pswctlSwitchData);
  388.       
  389.       HSWITCH  APIENTRY WinQuerySwitchHandle(HWND hwnd,
  390.                                              PID pidProcess);
  391.       ULONG   APIENTRY WinQuerySwitchList(HAB hab,
  392.                                           PSWBLOCK pswblkSwitchEntries,
  393.                                           ULONG usDataLength);
  394.       
  395.       ULONG   APIENTRY WinQueryTaskSizePos(HAB hab,
  396.                                            ULONG usScreenGroup,
  397.                                            PSWP pswpPositionData);
  398.       
  399. #ifdef __cplusplus
  400.       ULONG   APIENTRY WinQueryTaskTitle(ULONG usSession,
  401.                                          PCSZ  pszTitle,
  402.                                          ULONG usTitlelen);
  403. #else
  404.       ULONG   APIENTRY WinQueryTaskTitle(ULONG usSession,
  405.                                          PSZ pszTitle,
  406.                                          ULONG usTitlelen);
  407. #endif
  408.       
  409.       ULONG   APIENTRY WinSwitchToProgram(HSWITCH hswitchSwHandle);
  410.       
  411.       
  412.    #endif /* end of INCL_WINSWITCHLIST */
  413.    
  414.    #ifdef INCL_WINSHELLDATA
  415.       
  416.       /*** OS2.INI Access functions ****************************************/
  417.       
  418. #ifdef __cplusplus
  419.       LONG   APIENTRY PrfQueryProfileInt(HINI hini,
  420.                                          PCSZ  pszApp,
  421.                                          PCSZ  pszKey,
  422.                                          LONG  sDefault);
  423. #else
  424.       LONG   APIENTRY PrfQueryProfileInt(HINI hini,
  425.                                          PSZ pszApp,
  426.                                          PSZ pszKey,
  427.                                          LONG  sDefault);
  428. #endif
  429.       
  430. #ifdef __cplusplus
  431.       ULONG  APIENTRY PrfQueryProfileString(HINI hini,
  432.                                             PCSZ  pszApp,
  433.                                             PCSZ  pszKey,
  434.                                             PCSZ  pszDefault,
  435.                                             PVOID pBuffer,
  436.                                             ULONG cchBufferMax);
  437. #else
  438.       ULONG  APIENTRY PrfQueryProfileString(HINI hini,
  439.                                             PSZ pszApp,
  440.                                             PSZ pszKey,
  441.                                             PSZ pszDefault,
  442.                                             PVOID pBuffer,
  443.                                             ULONG cchBufferMax);
  444. #endif
  445.       
  446. #ifdef __cplusplus
  447.       BOOL   APIENTRY PrfWriteProfileString(HINI hini,
  448.                                             PCSZ  pszApp,
  449.                                             PCSZ  pszKey,
  450.                                             PCSZ  pszData);
  451. #else
  452.       BOOL   APIENTRY PrfWriteProfileString(HINI hini,
  453.                                             PSZ pszApp,
  454.                                             PSZ pszKey,
  455.                                             PSZ pszData);
  456. #endif
  457.       
  458. #ifdef __cplusplus
  459.       BOOL   APIENTRY PrfQueryProfileSize(HINI hini,
  460.                                           PCSZ  pszApp,
  461.                                           PCSZ  pszKey,
  462.                                           PULONG pulReqLen);
  463. #else
  464.       BOOL   APIENTRY PrfQueryProfileSize(HINI hini,
  465.                                           PSZ pszApp,
  466.                                           PSZ pszKey,
  467.                                           PULONG pulReqLen);
  468. #endif
  469.       
  470. #ifdef __cplusplus
  471.       BOOL   APIENTRY PrfQueryProfileData(HINI hini,
  472.                                           PCSZ  pszApp,
  473.                                           PCSZ  pszKey,
  474.                                           PVOID pBuffer,
  475.                                           PULONG pulBuffLen);
  476. #else
  477.       BOOL   APIENTRY PrfQueryProfileData(HINI hini,
  478.                                           PSZ pszApp,
  479.                                           PSZ pszKey,
  480.                                           PVOID pBuffer,
  481.                                           PULONG pulBuffLen);
  482. #endif
  483.       
  484. #ifdef __cplusplus
  485.       BOOL   APIENTRY PrfWriteProfileData(HINI hini,
  486.                                           PCSZ  pszApp,
  487.                                           PCSZ  pszKey,
  488.                                           PVOID pData,
  489.                                           ULONG cchDataLen);
  490. #else
  491.       BOOL   APIENTRY PrfWriteProfileData(HINI hini,
  492.                                           PSZ pszApp,
  493.                                           PSZ pszKey,
  494.                                           PVOID pData,
  495.                                           ULONG cchDataLen);
  496. #endif
  497.       
  498. #ifdef __cplusplus
  499.       HINI   APIENTRY PrfOpenProfile(HAB hab,
  500.                                      PCSZ  pszFileName);
  501. #else
  502.       HINI   APIENTRY PrfOpenProfile(HAB hab,
  503.                                      PSZ pszFileName);
  504. #endif
  505.       
  506.       BOOL   APIENTRY PrfCloseProfile(HINI hini);
  507.       
  508.       BOOL   APIENTRY PrfReset(HAB hab,
  509.                                PPRFPROFILE pPrfProfile);
  510.       
  511.       BOOL   APIENTRY PrfQueryProfile(HAB hab,
  512.                                       PPRFPROFILE pPrfProfile);
  513.       
  514.       /*** public message, broadcast on WinReset ***************************/
  515.       #define PL_ALTERED 0x008E  /* WM_SHELLFIRST + 0E */
  516.       
  517.    #endif /* INCL_WINSHELLDATA */
  518.    
  519.    #ifdef INCL_SHLERRORS
  520.       #include <pmerr.h>
  521.    #endif /* INCL_SHLERRORS */
  522.    
  523. #endif /* of #ifndef SESMGR */
  524.  
  525. /* XLATOFF */
  526. #ifdef __cplusplus
  527.         }
  528. #endif
  529. #if __IBMC__ || __IBMCPP__
  530.    #pragma info( none )
  531.    #ifndef __CHKHDR__
  532.       #pragma info( restore )
  533.    #endif
  534.    #pragma info( restore )
  535. #endif
  536. /* XLATON */
  537.  
  538. /**************************** end of file **********************************/
  539.