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