home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sp15demo.zip / libsrc.zip / LIBSRC / PMSHL.PAS < prev    next >
Pascal/Delphi Source File  |  1996-01-26  |  10KB  |  275 lines

  1. UNIT PMSHL;
  2.  
  3. {****************************** Module Header *****************************
  4. *                                                                         *
  5. * Module Name: PMSHL.PAS                                                  *
  6. *                                                                         *
  7. * OS/2 Presentation Manager Shell constants, types, messages and          *
  8. * function declarations include file.                                     *
  9. *                                                                         *
  10. ***************************************************************************}
  11.  
  12. INTERFACE
  13.  
  14. USES Os2Def;
  15.  
  16.  
  17. { maximum title length }
  18. CONST
  19.      MAXNAMEL =60;
  20.  
  21. { program handle }
  22.  
  23. TYPE
  24.     HPROGRAM=LHANDLE;
  25.     HAPP=LHANDLE;
  26.  
  27. { ini file handle }
  28. TYPE
  29.     HINI=LHANDLE;
  30.  
  31. CONST
  32.    HINI_PROFILE         =0;
  33.    HINI_USERPROFILE     =-1;
  34.    HINI_SYSTEMPROFILE   =-2;
  35.    HINI_USER            =HINI_USERPROFILE;
  36.    HINI_SYSTEM          =HINI_SYSTEMPROFILE;
  37.  
  38. TYPE
  39.     PRFPROFILE=RECORD
  40.                   cchUserName:ULONG;
  41.                   pszUserName:PChar;
  42.                   cchSysName:ULONG;
  43.                   pszSysName:PChar;
  44.                END;
  45.  
  46. CONST
  47.      { maximum path length }
  48.      MAXPATHL =128;
  49.  
  50.      { root group handle }
  51.      SGH_ROOT  =-1;
  52.  
  53. TYPE
  54.      HPROGARRAY=RECORD
  55.                      ahprog:HPROGRAM;
  56.                 END;
  57.  
  58.      PROGCATEGORY=ULONG;
  59.  
  60.    { values acceptable for PROGCATEGORY for PM groups }
  61. CONST
  62.       PROG_DEFAULT             =0;
  63.       PROG_FULLSCREEN          =1;
  64.       PROG_WINDOWABLEVIO       =2;
  65.       PROG_PM                  =3;
  66.       PROG_GROUP               =5;
  67.       PROG_REAL                =4;
  68.       PROG_VDM                 =4;
  69.       PROG_WINDOWEDVDM         =7;
  70.       PROG_DLL                 =6;
  71.       PROG_PDD                 =8;
  72.       PROG_VDD                 =9;
  73.       PROG_WINDOW_REAL         =10;
  74.       PROG_WINDOW_PROT         =11;
  75.       PROG_30_STD              =11;
  76.       PROG_WINDOW_AUTO         =12;
  77.       PROG_SEAMLESSVDM         =13;
  78.       PROG_30_STDSEAMLESSVDM   =13;
  79.       PROG_SEAMLESSCOMMON      =14;
  80.       PROG_30_STDSEAMLESSCOMMON=14;
  81.       PROG_31_STDSEAMLESSVDM   =15;
  82.       PROG_31_STDSEAMLESSCOMMON=16;
  83.       PROG_31_ENHSEAMLESSVDM   =17;
  84.       PROG_31_ENHSEAMLESSCOMMON=18;
  85.       PROG_31_ENH              =19;
  86.       PROG_31_STD              =20;
  87.       PROG_RESERVED            =255;
  88.  
  89. TYPE
  90.       PROGTYPE=RECORD
  91.                     progc:PROGCATEGORY;
  92.                     fbVisible:ULONG;
  93.                END;
  94.  
  95.       { visibility flag for PROGTYPE structue }
  96. CONST
  97.       SHE_VISIBLE         =$00;
  98.       SHE_INVISIBLE       =$01;
  99.       SHE_RESERVED        =$FF;
  100.  
  101.       { Protected group flag for PROGTYPE structure }
  102.       SHE_UNPROTECTED     =$00;
  103.       SHE_PROTECTED       =$02;
  104.  
  105.       { Structures associated with 'Prf' calls }
  106. TYPE
  107.       PROGDETAILS=RECORD
  108.                        Length:ULONG;
  109.                        progt:PROGTYPE;
  110.                        pszTitle:PChar;
  111.                        pszExecutable:PChar;
  112.                        pszParameters:PChar;
  113.                        pszStartupDir:PChar;
  114.                        pszIcon:PChar;
  115.                        pszEnvironment:PChar;
  116.                        swpInitial:SWP;
  117.                   END;
  118.  
  119.       PROGTITLE=RECORD
  120.                       hprog:HPROGRAM;
  121.                       progt:PROGTYPE;
  122.                       pszTitle:PChar;
  123.                 END;
  124.       { bit values for Options parameter }
  125. CONST
  126.       SAF_VALIDFLAGS        =$001F;
  127.  
  128.       SAF_INSTALLEDCMDLINE  =$0001;     { use installed parameters }
  129.       SAF_STARTCHILDAPP     =$0002;     { related application      }
  130.       SAF_MAXIMIZED         =$0004;     { Start App maximized      }
  131.       SAF_MINIMIZED         =$0008;     { Start App minimized, if !SAF_MAXIMIZED }
  132.       SAF_BACKGROUND        =$0010;     { Start app in the background }
  133.  
  134.  
  135.  
  136. { switch list section }
  137.  
  138. TYPE
  139.     HSWITCH=LHANDLE;
  140.  
  141.     PSWCNTRL=^SWCNTRL;
  142.     SWCNTRL=RECORD
  143.                  hwnd:HWND;
  144.                  hwndIcon:HWND;
  145.                  hprog:HPROGRAM;
  146.                  idProcess:PID;
  147.                  idSession:ULONG;
  148.                  uchVisibility:ULONG;
  149.                  fbJump:ULONG;
  150.                  szSwtitle:CSTRING[MAXNAMEL+3];
  151.                  bProgType:ULONG;
  152.             END;
  153.  
  154. { visibility flag for SWCNTRL structure }
  155. CONST
  156.      SWL_VISIBLE     =$04;
  157.      SWL_INVISIBLE   =$01;
  158.      SWL_GRAYED      =$02;
  159.  
  160. { jump flag for SWCNTRL structure }
  161.      SWL_JUMPABLE    =$02;
  162.      SWL_NOTJUMPABLE =$01;
  163.  
  164. TYPE
  165.     PSWENTRY=^SWENTRY;
  166.     SWENTRY=RECORD
  167.                   hswitch:HSWITCH;
  168.                   swctl:SWCNTRL;
  169.             END;
  170.  
  171.     PSWBLOCK=^SWBLOCK;
  172.     SWBLOCK=RECORD
  173.                   cswentry:ULONG;
  174.                   swentry:SWENTRY;
  175.             END;
  176.  
  177. CONST
  178.      PL_ALTERED =$008E;  { WM_SHELLFIRST + 0E }
  179.  
  180.  
  181. IMPORTS
  182.  
  183. FUNCTION WinAddSwitchEntry(VAR aps:SWCNTRL):HSWITCH;
  184.                     APIENTRY;         PMSHAPI index 120;
  185. FUNCTION WinRemoveSwitchEntry(ah:HSWITCH):ULONG;
  186.                     APIENTRY;         PMSHAPI index 129;
  187. FUNCTION PrfQueryProgramTitles(ahini:HINI;hprogGroup:HPROGRAM;
  188.                                VAR pTitles:PROGTITLE;cchBufferMax:ULONG;
  189.                                VAR pulCount:ULONG):ULONG;
  190.                     APIENTRY;         PMSHAPI index 113;
  191. FUNCTION PrfAddProgram(ahini:HINI;VAR pDetails:PROGDETAILS;
  192.                        hprogGroup:HPROGRAM):HPROGRAM;
  193.                     APIENTRY;         PMSHAPI index 109;
  194. FUNCTION PrfChangeProgram(ahini:HINI;hprog:HPROGRAM;
  195.                           VAR pDetails:PROGDETAILS):BOOL;
  196.                     APIENTRY;         PMSHAPI index 110;
  197. FUNCTION PrfQueryDefinition(ahini:HINI;hprog:HPROGRAM;
  198.                             VAR pDetails:PROGDETAILS;
  199.                             cchBufferMax:ULONG):ULONG;
  200.                     APIENTRY;         PMSHAPI index 111;
  201. FUNCTION PrfRemoveProgram(ahini:HINI;hprog:HPROGRAM):BOOL;
  202.                     APIENTRY;         PMSHAPI index 104;
  203. FUNCTION PrfQueryProgramHandle(ahini:HINI;CONST pszExe:CSTRING;
  204.                                aphprogArray:HPROGARRAY;cchBufferMax:ULONG;
  205.                                VAR pulCount:ULONG):BOOL;
  206.                     APIENTRY;         PMSHAPI index 58;
  207. FUNCTION PrfCreateGroup(ahini:HINI;CONST pszTitle:CSTRING;
  208.                         chVisibility:UCHAR):HPROGRAM;
  209.                     APIENTRY;         PMSHAPI index 55;
  210. FUNCTION PrfDestroyGroup(ahini:HINI;hprogGroup:HPROGRAM):BOOL;
  211.                     APIENTRY;         PMSHAPI index 106;
  212. FUNCTION PrfQueryProgramCategory(ahini:HINI;CONST pszExe:CSTRING):PROGCATEGORY;
  213.                     APIENTRY;         PMSHAPI index 59;
  214. FUNCTION WinStartApp(hwndNotify:HWND;VAR pDetails:PROGDETAILS;CONST pszParams:CSTRING;
  215.                      Reserved:POINTER;fbOptions:ULONG):HAPP;
  216.                     APIENTRY;         PMSHAPI index 119;
  217. FUNCTION WinTerminateApp(ahapp:HAPP):BOOL;
  218.                     APIENTRY;         PMSHAPI index 130;
  219. FUNCTION WinChangeSwitchEntry(hswitchSwitch:HSWITCH;
  220.                               VAR pswctlSwitchData:SWCNTRL):ULONG;
  221.                     APIENTRY;         PMSHAPI index 123;
  222. FUNCTION WinCreateSwitchEntry(ahab:HAB;VAR pswctlSwitchData:SWCNTRL):HSWITCH;
  223.                     APIENTRY;         PMSHAPI index 121;
  224. FUNCTION WinQuerySessionTitle(ahab:HAB;usSession:ULONG;VAR pszTitle:CSTRING;
  225.                               usTitlelen:ULONG):ULONG;
  226.                     APIENTRY;         PMSHAPI index 122;
  227. FUNCTION WinQuerySwitchEntry(hswitchSwitch:HSWITCH;
  228.                              VAR pswctlSwitchData:SWCNTRL):ULONG;
  229.                     APIENTRY;         PMSHAPI index 124;
  230. FUNCTION WinQuerySwitchHandle(ahwnd:HWND;pidProcess:PID):HSWITCH;
  231.                     APIENTRY;         PMSHAPI index 125;
  232. FUNCTION WinQuerySwitchList(ahab:HAB;VAR pswblkSwitchEntries:SWBLOCK;
  233.                             usDataLength:ULONG):ULONG;
  234.                     APIENTRY;         PMSHAPI index 126;
  235. FUNCTION WinQueryTaskSizePos(ahab:HAB;usScreenGroup:ULONG;
  236.                              VAR pswpPositionData:SWP):ULONG;
  237.                     APIENTRY;         PMSHAPI index 127;
  238. FUNCTION WinQueryTaskTitle(usSession:ULONG;VAR pszTitle:CSTRING;
  239.                            usTitlelen:ULONG):ULONG;
  240.                     APIENTRY;         PMSHAPI index 128;
  241. FUNCTION WinSwitchToProgram(hswitchSwHandle:HSWITCH):ULONG;
  242.                     APIENTRY;         PMSHAPI index 131;
  243. FUNCTION PrfQueryProfileInt(ahini:HINI;CONST pszApp,pszKey:CSTRING;
  244.                             sDefault:LONG):LONG;
  245.                     APIENTRY;         PMSHAPI index 114;
  246. FUNCTION PrfQueryProfileString(ahini:HINI;CONST pszApp,pszKey,pszDefault:CSTRING;
  247.                                VAR pBuffer;cchBufferMax:ULONG):ULONG;
  248.                     APIENTRY;         PMSHAPI index 115;
  249. FUNCTION PrfWriteProfileString(ahini:HINI;CONST pszApp,pszKey,pszData:CSTRING):BOOL;
  250.                     APIENTRY;         PMSHAPI index 116;
  251. FUNCTION PrfQueryProfileSize(ahini:HINI;CONST pszApp,pszKey:CSTRING;
  252.                              VAR pulReqLen:ULONG):BOOL;
  253.                     APIENTRY;         PMSHAPI index 101;
  254. FUNCTION PrfQueryProfileData(ahini:HINI;CONST pszApp,pszKey:CSTRING;VAR pBuffer;
  255.                              VAR pulBuffLen:ULONG):BOOL;
  256.                     APIENTRY;         PMSHAPI index 117;
  257. FUNCTION PrfWriteProfileData(ahini:HINI;CONST pszApp,pszKey:CSTRING;VAR pData;
  258.                              cchDataLen:ULONG):BOOL;
  259.                     APIENTRY;         PMSHAPI index 118;
  260. FUNCTION PrfOpenProfile(ahab:HAB;CONST pszFileName:CSTRING):HINI;
  261.                     APIENTRY;         PMSHAPI index 102;
  262. FUNCTION PrfCloseProfile(ahini:HINI):BOOL;
  263.                     APIENTRY;         PMSHAPI index 103;
  264. FUNCTION PrfReset(ahab:HAB;VAR apPrfProfile:PRFPROFILE):BOOL;
  265.                     APIENTRY;         PMSHAPI index 108;
  266. FUNCTION PrfQueryProfile(ahab:HAB;VAR apPrfProfile:PRFPROFILE):BOOL;
  267.                     APIENTRY;         PMSHAPI index 107;
  268.  
  269. END;
  270.  
  271.  
  272. IMPLEMENTATION
  273.  
  274. BEGIN
  275. END.