home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / IBMH / PMSHL.H < prev    next >
C/C++ Source or Header  |  1995-04-14  |  19KB  |  452 lines

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