home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource1
/
program3
/
pmshl.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-23
|
18KB
|
413 lines
{*****************************************************************************\
*
* Module Name: PMSHL.H
*
* OS/2 Presentation Manager Shell constants, types, messages and
* function declarations
*
* Copyright (c) International Business Machines Corporation 1981, 1988-1990
*
\*****************************************************************************}
{| Version: 1.00
| Original translation: Peter Sawatzki ps
| Contributing:
| Peter Sawatzki ps
|
| change history:
| Date: Ver: Author:
| 11/11/93 1.00 ps original translation by ps
}
Unit PmShl;
Interface
Uses
Os2Def,
PmWin;
Const
{ common types, constants and function declarations }
{ maximum title length }
MAXNAMEL = 60;
Type
{ window size structure }
XYWINSIZE = Record
x,y,cx,cy: SHORT;
fsWindow: USHORT
End;
pXYWINSIZE = ^XYWINSIZE;
Const
{ Definitions for fsWindow }
XYF_NOAUTOCLOSE= $0008;
XYF_MINIMIZED = $0004; { D23914 }
XYF_MAXIMIZED = $0002; { D23914 }
XYF_INVISIBLE = $0001;
XYF_NORMAL = $0000;
Type
{ program handle }
HPROGRAM = LHANDLE; { hprog }
pHPROGRAM = ^HPROGRAM;
{ ini file handle }
HINI = LHANDLE; { hini }
pHINI = ^HINI;
Const
HINI_PROFILE = NULL;
HINI_USERPROFILE = -1;
HINI_SYSTEMPROFILE = -2;
HINI_USER = HINI_USERPROFILE;
HINI_SYSTEM = HINI_SYSTEMPROFILE;
Type
PRFPROFILE = Record
cchUserName: ULONG;
pszUserName: pSZ;
cchSysName: ULONG;
pszSysName: pSZ
End;
pPRFPROFILE = ^PRFPROFILE;
Const
{ maximum path length }
MAXPATHL = 128;
{ root group handle }
SGH_ROOT = HPROGRAM(-1);
Type
HPROGARRAY = Record
ahprog: Array[0..0] Of HPROGRAM
End;
pHPROGARRAY = ^HPROGARRAY;
PROGCATEGORY = Char;
pPROGCATEGORY = pChar;
Const
{ values acceptable for PROGCATEGORY for PM groups }
PROG_DEFAULT = PROGCATEGORY(0 );
PROG_FULLSCREEN = PROGCATEGORY(1 );
PROG_WINDOWABLEVIO = PROGCATEGORY(2 );
PROG_PM = PROGCATEGORY(3 );
PROG_GROUP = PROGCATEGORY(5 );
PROG_REAL = PROGCATEGORY(4 );{ was 7 }
PROG_DLL = PROGCATEGORY(6 );
PROG_RESERVED = PROGCATEGORY(255);
{ visibility flag for PROGTYPE structure }
SHE_VISIBLE = $00;
SHE_INVISIBLE = $01;
SHE_RESERVED = $FF;
{ Protected group flag for PROGTYPE structure }
SHE_UNPROTECTED = $00;
SHE_PROTECTED = $02;
Type
PROGTYPE = Record
progc: PROGCATEGORY;
fbVisible: UCHAR
End;
pPROGTYPE = ^PROGTYPE;
PROGRAMENTRY = Record
hprog: HPROGRAM;
progt: PROGTYPE;
szTitle: Array[0..MAXNAMEL] Of Char
End;
pPROGRAMENTRY = ^PROGRAMENTRY;
PIBSTRUCT = Record
progt: PROGTYPE;
szTitle: Array[0..MAXNAMEL] Of Char;
szIconFileName,
szExecutable,
szStartupDir: Array[0..MAXPATHL] Of Char;
xywinInitial: XYWINSIZE;
res1: USHORT;
res2: LHANDLE;
cchEnvironmentVars: USHORT;
pchEnvironmentVars: pCH;
cchProgramParameter: USHORT;
pchProgramParameter: pCH
End;
pPIBSTRUCT = ^PIBSTRUCT;
{****************************************************************************}
{ }
{ Structures associated with 'Prf' calls }
{ }
{****************************************************************************}
PROGDETAILS = Record
_Length: ULONG; { set this to sizeof(PROGDETAILS) }
progt: PROGTYPE;
pad1: Array[0..2] Of USHORT; { ready for 32-bit PROGTYPE }
pszTitle, { any of the pointers can be NULL }
pszExecutable,
pszParameters,
pszStartupDir,
pszIcon,
pszEnvironment:pSZ; { this is terminated by /0/0 }
swpInitial: SWP; { this replaces XYWINSIZE }
pad2: Array[0..4] Of USHORT;{ ready for 32-bit SWP }
End;
pPROGDETAILS = ^PROGDETAILS;
PROGTITLE = Record
hprog: HPROGRAM;
progt: PROGTYPE;
pad1: Array[0..2] Of USHORT; { padding ready for 32-bit PROGTYPE }
pszTitle: pSZ
End;
pPROGTITLE = ^PROGTITLE;
QFEOUTBLK = Record
Total,
Count: USHORT;
ProgramArr: Array[0..0] Of HPROGRAM
End;
pQFEOUTBLK = ^QFEOUTBLK;
{ Program List API Function Definitions }
{** Program Use }
Function WinQueryProgramTitles(_hab: HAB; hprogGroup: HPROGRAM;
aprogeBuffer: PPROGRAMENTRY; usBufferLen: USHORT; pusTotal: PUSHORT): BOOL;
{** Single Program Manipulation }
Function WinAddProgram(_hab: HAB; ppibProgramInfo: PPIBSTRUCT;
hprogGroupHandle: HPROGRAM): HPROGRAM;
Function WinQueryDefinition(_hab: HAB; hprogProgHandle: HPROGRAM;
ppibProgramInfo: PPIBSTRUCT; usMaxLength: USHORT): USHORT;
{** Group Manipulation }
Function WinCreateGroup(_hab: HAB; pszTitle: PSZ; ucVisibility: UCHAR;
flres1, flres2: ULONG): HPROGRAM;
{****************************************************************************}
{ }
{ Program List API available 'Prf' calls }
{ }
{****************************************************************************}
Function PrfQueryProgramTitles(_hini: HINI; hprogGroup: HPROGRAM;
pTitles: PPROGTITLE; cchBufferMax: ULONG; pulCount: PULONG): ULONG;
{***************************************************************************}
{ }
{ NOTE: string information is concatanated after the array of PROGTITLE }
{ structures so you need to allocate storage greater than }
{ sizeof(PROGTITLE)*cPrograms to query programs in a group }
{ }
{ PrfQueryProgramTitles recommended usage to obtain titles of all progams }
{ in a group (Hgroup=SGH_ROOT is for all groups): }
{ }
{ BufLen = PrfQueryProgramTitles( Hini, Hgroup }
{ , (PPROGTITLE)NULL, 0, &Count); }
{ }
{ Alocate buffer of Buflen }
{ }
{ Len = PrfQueryProgramTitles( Hini, Hgroup, (PPROGTITLE)pBuffer, BufLen }
{ , pCount); }
{ }
{***************************************************************************}
Function PrfAddProgram (_hini: HINI; pDetails: PPROGDETAILS;
hprogGroup: HPROGRAM): HPROGRAM;
Function PrfChangeProgram (_hini: HINI; hprog: HPROGRAM; pDetails: PPROGDETAILS): BOOL;
{*************************************************************************}
{ when adding/changing programs the PROGDETAILS Length field should be }
{ set to sizeof(PROGDETAILS) }
{*************************************************************************}
Function PrfQueryDefinition (_hini: HINI; hprog: HPROGRAM;
pDetails: PPROGDETAILS; cchBufferMax: ULONG): ULONG;
{***************************************************************************}
{ }
{ NOTE: string information is concatanated after the PROGDETAILS field }
{ structure