home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 December / SOFM_Dec1995.bin / pc / os2 / vpascal / source / rtl / os2pmapi.pas < prev    next >
Pascal/Delphi Source File  |  1995-10-31  |  324KB  |  7,980 lines

  1. {█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
  2. {█                                                       █}
  3. {█      Virtual Pascal Runtime Library.  Version 1.0.    █}
  4. {█      OS/2 Presentation Manager API interface          █}
  5. {█      ─────────────────────────────────────────────────█}
  6. {█      Copyright (C) 1995 B&M&T Corporation             █}
  7. {█      ─────────────────────────────────────────────────█}
  8. {█      Written by Vitaly Miryanov                       █}
  9. {█                                                       █}
  10. {▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  11.  
  12. {$Cdecl+,AlignRec-,OrgName+}
  13.  
  14. unit Os2PmApi;
  15.  
  16. interface
  17.  
  18. uses Os2Def;
  19.  
  20. {----[ PMWIN ]----}
  21.  
  22. { General Window Management types and constants }
  23.  
  24. type
  25.   MParam    = Longint;
  26.   PMParam   = ^MParam;
  27.   MResult   = Longint;
  28.   PMResult  = ^MResult;
  29.  
  30. { This is the standard function definition for window procedures.             }
  31. { Typically they are named like "XxxxxxxxWndProc", where the prefix           }
  32. { "Xxxxxxxxx" is replaced by some name descriptive of the window procedure    }
  33. { being declared.  Window procedures must be EXPORTED in the definitions      }
  34. { file used by the linker.                                                    }
  35.  
  36. type
  37.   FnWp = function(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  38.  
  39. { Predefined window handles }
  40. const
  41.   hwnd_Desktop                  = HWnd(1);
  42.   hwnd_Object                   = HWnd(2);
  43.   hwnd_Top                      = HWnd(3);
  44.   hwnd_Bottom                   = HWnd(4);
  45.   hwnd_ThreadCapture            = HWnd(5);
  46.  
  47. { Standard Window Classes }
  48.   wc_Frame                      = PChar($FFFF0001);
  49.   wc_ComboBox                   = PChar($FFFF0002);
  50.   wc_Button                     = PChar($FFFF0003);
  51.   wc_Menu                       = PChar($FFFF0004);
  52.   wc_Static                     = PChar($FFFF0005);
  53.   wc_EntryField                 = PChar($FFFF0006);
  54.   wc_ListBox                    = PChar($FFFF0007);
  55.   wc_ScrollBar                  = PChar($FFFF0008);
  56.   wc_TitleBar                   = PChar($FFFF0009);
  57.   wc_Mle                        = PChar($FFFF000A);
  58.   { 000B to 000F reserved}
  59.   wc_AppStat                    = PChar($FFFF0010);
  60.   wc_KbdStat                    = PChar($FFFF0011);
  61.   wc_Pecic                      = PChar($FFFF0012);
  62.   wc_Dbe_kkPopup                = PChar($FFFF0013);
  63.   { 0014 to 001f reserved}
  64.   wc_SpinButton                 = PChar($FFFF0020);
  65.   { 0021 to 0024 reserved}
  66.   wc_Container                  = PChar($FFFF0025);
  67.   wc_Slider                     = PChar($FFFF0026);
  68.   wc_ValueSet                   = PChar($FFFF0027);
  69.   wc_NoteBook                   = PChar($FFFF0028);
  70.   { 0029 to 003F reserved}
  71.  
  72. { Standard Window Styles }
  73.   ws_Visible                    = $80000000;
  74.   ws_Disabled                   = $40000000;
  75.   ws_ClipChildren               = $20000000;
  76.   ws_ClipSiblings               = $10000000;
  77.   ws_ParentClip                 = $08000000;
  78.   ws_SaveBits                   = $04000000;
  79.   ws_SyncPaint                  = $02000000;
  80.   ws_Minimized                  = $01000000;
  81.   ws_Maximized                  = $00800000;
  82.   ws_Animate                    = $00400000;
  83.  
  84. { Dialog manager styles }
  85.   ws_Group                      = $00010000;
  86.   ws_TabStop                    = $00020000;
  87.   ws_MultiSelect                = $00040000;
  88.  
  89. { Class styles }
  90.   cs_MoveNotify                 = $00000001;
  91.   cs_SizeRedraw                 = $00000004;
  92.   cs_HitTest                    = $00000008;
  93.   cs_Public                     = $00000010;
  94.   cs_Frame                      = $00000020;
  95.   cs_ClipChildren               = $20000000;
  96.   cs_ClipSiblings               = $10000000;
  97.   cs_ParentClip                 = $08000000;
  98.   cs_SaveBits                   = $04000000;
  99.   cs_SyncPaint                  = $02000000;
  100.  
  101. function WinRegisterClass(Ab: Hab; ClassName: PChar; WndProc: FnWp;
  102.   flStyle,cbWindowData: ULong): Bool;
  103. function WinDefWindowProc(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  104. function WinDestroyWindow(Wnd: HWnd): Bool;
  105. function WinShowWindow(Wnd: HWnd; fShow: Bool): Bool;
  106. function WinQueryWindowRect(Wnd: HWnd; var R: RectL): Bool;
  107. function WinGetPS(Wnd: HWnd): Hps;
  108. function WinReleasePS(PS: Hps): Bool;
  109. function WinEndPaint(PS: Hps): Bool;
  110. function WinGetClipPS(Wnd: HWnd; WndClip: HWnd; Flags: ULong): Hps;
  111. function WinIsWindowShowing(Wnd: HWnd): Bool;
  112. function WinBeginPaint(Wnd: HWnd; PS: Hps; R: PRectL): Hps;
  113. function WinOpenWindowDC(Wnd: HWnd): Hdc;
  114. function WinScrollWindow(Wnd: HWnd; dX, dY: Long; Scroll: PRectL; Clip: PRectL;
  115.   RgnUpdate: HRgn; Update: PRectL; rgfsw: ULong): Long;
  116.  
  117. { WinGetClipPS flags }
  118. const
  119.   psf_LockWindowUpdate          = $0001;
  120.   psf_ClipUpwards               = $0002;
  121.   psf_ClipDownwards             = $0004;
  122.   psf_ClipSiblings              = $0008;
  123.   psf_ClipChildren              = $0010;
  124.   psf_ParentClip                = $0020;
  125.  
  126. { WinScrollWindow flags }
  127.   sw_ScrollChildren             = $0001;
  128.   sw_InvalidateRgn              = $0002;
  129.  
  130. function WinFillRect(PS: Hps; var R: RectL; Color: Long): Bool;
  131.  
  132. { WinInitialize/WinTerminate Interface declarations }
  133.  
  134. type
  135.   PQVersData = ^QVersData;
  136.   QVersData = record
  137.     Environment: Word;
  138.     Version:     Word;
  139.   end;
  140.  
  141. const
  142.   qv_OS2                        = $0000;
  143.   qv_CMS                        = $0001;
  144.   qv_TSO                        = $0002;
  145.   qv_TSOBatch                   = $0003;
  146.   qv_OS400                      = $0004;
  147.  
  148. function WinQueryVersion(AB: Hab): ULong;
  149. function WinInitialize(Options: ULong): Hab;
  150. function WinTerminate(AB: Hab): Bool;
  151. function WinQueryAnchorBlock(Wnd: HWnd): Hab;
  152. function WinCreateWindow(Parent: HWnd; Class: PChar; Name: PChar; Style: ULong;
  153.   X,Y,cX,cY: Long; Owner: HWnd; InsertBehind: HWnd; Id: ULong;
  154.   CtlData,PresParams: Pointer): HWnd;
  155. function WinEnableWindow(Wnd: HWnd; Enable: Bool): Bool;
  156. function WinIsWindowEnabled(Wnd: HWnd): Bool;
  157. function WinEnableWindowUpdate(Wnd: HWnd; Enable: Bool): Bool;
  158. function WinIsWindowVisible(Wnd: HWnd): Bool;
  159. function WinQueryWindowText(Wnd: HWnd; BufferMax: Long; Buffer: PChar): Long;
  160. function WinSetWindowText(Wnd: HWnd; Text: PChar): Bool;
  161. function WinQueryWindowTextLength(Wnd: HWnd): Long;
  162. function WinWindowFromID(Parent: HWnd; Id: ULong): HWnd;
  163. function WinIsWindow(AB: Hab; Wnd: HWnd): Bool;
  164. function WinQueryWindow(Wnd: HWnd; Cmd: Long): HWnd;
  165. function WinMultWindowFromIDs(Parent: HWnd; PRgHWnd: PHWnd;
  166.    idFirst,idLast: ULong): Long;
  167.  
  168. { WinQueryWindow codes }
  169. const
  170.   qw_Next                       = 0;
  171.   qw_Prev                       = 1;
  172.   qw_Top                        = 2;
  173.   qw_Bottom                     = 3;
  174.   qw_Owner                      = 4;
  175.   qw_Parent                     = 5;
  176.   qw_NextTop                    = 6;
  177.   qw_PrevTop                    = 7;
  178.   qw_FrameOwner                 = 8;
  179.  
  180. function WinSetParent(Wnd: HWnd; NewParent: HWnd; Redraw: Bool): Bool;
  181. function WinIsChild(Wnd: HWnd; Parent: HWnd): Bool;
  182. function WinSetOwner(Wnd: HWnd; NewOwner: HWnd): Bool;
  183. function WinQueryWindowProcess(Wnd: HWnd; Pid: PPid; Tid: PTid): Bool;
  184. function WinQueryObjectWindow(Desktop: HWnd): HWnd;
  185. function WinQueryDesktopWindow(AB: Hab; DC: Hdc): HWnd;
  186.  
  187. { Window positioning functions }
  188. { WinSetMultWindowPos record   }
  189. type
  190.   PSwp = ^Swp;
  191.   Swp = record
  192.     Fl:               ULong;
  193.     cY,cX,Y,X:        Long;
  194.     HWndInsertBehind: HWnd;
  195.     Wnd:              HWnd;
  196.     ulReserved1:      ULong;
  197.     ulReserved2:      ULong;
  198.   end;
  199.  
  200. function WinSetWindowPos(Wnd: HWnd; InsertBehind: HWnd; X,Y,cX,cY: Long;
  201.   Flags: ULong): Bool;
  202. function WinSetMultWindowPos(AB: Hab; var Swap: Swp; Count: ULong): Bool;
  203. function WinQueryWindowPos(Wnd: HWnd; var Swap: Swp): Bool;
  204.  
  205. { Values returned from wm_AdjustWindowPos and passed to wm_WindowPosChanged }
  206. const
  207.   awp_Minimized                 = $00010000;
  208.   awp_Maximized                 = $00020000;
  209.   awp_Restored                  = $00040000;
  210.   awp_Activate                  = $00080000;
  211.   awp_Deactivate                = $00100000;
  212.  
  213. { WinSetWindowPos flags }
  214.   swp_Size                      = $0001;
  215.   swp_Move                      = $0002;
  216.   swp_Zorder                    = $0004;
  217.   swp_Show                      = $0008;
  218.   swp_Hide                      = $0010;
  219.   swp_NoRedraw                  = $0020;
  220.   swp_NoAdjust                  = $0040;
  221.   swp_Activate                  = $0080;
  222.   swp_Deactivate                = $0100;
  223.   swp_ExtStateChange            = $0200;
  224.   swp_Minimize                  = $0400;
  225.   swp_Maximize                  = $0800;
  226.   swp_Restore                   = $1000;
  227.   swp_FocusActivate             = $2000;
  228.   swp_FocusDeactivate           = $4000;
  229.   swp_NoAutoClose               = $8000;   { Valid in ProgDetails record only }
  230.  
  231. { Window painting }
  232.  
  233. function WinUpdateWindow(Wnd: HWnd): Bool;
  234. function WinInvalidateRect(Wnd: HWnd; R: PRectL; IncludeChildren: Bool): Bool;
  235. function WinInvalidateRegion(Wnd: HWnd; Rgn: HRgn; IncludeChildren: Bool): Bool;
  236.  
  237. { Drawing helpers }
  238.  
  239. function WinInvertRect(PS: Hps; var R: PRectL): Bool;
  240. function WinDrawBitmap(PS: Hps; BitMap: HBitMap; Src,Dest: PRectL;
  241.   ForeColor,BackColor: Long; Flags: ULong): Bool;
  242.  
  243. { WinDrawBitMap flags }
  244. const
  245.   dbm_Normal                    = $0000;
  246.   dbm_Invert                    = $0001;
  247.   dbm_HalfTone                  = $0002;
  248.   dbm_Stretch                   = $0004;
  249.   dbm_ImageAttrs                = $0008;
  250.  
  251. function WinDrawText(PS: Hps; TextLen: Long; Text: PChar; var R: RectL;
  252.   ForeColor,BackColor: Long; Flags: ULong): Long;
  253.  
  254. { WinDrawText() codes: from dt_Left to dt_ExternalLeading, the codes are   }
  255. { designed to be OR'ed with ss_Text to create variations of the basic text }
  256. { static item.                                                             }
  257. const
  258.   dt_Left                       = $0000;
  259.   dt_QueryExtent                = $0002;
  260.   dt_UnderScore                 = $0010;
  261.   dt_StrikeOut                  = $0020;
  262.   dt_TextAttrs                  = $0040;
  263.   dt_ExternalLeading            = $0080;
  264.   dt_Center                     = $0100;
  265.   dt_Right                      = $0200;
  266.   dt_Top                        = $0000;
  267.   dt_VCenter                    = $0400;
  268.   dt_Bottom                     = $0800;
  269.   dt_HalfTone                   = $1000;
  270.   dt_Mnemonic                   = $2000;
  271.   dt_WordBreak                  = $4000;
  272.   dt_EraseRect                  = $8000;
  273.  
  274. function WinDrawBorder(PS: Hps; var R: RectL; cX,cY: Long;
  275.   ForeColor,BackColor: Long; Flags: ULong): Bool;
  276.  
  277. { WinDrawBorder flags }
  278. const
  279.   db_PatCopy                    = $0000;
  280.   db_PatInvert                  = $0001;
  281.   db_DestInvert                 = $0002;
  282.   db_AreaMixMode                = $0003;
  283.   db_Rop                        = $0007;
  284.   db_Interior                   = $0008;
  285.   db_AreaAttrs                  = $0010;
  286.   db_Standard                   = $0100;
  287.   db_DlgBorder                  = $0200;
  288.  
  289. { Resource loading functions }
  290.  
  291. function WinLoadString(AB: Hab; Module: HModule; Id: ULong; MaxLen: Long;
  292.   Buffer: PChar): Long;
  293. function WinLoadMessage(AB: Hab; Module: HModule; Id: ULong; MaxLen: Long;
  294.   Buffer: PChar): Long;
  295.  
  296. function WinSetActiveWindow(Desktop: HWnd; Wnd: HWnd): Bool;
  297.  
  298. { wm_Create record }
  299. type
  300.   PCreateStruct = ^CreateStruct;
  301.   CreateStruct = record
  302.     pPresParams:      Pointer;
  303.     pCtlData:         Pointer;
  304.     Id:               ULong;
  305.     HWndInsertBehind: HWnd;
  306.     HWndOwner:        HWnd;
  307.     cY,cX,Y,X:        Long;
  308.     flStyle:          ULong;
  309.     pszText:          PChar;
  310.     pszClass:         PChar;
  311.     HWndParent:       HWnd;
  312.   end;
  313.  
  314. { WinQueryClassInfo record }
  315.   PClassInfo = ^ClassInfo;
  316.   ClassInfo = record
  317.     flClassStyle:    ULong;
  318.     pfnWindowProc:   FnWp;
  319.     cbWindowData:    ULong;
  320.   end;
  321.  
  322. function WinSubclassWindow(Wnd: HWnd; WndProc: FnWp): Pointer;
  323. function WinQueryClassName(Wnd: HWnd; MaxLen: Long; Buffer: PChar): Long;
  324. function WinQueryClassInfo(AB: Hab; ClassName: PChar; var ClassInf: ClassInfo): Bool;
  325. function WinQueryActiveWindow(Desktop: HWnd): HWnd;
  326. function WinIsThreadActive(AB: Hab): Bool;
  327. function WinQuerySysModalWindow(Desktop: HWnd): HWnd;
  328. function WinSetSysModalWindow(Desktop: HWnd; Wnd: HWnd): Bool;
  329. function WinQueryWindowUShort(Wnd: HWnd; Index: Long): UShort;
  330. function WinSetWindowUShort(Wnd: HWnd; Index: Long; us: UShort): Bool;
  331. function WinQueryWindowULong(Wnd: HWnd; Index: Long): ULong;
  332. function WinSetWindowULong(Wnd: HWnd; Index: Long; ul: ULong): Bool;
  333. function WinQueryWindowPtr(Wnd: HWnd; Index: Long): Pointer;
  334. function WinSetWindowPtr(Wnd: HWnd; Index: Long; P: Pointer): Bool;
  335. function WinSetWindowBits(Wnd: HWnd; Index: Long; flData,flMask: ULong): Bool;
  336.  
  337. { Standard WinQueryWindowUShort/ULong indices }
  338. const
  339.   qws_User                      =  0;
  340.   qws_Id                        = -1;
  341.   qws_Min                       = -1;
  342.  
  343.   qwl_User                      =  0;
  344.   qwl_Style                     = -2;
  345.   qwp_PFnWp                     = -3;
  346.   qwl_Hmq                       = -4;
  347.   qwl_Reserved                  = -5;
  348.   qwl_Min                       = -6;
  349.  
  350. { wc_Frame WinQueryWindowUShort/ULong indices }
  351.   qwl_HHeap                     = $0004;
  352.   qwl_HWndFocusSave             = $0018;
  353.   qwl_DefButton                 = $0040;
  354.   qwl_PSscBlk                   = $0048;
  355.   qwl_PFepBlk                   = $004C;
  356.   qwl_PStatBlk                  = $0050;
  357.  
  358.   qws_Flags                     = $0008;
  359.   qws_Result                    = $000A;
  360.   qws_XRestore                  = $000C;
  361.   qws_YRestore                  = $000E;
  362.   qws_cXRestore                 = $0010;
  363.   qws_cYRestore                 = $0012;
  364.   qws_XMinimize                 = $0014;
  365.   qws_YMinimize                 = $0016;
  366.  
  367. { Window enumeration }
  368. type
  369.   HEnum = LHandle;
  370.  
  371. function WinBeginEnumWindows(Wnd: HWnd): HEnum;
  372. function WinGetNextWindow(Enum: HEnum): HWnd;
  373. function WinEndEnumWindows(Enum: HEnum): Bool;
  374. function WinWindowFromPoint(Wnd: HWnd; var Point: PointL; Children: Bool): HWnd;
  375. function WinMapWindowPoints(FromWin: HWnd; ToWin: HWnd; var Point: PointL; Count: Long): Bool;
  376.  
  377. { More window painting functions }
  378.  
  379. function WinValidateRect(Wnd: HWnd; R: PRectL; IncludeChildren: Bool): Bool;
  380. function WinValidateRegion(Wnd: HWnd; Rgn: HRgn; IncludeChildren: Bool): Bool;
  381. function WinWindowFromDC(DC: Hdc): HWnd;
  382. function WinQueryWindowDC(Wnd: HWnd): Hdc;
  383. function WinGetScreenPS(Desktop: HWnd): Hps;
  384. function WinLockWindowUpdate(Desktop: HWnd; LockUpdate: HWnd): Bool;
  385. function WinLockVisRegions(Desktop: HWnd; Lock: Bool): Bool;
  386. function WinQueryUpdateRect(Wnd: HWnd; var R: RectL): Bool;
  387. function WinQueryUpdateRegion(Wnd: HWnd; Rgn: HRgn): Long;
  388. function WinExcludeUpdateRegion(PS: Hps; Wnd: HWnd): Long;
  389.  
  390. { QMsg record }
  391. type
  392.   PQMsg = ^QMsg;
  393.   QMsg = record
  394.     HWnd:     HWnd;
  395.     Msg:      ULong;
  396.     Mp1,Mp2:  MParam;
  397.     Time:     ULong;
  398.     ptl:      PointL;
  399.     Reserved: ULong;
  400.   end;
  401.  
  402. { Standard Window Messages }
  403. const
  404.   wm_Null                       = $0000;
  405.   wm_Create                     = $0001;
  406.   wm_Destroy                    = $0002;
  407.   wm_Enable                     = $0004;
  408.   wm_Show                       = $0005;
  409.   wm_Move                       = $0006;
  410.   wm_Size                       = $0007;
  411.   wm_AdjustWindowPos            = $0008;
  412.   wm_CalcValidRects             = $0009;
  413.   wm_SetWindowParams            = $000A;
  414.   wm_QueryWindowParams          = $000B;
  415.   wm_HitTest                    = $000C;
  416.   wm_Activate                   = $000D;
  417.   wm_SetFocus                   = $000F;
  418.   wm_SetSelection               = $0010;
  419. { Language support Winproc }
  420.   wm_PPaint                     = $0011;
  421.   wm_PSetFocus                  = $0012;
  422.   wm_PSysColorChange            = $0013;
  423.   wm_PSize                      = $0014;
  424.   wm_PActivate                  = $0015;
  425.   wm_PControl                   = $0016;
  426.   wm_Command                    = $0020;
  427.   wm_SysCommand                 = $0021;
  428.   wm_Help                       = $0022;
  429.   wm_Paint                      = $0023;
  430.   wm_Timer                      = $0024;
  431.   wm_Sem1                       = $0025;
  432.   wm_Sem2                       = $0026;
  433.   wm_Sem3                       = $0027;
  434.   wm_Sem4                       = $0028;
  435.   wm_Close                      = $0029;
  436.   wm_Quit                       = $002A;
  437.   wm_SysColorChange             = $002B;
  438.   wm_SysValueChanged            = $002D;
  439.   wm_AppTerminateNotify         = $002E;
  440.   wm_PresParamChanged           = $002F;
  441. { Control notification messages }
  442.   wm_Control                    = $0030;
  443.   wm_VScroll                    = $0031;
  444.   wm_HScroll                    = $0032;
  445.   wm_InitMenu                   = $0033;
  446.   wm_MenuSelect                 = $0034;
  447.   wm_MenuEnd                    = $0035;
  448.   wm_DrawItem                   = $0036;
  449.   wm_MeasureItem                = $0037;
  450.   wm_ControlPointer             = $0038;
  451.   wm_QueryDlgCode               = $003A;
  452.   wm_InitDlg                    = $003B;
  453.   wm_SubstituteString           = $003C;
  454.   wm_MatchMnemonic              = $003D;
  455.   wm_SaveApplication            = $003E;
  456.  
  457. { Reserve a range of messages for help manager. This range includes     }
  458. { public messages, defined below, and private ones, which need to be    }
  459. { reserved here to prevent clashing with application messages           }
  460.   wm_HelpBase                   = $0F00; { Start of msgs for help manager }
  461.   wm_HelpTop                    = $0FFF; { End of msgs for help manager   }
  462.   wm_User                       = $1000;
  463.  
  464. { wm_Command msg source codes }
  465.   cmdsrc_PushButton             = 1;
  466.   cmdsrc_Menu                   = 2;
  467.   cmdsrc_Accelerator            = 3;
  468.   cmdsrc_FontDlg                = 4;
  469.   cmdsrc_FileDlg                = 5;
  470.   cmdsrc_PrintDlg               = 6;
  471.   cmdsrc_ColorDlg               = 7;
  472.   cmdsrc_Other                  = 0;
  473.  
  474. { The following record is used to access the wm_Command, wm_Help, and   }
  475. { wm_SysCommand message parameters:                                     }
  476.  
  477. type
  478.   PCmdMsgMp1 = ^CommandMsgMp1;  { Mp1 }
  479.   CommandMsgMp1 = record
  480.     Cmd:    Word;
  481.     Unused: Word;
  482.   end;
  483.  
  484.   PCmdMsgMp2 = ^CommandMsgMp2;  { Mp2 }
  485.   CommandMsgMp2 = record
  486.     Source: Word;
  487.     fMouse: Word;
  488.   end;
  489.  
  490. { The following record is used by the WinQueryQueueInfo routine }
  491.  
  492.   PMqInfo = ^MqInfo;
  493.   MqInfo = record
  494.     cb:        ULong;
  495.     Pid:       Pid;
  496.     Tid:       Tid;
  497.     CMsgs:     ULong;
  498.     pReserved: Pointer;
  499.   end;
  500.  
  501. function WinSendMsg(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  502. function WinCreateMsgQueue(AB: Hab; CMsg: Long): Hmq;
  503. function WinDestroyMsgQueue(Mq: Hmq): Bool;
  504. function WinQueryQueueInfo(Mq: Hmq; var Mqi: MqInfo; cbCopy: ULong): Bool;
  505. function WinCancelShutdown(Mq: Hmq; CancelAlways: Bool): Bool;
  506. function WinGetMsg(AB: Hab; var Msg: QMsg; Filter: HWnd;
  507.   msgFilterFirst,msgFilterLast: ULong): Bool;
  508. function WinPeekMsg(AB: Hab; var Msg: QMsg; HWndFilter: HWnd;
  509.   msgFilterFirst,msgFilterLast,Flags: ULong): Bool;
  510. function WinDispatchMsg(AB: Hab; var Msg: QMsg): MResult;
  511. function WinPostMsg(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): Bool;
  512. function WinRegisterUserMsg(AB: Hab; MsgId: ULong;
  513.   DataType1,Dir1,DataType2,Dir2,DataTypeR: Long): Bool;
  514. function WinRegisterUserDataType(AB: Hab; DataType,Count: Long;
  515.   Types: PLong): Bool;
  516. function WinSetMsgMode(AB: Hab; ClassName: PChar; Control: Long): Bool;
  517. function WinSetSynchroMode(AB: Hab; Mode: Long): Bool;
  518.  
  519. { WinPeekMsg constants }
  520. const
  521.   pm_Remove                     = $0001;
  522.   pm_NoRemove                   = $0000;
  523.  
  524. { WinRegisterUserDatatype datatypes are declared in the PmTypes unit }
  525.  
  526. { WinRegisterUserMsg direction codes }
  527.   rum_In                        = 1;
  528.   rum_Out                       = 2;
  529.   rum_InOut                     = 3;
  530.  
  531. { WinSetMsgMode constants }
  532.   smd_Delayed                   = $0001;
  533.   smd_Immediate                 = $0002;
  534.  
  535. { WinSetSynchroMode constants }
  536.   ssm_Synchronous               = $0001;
  537.   ssm_Asynchronous              = $0002;
  538.   ssm_Mixed                     = $0003;
  539.  
  540. { wm_CalcValidRects return flags }
  541.   cvr_AlignLeft                 = $0001;
  542.   cvr_AlignBottom               = $0002;
  543.   cvr_AlignRight                = $0004;
  544.   cvr_AlignTop                  = $0008;
  545.   cvr_Redraw                    = $0010;
  546.  
  547. { wm_HitTest return codes }
  548.   ht_Normal                     =  0;
  549.   ht_Transparent                = -1;
  550.   ht_Discard                    = -2;
  551.   ht_Error                      = -3;
  552.  
  553. { wm_Set/QueryWindowParams record and flags }
  554. type
  555.   PWndParams = ^WndParams;
  556.   WndParams = record
  557.     fsStatus:     ULong;
  558.     cchText:      ULong;
  559.     pszText:      PChar;
  560.     cbPresParams: ULong;
  561.     pPresParams:  Pointer;
  562.     cbCtlData:    ULong;
  563.     pCtlData:     Pointer;
  564.   end;
  565.  
  566. const
  567.   wpm_Text                      = $0001;
  568.   wpm_CtlData                   = $0002;
  569.   wpm_PresParams                = $0004;
  570.   wpm_CChText                   = $0008;
  571.   wpm_CbCtlData                 = $0010;
  572.   wpm_CbPresParams              = $0020;
  573.  
  574. function WinInSendMsg(AB: Hab): Bool;
  575. function WinBroadcastMsg(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam; rgf: ULong): Bool;
  576.  
  577. { WinBroadcastMsg codes }
  578. const
  579.   bmsg_Post                     = $0000;
  580.   bmsg_Send                     = $0001;
  581.   bmsg_PostQueue                = $0002;
  582.   bmsg_Descendants              = $0004;
  583.   bmsg_FrameOnly                = $0008;
  584.  
  585. function WinWaitMsg(AB: Hab; msgFirst,msgLast: ULong): Bool;
  586. function WinQueryQueueStatus(Desktop: HWnd): ULong;
  587.  
  588. { WinQueryQueueStatus constants }
  589. const
  590.   qs_Key                        = $0001;
  591.   qs_MouseButton                = $0002;
  592.   qs_MouseMove                  = $0004;
  593.   qs_Mouse                      = $0006;  { qs_MouseMove or qs_MouseButton }
  594.   qs_Timer                      = $0008;
  595.   qs_Paint                      = $0010;
  596.   qs_PostMsg                    = $0020;
  597.   qs_Sem1                       = $0040;
  598.   qs_Sem2                       = $0080;
  599.   qs_Sem3                       = $0100;
  600.   qs_Sem4                       = $0200;
  601.   qs_SendMsg                    = $0400;
  602.  
  603. function WinQueryMsgPos(AB: Hab; var Point: PointL): Bool;
  604. function WinQueryMsgTime(AB: Hab): ULong;
  605.  
  606. type
  607.   HEv  = ULong;
  608.   HMtx = ULong;
  609.   HMux = ULong;
  610.  
  611. function WinWaitEventSem(EvSem: HEv; Timeout: ULong): ApiRet;
  612. function WinRequestMutexSem(MtxSem: HMtx; Timeout: ULong): ApiRet;
  613. function WinWaitMuxWaitSem(MuxSem: HMux; Timeout: ULong; pulUser: PULong): ApiRet;
  614. function WinPostQueueMsg(Mq: Hmq; Msg: ULong; Mp1,Mp2: MParam): Bool;
  615.  
  616. { WinSetMsgInterest/WinSetClassMsgInterest constants }
  617. const
  618.   smim_All                      = $0EFF;
  619.   smi_NoInterest                = $0001;
  620.   smi_Interest                  = $0002;
  621.   smi_Reset                     = $0004;
  622.   smi_AutoDispatch              = $0008;
  623.  
  624. function WinSetMsgInterest(Wnd: HWnd; MsgClass: ULong; Control: Long): Bool;
  625. function WinSetClassMsgInterest(AB: Hab; ClassName: PChar; MsgClass: ULong;
  626.   Control: Long): Bool;
  627.  
  628. { Keyboard and mouse }
  629.  
  630. function WinSetFocus(Desktop: HWnd; SetFocus: HWnd): Bool;
  631. function WinFocusChange(Desktop: HWnd; SetFocus: HWnd; flFocusChange: ULong): Bool;
  632.  
  633. const
  634.   fc_NoSetFocus                 = $0001;
  635.   fc_NoBringToTop               = fc_NoSetFocus;
  636.   fc_NoLoseFocus                = $0002;
  637.   fc_NoBringTopFirstWindow      = fc_NoLoseFocus;
  638.   fc_NoSetActive                = $0004;
  639.   fc_NoLoseActive               = $0008;
  640.   fc_NoSetSelection             = $0010;
  641.   fc_NoLoseSelection            = $0020;
  642.  
  643.   qfc_NextInChain               = $0001;
  644.   qfc_Active                    = $0002;
  645.   qfc_Frame                     = $0003;
  646.   qfc_SelectActive              = $0004;
  647.   qfc_PartOfChain               = $0005;
  648.  
  649. function WinSetCapture(Desktop: HWnd; Wnd: HWnd): Bool;
  650. function WinQueryCapture(Desktop: HWnd): HWnd;
  651.  
  652. { Mouse input messages}
  653. const
  654.   wm_MouseFirst                 = $0070;
  655.   wm_MouseLast                  = $0079;
  656.   wm_ButtonClickFirst           = $0071;
  657.   wm_ButtonClickLast            = $0079;
  658.   wm_MouseMove                  = $0070;
  659.   wm_Button1Down                = $0071;
  660.   wm_Button1Up                  = $0072;
  661.   wm_Button1DblClk              = $0073;
  662.   wm_Button2Down                = $0074;
  663.   wm_Button2Up                  = $0075;
  664.   wm_Button2DblClk              = $0076;
  665.   wm_Button3Down                = $0077;
  666.   wm_Button3Up                  = $0078;
  667.   wm_Button3DblClk              = $0079;
  668.   wm_ExtMouseFirst              = $0410;
  669.   wm_ExtMouseLast               = $0419;
  670.   wm_Chord                      = $0410;
  671.   wm_Button1MotionStart         = $0411;
  672.   wm_Button1MotionEnd           = $0412;
  673.   wm_Button1Click               = $0413;
  674.   wm_Button2MotionStart         = $0414;
  675.   wm_Button2MotionEnd           = $0415;
  676.   wm_Button2Click               = $0416;
  677.   wm_Button3MotionStart         = $0417;
  678.   wm_Button3MotionEnd           = $0418;
  679.   wm_Button3Click               = $0419;
  680.   { Messages $041A - $041F are reserved }
  681.   wm_MouseTranslateFirst        = $0420;
  682.   wm_MouseTranslateLast         = $0428;
  683.   wm_BeginDrag                  = $0420;
  684.   wm_EndDrag                    = $0421;
  685.   wm_SingleSelect               = $0422;
  686.   wm_Open                       = $0423;
  687.   wm_ContextMenu                = $0424;
  688.   wm_ContextHelp                = $0425;
  689.   wm_TextEdit                   = $0426;
  690.   wm_BeginSelect                = $0427;
  691.   wm_EndSelect                  = $0428;
  692.  
  693. function WinQueryFocus(Desktop: HWnd): HWnd;
  694.  
  695. { Key/Character input messages }
  696. const
  697.   wm_Char                       = $007A;
  698.   wm_VioChar                    = $007B;
  699.  
  700. { wm_Char fs field bits }
  701.   kc_None                       = $0000;    { Reserved }
  702.   kc_Char                       = $0001;
  703.   kc_VirtualKey                 = $0002;
  704.   kc_ScanCode                   = $0004;
  705.   kc_Shift                      = $0008;
  706.   kc_Ctrl                       = $0010;
  707.   kc_Alt                        = $0020;
  708.   kc_KeyUp                      = $0040;
  709.   kc_PrevDown                   = $0080;
  710.   kc_LoneKey                    = $0100;
  711.   kc_DeadKey                    = $0200;
  712.   kc_Composite                  = $0400;
  713.   kc_InvalidComp                = $0800;
  714.   kc_Toggle                     = $1000;
  715.   kc_InvalidChar                = $2000;
  716.   kc_DbcsRsrvd1                 = $4000;
  717.   kc_DbcsRsrvd2                 = $8000;
  718.  
  719. { The following record is used to access the wm_MouseMove, and wm_Button }
  720. { message parameters                                                     }
  721. type
  722.   PMseMsgMp1 = ^MouseMsgMp1;    { Mp1 }
  723.   MouseMsgMp1 = record
  724.     X: Word;
  725.     Y: Word;
  726.   end;
  727.  
  728.   PMseMsgMp2 = ^MouseMsgMp2;    { Mp2 }
  729.   MouseMsgMp2 = record
  730.     codeHitTest: Word;
  731.     fsInp:       Word;          { Input flags }
  732.   end;
  733.  
  734.   PChrMsgMp1 = ^CharMsgMp1;     { Mp1 }
  735.   CharMsgMp1 = record
  736.     fs:         Word;
  737.     cRepeat:    Byte;
  738.     ScanCode:   Byte;
  739.   end;
  740.  
  741.   PChrMsgMp2 = ^CharMsgMp2;     { Mp2 }
  742.   CharMsgMp2 = record
  743.     Chr:        Word;
  744.     VKey:       Word;
  745.   end;
  746.  
  747. const
  748.   inp_None                      = $0000;
  749.   inp_Kbd                       = $0001;
  750.   inp_Mult                      = $0002;
  751.   inp_Res2                      = $0004;
  752.   inp_Shift                     = $0008;
  753.   inp_Ctrl                      = $0010;
  754.   inp_Alt                       = $0020;
  755.   inp_Res3                      = $0040;
  756.   inp_Res4                      = $0080;
  757.   inp_Ignore                    = $FFFF;
  758.  
  759. { Virtual key values }
  760.   vk_Button1                    = $01;
  761.   vk_Button2                    = $02;
  762.   vk_Button3                    = $03;
  763.   vk_Break                      = $04;
  764.   vk_BackSpace                  = $05;
  765.   vk_Tab                        = $06;
  766.   vk_BackTab                    = $07;
  767.   vk_NewLine                    = $08;
  768.   vk_Shift                      = $09;
  769.   vk_Ctrl                       = $0A;
  770.   vk_Alt                        = $0B;
  771.   vk_AltGraf                    = $0C;
  772.   vk_Pause                      = $0D;
  773.   vk_CapsLock                   = $0E;
  774.   vk_Esc                        = $0F;
  775.   vk_Space                      = $10;
  776.   vk_PageUp                     = $11;
  777.   vk_PageDown                   = $12;
  778.   vk_End                        = $13;
  779.   vk_Home                       = $14;
  780.   vk_Left                       = $15;
  781.   vk_Up                         = $16;
  782.   vk_Right                      = $17;
  783.   vk_Down                       = $18;
  784.   vk_PrintScrn                  = $19;
  785.   vk_Insert                     = $1A;
  786.   vk_Delete                     = $1B;
  787.   vk_ScrlLock                   = $1C;
  788.   vk_NumLock                    = $1D;
  789.   vk_Enter                      = $1E;
  790.   vk_SysRq                      = $1F;
  791.   vk_F1                         = $20;
  792.   vk_F2                         = $21;
  793.   vk_F3                         = $22;
  794.   vk_F4                         = $23;
  795.   vk_F5                         = $24;
  796.   vk_F6                         = $25;
  797.   vk_F7                         = $26;
  798.   vk_F8                         = $27;
  799.   vk_F9                         = $28;
  800.   vk_F10                        = $29;
  801.   vk_F11                        = $2A;
  802.   vk_F12                        = $2B;
  803.   vk_F13                        = $2C;
  804.   vk_F14                        = $2D;
  805.   vk_F15                        = $2E;
  806.   vk_F16                        = $2F;
  807.   vk_F17                        = $30;
  808.   vk_F18                        = $31;
  809.   vk_F19                        = $32;
  810.   vk_F20                        = $33;
  811.   vk_F21                        = $34;
  812.   vk_F22                        = $35;
  813.   vk_F23                        = $36;
  814.   vk_F24                        = $37;
  815.   vk_EndDrag                    = $38;
  816.   vk_Menu                       = VK_F10;
  817.   vk_DbcsFirst                  = $0080;
  818.   vk_DbcsLast                   = $00ff;
  819.   vk_UserFirst                  = $0100;
  820.   vk_UserLast                   = $01ff;
  821.  
  822. function WinGetKeyState(Desktop: HWnd; VKey: Long): Long;
  823. function WinGetPhysKeyState(Desktop: HWnd; Sc: Long): Long;
  824. function WinEnablePhysInput(Desktop: HWnd; Enable: Bool): Bool;
  825. function WinIsPhysInputEnabled(Desktop: HWnd): Bool;
  826. function WinSetKeyboardStateTable(Desktop: HWnd; pKeyStateTable: Pointer; fSet: Bool): Bool;
  827.  
  828. { Journal Notification messages }
  829. const
  830.   wm_JournalNotify              = $007C;
  831.   { Define the valid commands (lParm1) for journal notify message }
  832.   jrn_QueueStatus               = $00000001;
  833.   jrn_PhysKeyState              = $00000002;
  834.  
  835. { Dialog Manager }
  836.  
  837. function WinGetDlgMsg(Dlg: HWnd; var Msg: QMsg): Bool;
  838. function WinLoadDlg(Parent,Owner: HWnd; DlgProc: FnWp; Module: HModule;
  839.   IdDlg: ULong; CreateParams: Pointer): HWnd;
  840. function WinDlgBox(Parent,Owner: HWnd; DlgProc: FnWp; Module: HModule;
  841.   idDlg: ULong; CreateParams: Pointer): ULong;
  842. function WinDismissDlg(Dlg: HWnd; Result: ULong): Bool;
  843. function WinQueryDlgItemShort(Dlg: HWnd; IdItem: ULong; Result: Pointer;
  844.   Signed: Bool): Bool;
  845. function WinSetDlgItemShort(Dlg: HWnd; IdItem: ULong; Value: Word;
  846.   Signed: Bool): Bool;
  847. function WinSetDlgItemText(Dlg: HWnd; IdItem: ULong; Text: PChar): Bool;
  848. function WinQueryDlgItemText(Dlg: HWnd; IdItem: ULong; BufferMax: Long;
  849.   Buffer: PChar): ULong;
  850. function WinQueryDlgItemTextLength(Dlg: HWnd; IdItem: ULong): Long;
  851. function WinDefDlgProc(Dlg: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  852.  
  853. { Special item IDs }
  854. const
  855.   did_Ok                        = 1;
  856.   did_Cancel                    = 2;
  857.   did_Error                     = $FFFF;
  858.  
  859. function WinAlarm(Desktop: HWnd; rgfType: ULong): Bool;
  860.  
  861. { WinAlarm Codes }
  862. const
  863.   wa_Warning                    = 0;
  864.   wa_Note                       = 1;
  865.   wa_Error                      = 2;
  866.   wa_CWinAlarms                 = 3;    { count of valid alarms }
  867.  
  868. function WinMessageBox(Parent,Owner: HWnd; Text,Caption: PChar;
  869.   IdWindow,Style: ULong): ULong;
  870.  
  871. { Message box types }
  872. const
  873.   mb_Ok                         = $0000;
  874.   mb_OkCancel                   = $0001;
  875.   mb_RetryCancel                = $0002;
  876.   mb_AbortRetryIgnore           = $0003;
  877.   mb_YesNo                      = $0004;
  878.   mb_YesNoCancel                = $0005;
  879.   mb_Cancel                     = $0006;
  880.   mb_Enter                      = $0007;
  881.   mb_EnterCancel                = $0008;
  882.  
  883.   mb_NoIcon                     = $0000;
  884.   mb_CUANotification            = $0000;
  885.   mb_IconQuestion               = $0010;
  886.   mb_IconExclamation            = $0020;
  887.   mb_CUAWarning                 = $0020;
  888.   mb_IconAsterisk               = $0030;
  889.   mb_IconHand                   = $0040;
  890.   mb_CUACritical                = $0040;
  891.   mb_Query                      = mb_IconQuestion;
  892.   mb_Warning                    = mb_CUAWarning;
  893.   mb_Information                = mb_IconAsterisk;
  894.   mb_Critical                   = mb_CUACritical;
  895.   mb_Error                      = mb_Critical;
  896.  
  897.   mb_DefButton1                 = $0000;
  898.   mb_DefButton2                 = $0100;
  899.   mb_DefButton3                 = $0200;
  900.  
  901.   mb_ApplModal                  = $0000;
  902.   mb_SystemModal                = $1000;
  903.   mb_Help                       = $2000;
  904.   mb_Moveable                   = $4000;
  905.  
  906.   { Message box return codes }
  907.   mbid_Ok                       = 1;
  908.   mbid_Cancel                   = 2;
  909.   mbid_Abort                    = 3;
  910.   mbid_Retry                    = 4;
  911.   mbid_Ignore                   = 5;
  912.   mbid_Yes                      = 6;
  913.   mbid_No                       = 7;
  914.   mbid_Help                     = 8;
  915.   mbid_Enter                    = 9;
  916.   mbid_Error                    = $FFFF;
  917.  
  918. { Dialog codes: returned by wm_QueryDlgCode msg }
  919.   dlgc_EntryField               = $0001; { Entry field item understands em_SetSel) }
  920.   dlgc_Button                   = $0002; { Button item                             }
  921.   dlgc_RadioButton              = $0004; { Radio button                            }
  922.   dlgc_Static                   = $0008; { Static item                             }
  923.   dlgc_Default                  = $0010; { Default push button                     }
  924.   dlgc_PushButton               = $0020; { Normal (Non-default) push button        }
  925.   dlgc_CheckBox                 = $0040; { Check box button control                }
  926.   dlgc_ScrollBar                = $0080; { Scroll bar                              }
  927.   dlgc_Menu                     = $0100; { Menu                                    }
  928.   dlgc_TabOnClick               = $0200;
  929.   dlgc_MLE                      = $0400; { Multiple Line Entry                     }
  930.  
  931. function WinProcessDlg(Dlg: HWnd): ULong;
  932. function WinSendDlgItemMsg(Dlg: HWnd; IdItem: ULong; Msg: ULong;
  933.   Mp1,Mp2: MParam): MResult;
  934. function WinMapDlgPoints(Dlg: HWnd; var PrgWPtL: PointL; Count: ULong;
  935.   CalcWindowCoords: Bool): Bool;
  936. function WinEnumDlgItem(Dlg: HWnd; Wnd: HWnd; Code: ULong): HWnd;
  937. function WinSubstituteStrings(Wnd: HWnd; Src: PChar; DestMax: Long;
  938.   Dest: PChar): Long;
  939.  
  940. { WinEnumDlgItem constants }
  941. const
  942.   edi_FirstTabItem              = 0;
  943.   edi_LastTabItem               = 1;
  944.   edi_NextTabItem               = 2;
  945.   edi_PrevTabItem               = 3;
  946.   edi_FirstGroupItem            = 4;
  947.   edi_LastGroupItem             = 5;
  948.   edi_NextGroupItem             = 6;
  949.   edi_PrevGroupItem             = 7;
  950.  
  951. { Dialog template definitions }
  952. type
  953.   PDlgTItem = ^DlgTItem;
  954.   DlgTItem = record
  955.     fsItemStatus:    Word;
  956.     cChildren:       Word;
  957.     cchClassName:    Word;
  958.     offClassName:    Word;
  959.     cchText:         Word;
  960.     offText:         Word;
  961.     flStyle:         ULong;
  962.     X:               Integer;
  963.     Y:               Integer;
  964.     cX:              Integer;
  965.     cY:              Integer;
  966.     id:              Word;
  967.     offPresParams:   Word;
  968.     offCtlData:      Word;
  969.   end;
  970.  
  971. { Dialog Template structure }
  972.  PDlgTemplate = ^DlgTemplate;
  973.  DlgTemplate = record
  974.    cbTemplate:             Word;
  975.    dtype:                  Word;
  976.    codepage:               Word;
  977.    offadlgti:              Word;
  978.    fsTemplateStatus:       Word;
  979.    iItemFocus:             Word;
  980.    coffPresParams:         Word;
  981.    adlgti:                 DlgTItem;
  982.  end;
  983.  
  984. function WinCreateDlg(Parent,Owner: HWnd; DlgProc: FnWp; var Dlg: DlgTemplate;
  985.   CreateParams: Pointer): HWnd;
  986.  
  987. { Static Control Manager }
  988.  
  989. { Static control styles:                                                 }
  990. {  NOTE: the top 9 bits of the LOWORD of the window flStyle are used for }
  991. {  dt_* flags.  The lower 7 bits are for SS_* styles.  This gives us up  }
  992. {  to 128 distinct static control types (we currently use 11 of them).   }
  993. const
  994.   ss_Text                       = $0001;
  995.   ss_GroupBox                   = $0002;
  996.   ss_Icon                       = $0003;
  997.   ss_BitMap                     = $0004;
  998.   ss_FgndRect                   = $0005;
  999.   ss_HalfToneRect               = $0006;
  1000.   ss_BkgndRect                  = $0007;
  1001.   ss_FgndFrame                  = $0008;
  1002.   ss_HalfToneFrame              = $0009;
  1003.   ss_BkgndFrame                 = $000A;
  1004.   ss_SysIcon                    = $000B;
  1005.   ss_AutoSize                   = $0040;
  1006.  
  1007. { Static control messages }
  1008.   SM_SETHANDLE                  = $0100;
  1009.   SM_QUERYHANDLE                = $0101;
  1010.  
  1011. { Button control styles }
  1012.   bs_PushButton                 = 0;
  1013.   bs_CheckBox                   = 1;
  1014.   bs_AutoCheckBox               = 2;
  1015.   bs_RadioButton                = 3;
  1016.   bs_AutoRadioButton            = 4;
  1017.   bs_3State                     = 5;
  1018.   bs_Auto3State                 = 6;
  1019.   bs_UserButton                 = 7;
  1020.   bs_PrimaryStyles              = $000F;
  1021.   bs_BitMap                     = $0040;
  1022.   bs_Icon                       = $0080;
  1023.   bs_Help                       = $0100;
  1024.   bs_SysCommand                 = $0200;
  1025.   bs_Default                    = $0400;
  1026.   bs_NoPointerFocus             = $0800;
  1027.   bs_NoBorder                   = $1000;
  1028.   bs_NoCursorSelect             = $2000;
  1029.   bs_AutoSize                   = $4000;
  1030.  
  1031. type
  1032.   PBtnCData = ^BtnCData;
  1033.   BtnCData = record
  1034.     cd:            Word;
  1035.     fsCheckState:  Word;
  1036.     fsHiliteState: Word;
  1037.     hImage:        LHandle;
  1038.   end;
  1039.  
  1040. { User button record (passed in wm_Control msg }
  1041.   PUserButton = ^UserButton;
  1042.   UserButton = record
  1043.     HWnd:       HWnd;
  1044.     Hps:        Hps;
  1045.     fsState:    ULong;
  1046.     fsStateOld: ULong;
  1047.   end;
  1048.  
  1049. { Button control messages }
  1050. const
  1051.   bm_Click                      = $0120;
  1052.   bm_QueryCheckIndex            = $0121;
  1053.   bm_QueryHilite                = $0122;
  1054.   bm_SetHilite                  = $0123;
  1055.   bm_QueryCheck                 = $0124;
  1056.   bm_SetCheck                   = $0125;
  1057.   bm_SetDefault                 = $0126;
  1058.  
  1059. { Button notification codes }
  1060.   bn_Clicked                    = 1;
  1061.   bn_DblClicked                 = 2;
  1062.   bn_Paint                      = 3;
  1063.  
  1064. { bn_Paint button draw state codes (must be in high byte) }
  1065.   bds_Hilited                   = $0100;
  1066.   bds_Disabled                  = $0200;
  1067.   bds_Default                   = $0400;
  1068.  
  1069. { Entry field styles }
  1070.   es_Left                       = $00000000;
  1071.   es_Center                     = $00000001;
  1072.   es_Right                      = $00000002;
  1073.   es_AutoScroll                 = $00000004;
  1074.   es_Margin                     = $00000008;
  1075.   es_AutoTab                    = $00000010;
  1076.   es_ReadOnly                   = $00000020;
  1077.   es_Command                    = $00000040;
  1078.   es_UnReadable                 = $00000080;
  1079.   es_AutoSize                   = $00000200;
  1080.   es_Any                        = $00000000;
  1081.   es_Sbcs                       = $00001000;
  1082.   es_Dbcs                       = $00002000;
  1083.   es_Mixed                      = $00003000;
  1084.  
  1085. { combo box styles }
  1086.   cbs_Simple                    = $0001;
  1087.   cbs_DropDown                  = $0002;
  1088.   cbs_DropDownList              = $0004;
  1089.  
  1090. { Use this bit for drop down combo boxes that do not want to       }
  1091. { receive a cbn_Enter on a single click in their list boxes.       }
  1092. { This is for compatibility with releases prior to OS/2 2.0 which  }
  1093. { did not send this message                                        }
  1094.   cbs_Compatible                = $0008;
  1095.  
  1096. { The following edit and listbox styles may be used in conjunction }
  1097. { with cbs_ styles es_AutoTab es_Any es_Sbcs es_Dbcs es_Mixed ls_HorzScroll }
  1098. { IDs of combobox entry field and listbox.                         }
  1099.   cbid_List                     = $029A;
  1100.   cbid_Edit                     = $029B;
  1101.  
  1102.   cbm_ShowList                  = $0170;
  1103.   cbm_Hilite                    = $0171;
  1104.   cbm_IsListShowing             = $0172;
  1105.  
  1106.   cbn_EfChange                  = 1;
  1107.   cbn_EfScroll                  = 2;
  1108.   cbn_MemError                  = 3;
  1109.   cbn_LbSelect                  = 4;
  1110.   cbn_LbScroll                  = 5;
  1111.   cbn_ShowList                  = 6;
  1112.   cbn_Enter                     = 7;
  1113.  
  1114. type
  1115.   PEntryFData = ^EntryFData;
  1116.   EntryFData = record
  1117.     cb:           Word;
  1118.     cchEditLimit: Word;
  1119.     ichMinSel:    Word;
  1120.     ichMaxSel:    Word;
  1121.   end;
  1122.  
  1123. { Entry Field messages }
  1124. const
  1125.   em_QueryChanged               = $0140;
  1126.   em_QuerySel                   = $0141;
  1127.   em_SetSel                     = $0142;
  1128.   em_SetTextLimit               = $0143;
  1129.   em_Cut                        = $0144;
  1130.   em_Copy                       = $0145;
  1131.   em_Clear                      = $0146;
  1132.   em_Paste                      = $0147;
  1133.   em_QueryFirstChar             = $0148;
  1134.   em_SetFirstChar               = $0149;
  1135.   em_QueryReadOnly              = $014A;
  1136.   em_SetReadOnly                = $014B;
  1137.   em_SetInsertMode              = $014C;
  1138.  
  1139. { Entry Field notification messages }
  1140.   en_SetFocus                   = $0001;
  1141.   en_KillFocus                  = $0002;
  1142.   en_Change                     = $0004;
  1143.   en_Scroll                     = $0008;
  1144.   en_MemError                   = $0010;
  1145.   en_Overflow                   = $0020;
  1146.   en_InsertModeToggle           = $0040;
  1147.  
  1148. {  Multiple Line Entries are declared in PmMle unit}
  1149.  
  1150. { List box styles }
  1151.   ls_MultipleSel                = $00000001;
  1152.   ls_OwnerDraw                  = $00000002;
  1153.   ls_NoAdjustPos                = $00000004;
  1154.   ls_HorzScroll                 = $00000008;
  1155.   ls_ExtendedSel                = $00000010;
  1156.  
  1157. { List box notification messages }
  1158.   ln_Select                     = 1;
  1159.   ln_SetFocus                   = 2;
  1160.   ln_KillFocus                  = 3;
  1161.   ln_Scroll                     = 4;
  1162.   ln_Enter                      = 5;
  1163.  
  1164. { List box messages }
  1165.   lm_QueryItemCount             = $0160;
  1166.   lm_InsertItem                 = $0161;
  1167.   lm_SetTopIndex                = $0162;
  1168.   lm_DeleteItem                 = $0163;
  1169.   lm_SelectItem                 = $0164;
  1170.   lm_QuerySelection             = $0165;
  1171.   lm_SetItemText                = $0166;
  1172.   lm_QueryItemTextLength        = $0167;
  1173.   lm_QueryItemText              = $0168;
  1174.   lm_SetItemHandle              = $0169;
  1175.   lm_QueryItemHandle            = $016A;
  1176.   lm_SearchString               = $016B;
  1177.   lm_SetItemHeight              = $016C;
  1178.   lm_QueryTopIndex              = $016D;
  1179.   lm_DeleteAll                  = $016E;
  1180.  
  1181. { List box constants }
  1182.   lit_Cursor                    = -4;
  1183.   lit_Error                     = -3;
  1184.   lit_MemError                  = -2;
  1185.   lit_None                      = -1;
  1186.   lit_First                     = -1;
  1187.  
  1188. { For lm_InsertItem msg }
  1189.   lit_End                       = -1;
  1190.   lit_SortAscending             = -2;
  1191.   lit_SortDescending            = -3;
  1192.  
  1193. { For lm_SearchString msg }
  1194.   lss_SubString                 = $0001;
  1195.   lss_Prefix                    = $0002;
  1196.   lss_CaseSensitive             = $0004;
  1197.  
  1198. { Menu control styles }
  1199.   ms_ActionBar                  = $00000001;
  1200.   ms_TitleButton                = $00000002;
  1201.   ms_VerticalFlip               = $00000004;
  1202.   ms_ConditionalCascade         = $00000040;
  1203.  
  1204. function WinLoadMenu(Frame: HWnd; Module: HModule; IdMenu: ULong): HWnd;
  1205.  
  1206. { Menu control messages }
  1207. const
  1208.   mm_InsertItem                 = $0180;
  1209.   mm_DeleteItem                 = $0181;
  1210.   mm_QueryItem                  = $0182;
  1211.   mm_SetItem                    = $0183;
  1212.   mm_QueryItemCount             = $0184;
  1213.   mm_StartMenuMode              = $0185;
  1214.   mm_EndMenuMode                = $0186;
  1215.   mm_RemoveItem                 = $0188;
  1216.   mm_SelectItem                 = $0189;
  1217.   mm_QuerySelItemId             = $018A;
  1218.   mm_QueryItemText              = $018B;
  1219.   mm_QueryItemTextLength        = $018C;
  1220.   mm_SetItemHandle              = $018D;
  1221.   mm_SetItemText                = $018E;
  1222.   mm_ItemPositionFromId         = $018F;
  1223.   mm_ItemIdFromPosition         = $0190;
  1224.   mm_QueryItemAttr              = $0191;
  1225.   mm_SetItemAttr                = $0192;
  1226.   mm_IsItemValid                = $0193;
  1227.   mm_QueryItemRect              = $0194;
  1228.  
  1229.   mm_QueryDefaultItemId         = $0431;
  1230.   mm_SetDefaultItemId           = $0432;
  1231.  
  1232. function WinCreateMenu(Parent: HWnd; lpmt: Pointer): HWnd;
  1233.  
  1234. { Owner Item Structure (Also used for listboxes) }
  1235. type
  1236.   POwnerItem = ^OwnerItem;
  1237.   OwnerItem = record
  1238.     HWnd:           HWnd;
  1239.     Hps:            Hps;
  1240.     fsState:        ULong;
  1241.     fsAttribute:    ULong;
  1242.     fsStateOld:     ULong;
  1243.     fsAttributeOld: ULong;
  1244.     rclItem:        RectL;
  1245.     idItem:         Long;       { This field contains idItem for menus, iItem for lb. }
  1246.     hItem:          ULong;
  1247.   end;
  1248.  
  1249. { Menu item }
  1250.   PMenuItem = ^MenuItem;
  1251.   MenuItem = record
  1252.     iPosition:   Integer;
  1253.     afStyle:     Word;
  1254.     afAttribute: Word;
  1255.     id:          Word;
  1256.     HWndSubMenu: HWnd;
  1257.     hItem:       ULong;
  1258.   end;
  1259.  
  1260. const
  1261.   mit_End                       = -1;
  1262.   mit_None                      = -1;
  1263.   mit_MemError                  = -1;
  1264.   mit_Error                     = -1;
  1265.   mit_First                     = -2;
  1266.   mit_Last                      = -3;
  1267.   mid_None                      = mit_None;
  1268.   mid_Error                     = -1;
  1269.  
  1270. { Menu item styles & attributes }
  1271.   mis_Text                      = $0001;
  1272.   mis_BitMap                    = $0002;
  1273.   mis_Separator                 = $0004;
  1274.   mis_OwnerDraw                 = $0008;
  1275.   mis_SubMenu                   = $0010;
  1276.   mis_MultMenu                  = $0020;        { multiple choice submenu }
  1277.   mis_SysCommand                = $0040;
  1278.   mis_Help                      = $0080;
  1279.   mis_Static                    = $0100;
  1280.   mis_ButtonSeparator           = $0200;
  1281.   mis_Break                     = $0400;
  1282.   mis_BreakSeparator            = $0800;
  1283.   mis_Group                     = $1000;        { multiple choice group start }
  1284. { In multiple choice submenus a style of 'single' denotes the item is a       }
  1285. { radiobutton. Absence of this style defaults the item to a checkbox.         }
  1286.   mis_Single                    = $2000;
  1287.  
  1288.   mia_NoDismiss                 = $0020;
  1289.   mia_Framed                    = $1000;
  1290.   mia_Checked                   = $2000;
  1291.   mia_Disabled                  = $4000;
  1292.   mia_Hilited                   = $8000;
  1293.  
  1294. function WinPopupMenu(Parent,Owner,Menu: HWnd; X,Y,IdItem: Long; fs: ULong): Bool;
  1295.  
  1296. { Values of fs in WinPopupMenu call }
  1297. const
  1298.   pu_PositionOnItem             = $0001; { Need idItem parameter }
  1299.   pu_HConstrain                 = $0002; { Keep menu on left and right edge }
  1300.   pu_VConstrain                 = $0004; { Keep menu on top and bottom edge }
  1301.   pu_None                       = $0000; { If invoked by keyboard }
  1302.   pu_MouseButton1Down           = $0008; { If invoked by button 1 }
  1303.   pu_MouseButton2Down           = $0010; { If invoked by button 2 }
  1304.   pu_MouseButton3Down           = $0018; { If invoked by button 3 }
  1305.   pu_SelectItem                 = $0020; { Set selected item (use with kbd) }
  1306.   pu_MouseButton1               = $0040; { If button1 use allowed }
  1307.   pu_MouseButton2               = $0080; { If button2 use allowed }
  1308.   pu_MouseButton3               = $0100; { If button3 use allowed }
  1309.   pu_Keyboard                   = $0200; { If keyboard use allowed}
  1310.  
  1311. { Scroll Bar styles }
  1312.   sbs_Horz                      = 0;
  1313.   sbs_Vert                      = 1;
  1314.   sbs_ThumbSize                 = 2;
  1315.   sbs_AutoTrack                 = 4;
  1316.   sbs_AutoSize                  = $2000;
  1317.  
  1318. { Scroll Bar messages }
  1319.   sbm_SetScrollBar              = $01A0;
  1320.   sbm_SetPos                    = $01A1;
  1321.   sbm_QueryPos                  = $01A2;
  1322.   sbm_QueryRange                = $01A3;
  1323.   sbm_SetThumbSize              = $01A6;
  1324.  
  1325. { Scroll Bar Commands }
  1326.   sb_LineUp                     = 1;
  1327.   sb_LineDown                   = 2;
  1328.   sb_LineLeft                   = 1;
  1329.   sb_LineRight                  = 2;
  1330.   sb_PageUp                     = 3;
  1331.   sb_PageDown                   = 4;
  1332.   sb_PageLeft                   = 3;
  1333.   sb_PageRight                  = 4;
  1334.   sb_SliderTrack                = 5;
  1335.   sb_SliderPosition             = 6;
  1336.   sb_EndScroll                  = 7;
  1337.  
  1338. type
  1339.   PSbcData = ^SbcData;
  1340.   SbcData = record
  1341.     cb:       Word;
  1342.     sHilite:  Word;             { Reserved, should be set to zero }
  1343.     posFirst: Integer;
  1344.     posLast:  Integer;
  1345.     posThumb: Integer;
  1346.     cVisible: Integer;
  1347.     cTotal:   Integer;
  1348.   end;
  1349.  
  1350.   PFrameCData = ^FrameCData;
  1351.   FrameCData = record
  1352.     cb:            Word;
  1353.     flCreateFlags: ULong;
  1354.     hmodResources: Word;
  1355.     idResources:   Word;
  1356.   end;
  1357.  
  1358. { Frame window styles }
  1359. { All unused fcf_xxx bits are reserved }
  1360. const
  1361.   fcf_TitleBar                  = $00000001;
  1362.   fcf_SysMenu                   = $00000002;
  1363.   fcf_Menu                      = $00000004;
  1364.   fcf_SizeBorder                = $00000008;
  1365.   fcf_MinButton                 = $00000010;
  1366.   fcf_MaxButton                 = $00000020;
  1367.   fcf_MinMax                    = $00000030; { MinMax means BOTH buttons }
  1368.   fcf_VertScroll                = $00000040;
  1369.   fcf_HorzScroll                = $00000080;
  1370.   fcf_DlgBorder                 = $00000100;
  1371.   fcf_Border                    = $00000200;
  1372.   fcf_ShellPosition             = $00000400;
  1373.   fcf_TaskList                  = $00000800;
  1374.   fcf_NoByteAlign               = $00001000;
  1375.   fcf_NoMoveWithOwner           = $00002000;
  1376.   fcf_Icon                      = $00004000;
  1377.   fcf_AccelTable                = $00008000;
  1378.   fcf_SysModal                  = $00010000;
  1379.   fcf_ScreenAlign               = $00020000;
  1380.   fcf_MouseAlign                = $00040000;
  1381.   fcf_HideButton                = $01000000;
  1382.   fcf_HideMax                   = $01000020; { HideMax means BOTH buttons }
  1383.   fcf_Dbe_AppStat               = $80000000;
  1384.   fcf_AutoIcon                  = $40000000;
  1385.  
  1386. { fcf_TitleBar or fcf_SysMenu or fcf_Menu or fcf_SizeBorder or fcf_MinMax or
  1387.   fcf_Icon or fcf_AccelTable or fcf_ShellPosition or fcf_TaskList }
  1388.   fcf_Standard                  = $0000CC3F;
  1389.  
  1390.   fs_Icon                       = $00000001;
  1391.   fs_AccelTable                 = $00000002;
  1392.   fs_ShellPosition              = $00000004;
  1393.   fs_TaskList                   = $00000008;
  1394.   fs_NoByteAlign                = $00000010;
  1395.   fs_NoMoveWithOwner            = $00000020;
  1396.   fs_SysModal                   = $00000040;
  1397.   fs_DlgBorder                  = $00000080;
  1398.   fs_Border                     = $00000100;
  1399.   fs_ScreenAlign                = $00000200;
  1400.   fs_MouseAlign                 = $00000400;
  1401.   fs_SizeBorder                 = $00000800;
  1402.   fs_AutoIcon                   = $00001000;
  1403.   fs_Dbe_AppStat                = $00008000;
  1404.  
  1405. { fs_Icon OR fs_AccelTable OR fs_ShellPosition OR fs_TaskList }
  1406.   fs_Standard                   = $0000000F;
  1407.  
  1408. { Frame Window Flags accessed via WinSet/QueryWindowUShort(qws_Flags) }
  1409.   ff_FlashWindow                = $0001;
  1410.   ff_Active                     = $0002;
  1411.   ff_FlashHilite                = $0004;
  1412.   ff_OwnerHidden                = $0008;
  1413.   ff_DlgDismissed               = $0010;
  1414.   ff_OwnerDisabled              = $0020;
  1415.   ff_Selected                   = $0040;
  1416.   ff_NoActivateSwp              = $0080;
  1417.  
  1418. function WinCreateStdWindow(Parent: HWnd; flStyle: ULong; var CreateFlags: ULong;
  1419.   ClientClass: PChar; Title: PChar; StyleClient: ULong; Module: HModule;
  1420.   IdResources: ULong; var ClientWindow: HWnd): HWnd;
  1421. function WinFlashWindow(Frame: HWnd; Flash: Bool): Bool;
  1422.  
  1423. { Frame window related messages }
  1424. const
  1425.   wm_FlashWindow                = $0040;
  1426.   wm_FormatFrame                = $0041;
  1427.   wm_UpdateFrame                = $0042;
  1428.   wm_FocusChange                = $0043;
  1429.   wm_SetBorderSize              = $0044;
  1430.   wm_TrackFrame                 = $0045;
  1431.   wm_MinMaxFrame                = $0046;
  1432.   wm_SetIcon                    = $0047;
  1433.   wm_QueryIcon                  = $0048;
  1434.   wm_SetAccelTable              = $0049;
  1435.   wm_QueryAccelTable            = $004A;
  1436.   wm_TranslateAccel             = $004B;
  1437.   wm_QueryTrackInfo             = $004C;
  1438.   wm_QueryBorderSize            = $004D;
  1439.   wm_NextMenu                   = $004E;
  1440.   wm_EraseBackground            = $004F;
  1441.   wm_QueryFrameInfo             = $0050;
  1442.   wm_QueryFocusChain            = $0051;
  1443.   wm_OwnerPosChange             = $0052;
  1444.   wm_CalcFrameRect              = $0053;
  1445. { Note $0054 is reserved }
  1446.   wm_WindowPosChanged           = $0055;
  1447.   wm_AdjustFramePos             = $0056;
  1448.   wm_QueryFrameCtlCount         = $0059;
  1449. { Note $005A is reserved }
  1450.   wm_QueryHelpInfo              = $005B;
  1451.   wm_SetHelpInfo                = $005C;
  1452.   wm_Error                      = $005D;
  1453.   wm_RealizePalette             = $005E;
  1454.  
  1455. { wm_QueryFrameInfo constants }
  1456.   fi_Frame                      = $00000001;
  1457.   fi_OwnerHide                  = $00000002;
  1458.   fi_ActivateOk                 = $00000004;
  1459.   fi_NoMoveWithOwner            = $00000008;
  1460.  
  1461. function WinCreateFrameControls(Frame: HWnd; var FCData: FrameCData; Title: PChar): Bool;
  1462. function WinCalcFrameRect(Frame: HWnd; var R: RectL; Client: Bool): Bool;
  1463. function WinGetMinPosition(Wnd: HWnd; var Swap: Swp; Point: PPointL): Bool;
  1464. function WinGetMaxPosition(Wnd: HWnd; var Swap: Swp): Bool;
  1465.  
  1466. type
  1467.   HSaveWp = LHandle;
  1468.  
  1469. function WinSaveWindowPos(SaveWp: HSaveWp; var Swap: Swp; Count: ULong): Bool;
  1470.  
  1471. { Frame control IDs    }
  1472. const
  1473.   fid_SysMenu                   = $8002;
  1474.   fid_TitleBar                  = $8003;
  1475.   fid_MinMax                    = $8004;
  1476.   fid_Menu                      = $8005;
  1477.   fid_VertScroll                = $8006;
  1478.   fid_HorzScroll                = $8007;
  1479.   fid_Client                    = $8008;
  1480. { Note $8009 is reserved }
  1481.   fid_Dbe_AppStat               = $8010;
  1482.   fid_Dbe_KbdStat               = $8011;
  1483.   fid_Dbe_Pecic                 = $8012;
  1484.   fid_Dbe_KkPopup               = $8013;
  1485.  
  1486. { Standard wm_SysCommand command values }
  1487.   sc_Size                       = $8000;
  1488.   sc_Move                       = $8001;
  1489.   sc_Minimize                   = $8002;
  1490.   sc_Maximize                   = $8003;
  1491.   sc_Close                      = $8004;
  1492.   sc_Next                       = $8005;
  1493.   sc_AppMenu                    = $8006;
  1494.   sc_SysMenu                    = $8007;
  1495.   sc_Restore                    = $8008;
  1496.   sc_NextFrame                  = $8009;
  1497.   sc_NextWindow                 = $8010;
  1498.   sc_TaskManager                = $8011;
  1499.   sc_HelpKeys                   = $8012;
  1500.   sc_HelpIndex                  = $8013;
  1501.   sc_HelpExtended               = $8014;
  1502.   sc_SwitchPanelIds             = $8015;
  1503.   sc_Dbe_First                  = $8018;
  1504.   sc_Dbe_Last                   = $801F;
  1505.   sc_BeginDrag                  = $8020;
  1506.   sc_EndDrag                    = $8021;
  1507.   sc_Select                     = $8022;
  1508.   sc_Open                       = $8023;
  1509.   sc_ContextMenu                = $8024;
  1510.   sc_ContextHelp                = $8025;
  1511.   sc_TextEdit                   = $8026;
  1512.   sc_BeginSelect                = $8027;
  1513.   sc_EndSelect                  = $8028;
  1514.   sc_Window                     = $8029;
  1515.   sc_Hide                       = $802A;
  1516.  
  1517. { Title bar control messages }
  1518.   TBM_SETHILITE                 = $01E3;
  1519.   TBM_QUERYHILITE               = $01E4;
  1520.  
  1521. { Rectangle routines }
  1522.  
  1523. function WinCopyRect(AB: Hab; var Dest,Src: RectL): Bool;
  1524. function WinSetRect(AB: Hab; var R: RectL; xLeft,yBottom,xRight,yTop: Long): Bool;
  1525. function WinIsRectEmpty(AB: Hab; var R: RectL): Bool;
  1526. function WinEqualRect(AB: Hab; var R1,R2: RectL): Bool;
  1527. function WinSetRectEmpty(AB: Hab; var R: RectL): Bool;
  1528. function WinOffsetRect(AB: Hab; var R: RectL; cX,cY: Long): Bool;
  1529. function WinInflateRect(AB: Hab; var R: PRectL; cX,cY: Long): Bool;
  1530. function WinPtInRect(AB: Hab; var R: RectL; var Point: PointL): Bool;
  1531. function WinIntersectRect(AB: Hab; var Dest,Src1,Src2: RectL): Bool;
  1532. function WinUnionRect(AB: Hab; var Dest,Src1,Src2: RectL): Bool;
  1533. function WinSubtractRect(AB: Hab; var Dest,Src1,Src2: RectL): Bool;
  1534. function WinMakeRect(AB: Hab; var R: RectL): Bool;
  1535. function WinMakePoints(AB: Hab; var Point: PointL; Count: ULong): Bool;
  1536.  
  1537. { System values }
  1538.  
  1539. function WinQuerySysValue(Desktop: HWnd; Index: Long): Long;
  1540. function WinSetSysValue(Desktop: HWnd; Index,Value: Long): Bool;
  1541.  
  1542. const
  1543.   sv_SwapButton                 = 0;
  1544.   sv_DblClkTime                 = 1;
  1545.   sv_CxDblClk                   = 2;
  1546.   sv_CyDblClk                   = 3;
  1547.   sv_CxSizeBorder               = 4;
  1548.   sv_CySizeBorder               = 5;
  1549.   sv_Alarm                      = 6;
  1550.   sv_ReservedFirst1             = 7;
  1551.   sv_ReservedLast1              = 8;
  1552.   sv_CursorRate                 = 9;
  1553.   sv_FirstScrollRate            = 10;
  1554.   sv_ScrollRate                 = 11;
  1555.   sv_NumberEdLists              = 12;
  1556.   sv_WarningFreq                = 13;
  1557.   sv_NoteFreq                   = 14;
  1558.   sv_ErrorFreq                  = 15;
  1559.   sv_WarningDuration            = 16;
  1560.   sv_NoteDuration               = 17;
  1561.   sv_ErrorDuration              = 18;
  1562.   sv_ReservedFirst              = 19;
  1563.   sv_ReservedLast               = 19;
  1564.   sv_CxScreen                   = 20;
  1565.   sv_CyScreen                   = 21;
  1566.   sv_CxVScroll                  = 22;
  1567.   sv_CyHScroll                  = 23;
  1568.   sv_CyVScrollArrow             = 24;
  1569.   sv_CxHScrollArrow             = 25;
  1570.   sv_CxBorder                   = 26;
  1571.   sv_CyBorder                   = 27;
  1572.   sv_CxDlgFrame                 = 28;
  1573.   sv_CyDlgFrame                 = 29;
  1574.   sv_CyTitleBar                 = 30;
  1575.   sv_CyVSlider                  = 31;
  1576.   sv_CxHSlider                  = 32;
  1577.   sv_CxMinMaxButton             = 33;
  1578.   sv_CyMinMaxButton             = 34;
  1579.   sv_CyMenu                     = 35;
  1580.   sv_CxFullScreen               = 36;
  1581.   sv_CyFullScreen               = 37;
  1582.   sv_CxIcon                     = 38;
  1583.   sv_CyIcon                     = 39;
  1584.   sv_CxPointer                  = 40;
  1585.   sv_CyPointer                  = 41;
  1586.   sv_Debug                      = 42;
  1587.   sv_CMouseButtons              = 43;
  1588.   sv_CPointerButtons            = 43;
  1589.   sv_PointerLevel               = 44;
  1590.   sv_CursorLevel                = 45;
  1591.   sv_TrackRectLevel             = 46;
  1592.   sv_CTimers                    = 47;
  1593.   sv_MousePresent               = 48;
  1594.   sv_CxByteAlign                = 49;
  1595.   sv_CxAlign                    = 49;
  1596.   sv_CyByteAlign                = 50;
  1597.   sv_CyAlign                    = 50;
  1598.  
  1599. { The following value enables any greater value to be set by WinSetSysVlaue. }
  1600. { Values of 51-55 are spare for extra non-settable system values             }
  1601. { This is to enable the setting of sv_ExtraKeyBeep by applications.          }
  1602.   sv_NotReserved                = 56;
  1603.   sv_ExtraKeyBeep               = 57;
  1604.  
  1605. { The following system value controls whether PM controls the keyboard      }
  1606. { lights for light key keystrokes (else applications will)                  }
  1607.   sv_SetLights                  = 58;
  1608.   sv_InsertMode                 = 59;
  1609.  
  1610.   sv_MenuRollDownDelay          = 64;
  1611.   sv_MenuRollUpDelay            = 65;
  1612.   sv_AltMnemonic                = 66;
  1613.   sv_TaskListMouseAccess        = 67;
  1614.  
  1615.   sv_CxIconTextWidth            = 68;
  1616.   sv_CIconTextLines             = 69;
  1617.  
  1618.   sv_ChordTime                  = 70;
  1619.   sv_CxChord                    = 71;
  1620.   sv_CyChord                    = 72;
  1621.   sv_CxMotion                   = 73;
  1622.   sv_CyMotion                   = 74;
  1623.  
  1624.   sv_BeginDrag                  = 75;
  1625.   sv_EndDrag                    = 76;
  1626.   sv_SingleSelect               = 77;
  1627.   sv_Open                       = 78;
  1628.   sv_ContextMenu                = 79;
  1629.   sv_ContextHelp                = 80;
  1630.   sv_TextEdit                   = 81;
  1631.   sv_BeginSelect                = 82;
  1632.   sv_EndSelect                  = 83;
  1633.  
  1634.   sv_BeginDragKb                = 84;
  1635.   sv_EndDragKb                  = 85;
  1636.   sv_SelectKb                   = 86;
  1637.   sv_OpenKb                     = 87;
  1638.   sv_ContextMenuKb              = 88;
  1639.   sv_ContextHelpKb              = 89;
  1640.   sv_TextEditKb                 = 90;
  1641.   sv_BeginSelectKb              = 91;
  1642.   sv_EndSelectKb                = 92;
  1643.  
  1644.   sv_Animation                  = 93;
  1645.   sv_AnimationSpeed             = 94;
  1646.  
  1647.   sv_MonoIcons                  = 95;
  1648.   sv_KbdAltered                 = 96;
  1649.   sv_PrintScreen                = 97;
  1650.   sv_CSysValues                 = 98;
  1651.  
  1652. { Presentation parameter structures }
  1653. type
  1654.   NpParam = ^Param;
  1655.   PParam = ^Param;
  1656.   Param = record
  1657.     id:   ULong;
  1658.     cb:   ULong;
  1659.     ab:   Byte;
  1660.   end;
  1661.  
  1662.   NpPresParams = ^PresParams;
  1663.   PPresParams = ^PresParams;
  1664.   PresParams = record
  1665.     cb:     ULong;
  1666.     aparam: Param;
  1667.   end;
  1668.  
  1669. { Presentation parameter APIs }
  1670.  
  1671. function WinSetPresParam(Wnd: HWnd; Id,cbParam: ULong; pbParam: Pointer): Bool;
  1672. function WinQueryPresParam(Wnd: HWnd; Id1,Id2: ULong; Id: PULong; cbBuf: ULong;
  1673.   pbBuf: Pointer; fs: ULong): ULong;
  1674. function WinRemovePresParam(Wnd: HWnd; Id: ULong): Bool;
  1675.  
  1676. { Presentation parameter types }
  1677. const
  1678.   pp_ForegroundColor            = 1;
  1679.   pp_ForegroundColorIndex       = 2;
  1680.   pp_BackgroundColor            = 3;
  1681.   pp_BackgroundColorIndex       = 4;
  1682.   pp_HiliteForegroundColor      = 5;
  1683.   pp_HiliteForegroundColorIndex = 6;
  1684.   pp_HiliteBackgroundColor      = 7;
  1685.   pp_HiliteBackgroundColorIndex = 8;
  1686.   pp_DisabledForegroundColor    = 9;
  1687.   pp_DisabledForegroundColorIndex = 10;
  1688.   pp_DisabledBackgroundColor    = 11;
  1689.   pp_DisabledBackgroundColorIndex = 12;
  1690.   pp_BorderColor                = 13;
  1691.   pp_BorderColorIndex           = 14;
  1692.   pp_FontNameSize               = 15;
  1693.   pp_FontHandle                 = 16;
  1694.   pp_Reserved                   = 17;
  1695.   pp_ActiveColor                = 18;
  1696.   pp_ActiveColorIndex           = 19;
  1697.   pp_InactiveColor              = 20;
  1698.   pp_InactiveColorIndex         = 21;
  1699.   pp_ActiveTextFgndColor        = 22;
  1700.   pp_ActiveTextFgndColorIndex   = 23;
  1701.   pp_ActiveTextBgndColor        = 24;
  1702.   pp_ActiveTextBgndColorIndex   = 25;
  1703.   pp_InactiveTextFgndColor      = 26;
  1704.   pp_InactiveTextFgndColorIndex = 27;
  1705.   pp_InactiveTextBgndColor      = 28;
  1706.   pp_InactiveTextBgndColorIndex = 29;
  1707.   pp_Shadow                     = 30;
  1708.   pp_MenuForegroundColor        = 31;
  1709.   pp_MenuForegroundColorIndex   = 32;
  1710.   pp_MenuBackgroundColor        = 33;
  1711.   pp_MenuBackgroundColorIndex   = 34;
  1712.   pp_MenuHiliteFgndColor        = 35;
  1713.   pp_MenuHiliteFgndColorIndex   = 36;
  1714.   pp_MenuHiliteBgndColor        = 37;
  1715.   pp_MenuHiliteBgndColorIndex   = 38;
  1716.   pp_MenuDisabledFgndColor      = 39;
  1717.   pp_MenuDisabledFgndColorIndex = 40;
  1718.   pp_MenuDisabledBgndColor      = 41;
  1719.   pp_MenuDisabledBgndColorIndex = 42;
  1720.  
  1721.   pp_User                       = $8000;
  1722.  
  1723. { Flags for WinQueryPresParams }
  1724.   qpf_NoInherit                 = $0001; { Don't inherit                      }
  1725.   qpf_Id1ColorIndex             = $0002; { Convert id1 color index into RGB   }
  1726.   qpf_Id2ColorIndex             = $0004; { Convert id2 color index into RGB   }
  1727.   qpf_PureRGBColor              = $0008; { Return pure RGB colors             }
  1728.   qpf_ValidFlags                = $000F; { Valid WinQueryPresParams flags     }
  1729.  
  1730. { System color functions }
  1731.  
  1732. function WinQuerySysColor(Desktop: HWnd; Color,Reserved: Long): Long;
  1733. function WinSetSysColors(Desktop: HWnd; Options,Format: ULong;
  1734.   FirstColor: Long; ColorCount: ULong; PColor: PLong): Bool;
  1735.  
  1736. const
  1737.   sysclr_ShadowHiliteBgnd       = -50;
  1738.   sysclr_ShadowHiliteFgnd       = -49;
  1739.   sysclr_ShadowText             = -48;
  1740.   sysclr_EntryField             = -47;
  1741.   sysclr_MenuDisabledText       = -46;
  1742.   sysclr_MenuHilite             = -45;
  1743.   sysclr_MenuHiliteBgnd         = -44;
  1744.   sysclr_PageBackground         = -43;
  1745.   sysclr_FieldBackground        = -42;
  1746.   sysclr_ButtonLight            = -41;
  1747.   sysclr_ButtonMiddle           = -40;
  1748.   sysclr_ButtonDark             = -39;
  1749.   sysclr_ButtonDefault          = -38;
  1750.   sysclr_TitleBottom            = -37;
  1751.   sysclr_Shadow                 = -36;
  1752.   sysclr_IconText               = -35;
  1753.   sysclr_DialogBackground       = -34;
  1754.   sysclr_HiliteForeground       = -33;
  1755.   sysclr_HiliteBackground       = -32;
  1756.   sysclr_InactiveTitleTextBgnd  = -31;
  1757.   sysclr_ActiveTitleTextBgnd    = -30;
  1758.   sysclr_InactiveTitleText      = -29;
  1759.   sysclr_ActiveTitleText        = -28;
  1760.   sysclr_OutputText             = -27;
  1761.   sysclr_WindowStaticText       = -26;
  1762.   sysclr_ScrollBar              = -25;
  1763.   sysclr_BackGround             = -24;
  1764.   sysclr_ActiveTitle            = -23;
  1765.   sysclr_InactiveTitle          = -22;
  1766.   sysclr_Menu                   = -21;
  1767.   sysclr_Window                 = -20;
  1768.   sysclr_WindowFrame            = -19;
  1769.   sysclr_MenuText               = -18;
  1770.   sysclr_WindowText             = -17;
  1771.   sysclr_TitleText              = -16;
  1772.   sysclr_ActiveBorder           = -15;
  1773.   sysclr_InactiveBorder         = -14;
  1774.   sysclr_AppWorkSpace           = -13;
  1775.   sysclr_HelpBackGround         = -12;
  1776.   sysclr_HelpText               = -11;
  1777.   sysclr_HelpHilite             = -10;
  1778.   sysclr_CSysColors             = 41;
  1779.  
  1780. { Timer manager }
  1781.  
  1782. function WinStartTimer(AB: Hab; Wnd: HWnd; IdTimer, Timeout: ULong): ULong;
  1783. function WinStopTimer(AB: Hab; Wnd: HWnd; IdTimer: ULong): Bool;
  1784. function WinGetCurrentTime(AB: Hab): ULong;
  1785.  
  1786. const
  1787.   tid_Cursor                    = $FFFF; { Reserved cursor timer ID              }
  1788.   tid_Scroll                    = $FFFE; { Reserved scrolling timer ID           }
  1789.   tid_FlashWindow               = $FFFD; { Reserved for window flashing timer ID }
  1790.   tid_UserMax                   = $7FFF; { Maximum user timer ID                 }
  1791.  
  1792. type
  1793.   HAccel = LHandle;
  1794.  
  1795. { Accelerator functions }
  1796. { Accel fs bits         }
  1797. { NOTE: the first six af_ code bits have the same value as their kc_ counterparts }
  1798. const
  1799.   af_Char                       = $0001;
  1800.   af_VirtualKey                 = $0002;
  1801.   af_ScanCode                   = $0004;
  1802.   af_Shift                      = $0008;
  1803.   af_Control                    = $0010;
  1804.   af_Alt                        = $0020;
  1805.   af_LoneKey                    = $0040;
  1806.   af_SysCommand                 = $0100;
  1807.   af_Help                       = $0200;
  1808.  
  1809. type
  1810.   PAccel = ^Accel;
  1811.   Accel = record
  1812.     fs:  Word;
  1813.     Key: Word;
  1814.     Cmd: Word;
  1815.   end;
  1816.  
  1817.   PAccelTable = ^AccelTable;
  1818.   AccelTable = record
  1819.     cAccel: Word;
  1820.     CodePage: Word;
  1821.     aaccel: Accel;
  1822.   end;
  1823.  
  1824. function WinLoadAccelTable(AB: Hab; Module: HModule; IdAccelTable: ULong): HAccel;
  1825. function WinCopyAccelTable(Acl: HAccel; AclTable: PAccelTable;
  1826.   cbCopyMax: ULong): ULong;
  1827. function WinCreateAccelTable(AB: Hab; var AclTable: AccelTable): HAccel;
  1828. function WinDestroyAccelTable(Acl: HAccel): Bool;
  1829. function WinTranslateAccel(AB: Hab; Wnd: HWnd; Acl: HAccel; var Msg: QMsg): Bool;
  1830. function WinSetAccelTable(AB: Hab; Acl: HAccel; Frame: HWnd): Bool;
  1831. function WinQueryAccelTable(AB: Hab; Frame: HWnd): HAccel;
  1832.  
  1833. { Extended Attribute Flags (Association Table) }
  1834. const
  1835.   eaf_DefaultOwner              = $0001;
  1836.   eaf_Unchangeable              = $0002;
  1837.   eaf_ReuseIcon                 = $0004;
  1838.  
  1839. { WinTrackRect information }
  1840. type
  1841.   PTrackInfo = ^TrackInfo;
  1842.   TrackInfo = record
  1843.     cxBorder:        Long;
  1844.     cyBorder:        Long;
  1845.     cxGrid:          Long;
  1846.     cyGrid:          Long;
  1847.     cxKeyboard:      Long;
  1848.     cyKeyboard:      Long;
  1849.     rclTrack:        RectL;
  1850.     rclBoundary:     RectL;
  1851.     ptlMinTrackSize: PointL;
  1852.     ptlMaxTrackSize: PointL;
  1853.     fs:              ULong;
  1854.   end;
  1855.  
  1856. function WinTrackRect(Wnd: HWnd; PS: Hps; var Info: TrackInfo): Bool;
  1857. function WinShowTrackRect(Wnd: HWnd; Show: Bool): Bool;
  1858.  
  1859. { WinTrackRect flags }
  1860. const
  1861.   tf_Left                       = $0001;
  1862.   tf_Top                        = $0002;
  1863.   tf_Right                      = $0004;
  1864.   tf_Bottom                     = $0008;
  1865.   { tf_Move = tf_Left or tf_Top or tf_Right or tf_Bottom }
  1866.   tf_Move                       = $000F;
  1867.  
  1868.   tf_SetPointerPos              = $0010;
  1869.   tf_Grid                       = $0020;
  1870.   tf_Standard                   = $0040;
  1871.   tf_AllInBoundary              = $0080;
  1872.   tf_ValidateTrackRect          = $0100;
  1873.   tf_PartInBoundary             = $0200;
  1874.  
  1875. { Clipboard Manager  }
  1876. { Clipboard messages }
  1877.   wm_RenderFmt                  = $0060;
  1878.   wm_RenderAllFmts              = $0061;
  1879.   wm_DestroyClipboard           = $0062;
  1880.   wm_PaintClipboard             = $0063;
  1881.   wm_SizeClipboard              = $0064;
  1882.   wm_HScrollClipboard           = $0065;
  1883.   wm_VScrollClipboard           = $0066;
  1884.   wm_DrawClipBoard              = $0067;
  1885.  
  1886. { Standard Clipboard formats }
  1887.   cf_Text                       = 1;
  1888.   cf_BitMap                     = 2;
  1889.   cf_DspText                    = 3;
  1890.   cf_DspBitMap                  = 4;
  1891.   cf_MetaFile                   = 5;
  1892.   cf_DspMetaFile                = 6;
  1893.   cf_Palette                    = 9;
  1894.  
  1895. { standard DDE and clipboard format stings }
  1896.   szfmt_Text                    = '1';
  1897.   szfmt_BitMap                  = '2';
  1898.   szfmt_DspText                 = '3';
  1899.   szfmt_DspBitMap               = '4';
  1900.   szfmt_MetaFile                = '5';
  1901.   szfmt_DspMetaFile             = '6';
  1902.   szfmt_Palette                 = '9';
  1903.   szfmt_Sylk                    = 'Sylk';
  1904.   szfmt_Dif                     = 'Dif';
  1905.   szfmt_Tiff                    = 'Tiff';
  1906.   szfmt_OemText                 = 'OemText';
  1907.   szfmt_Dib                     = 'Dib';
  1908.   szfmt_OwnerDisplay            = 'OwnerDisplay';
  1909.   szfmt_Link                    = 'Link';
  1910.   szfmt_MetaFilePict            = 'MetaFilePict';
  1911.   szfmt_DspMetaFilePict         = 'DspMetaFilePict';
  1912.   szfmt_CpText                  = 'Codepage Text';
  1913.   szddefmt_Rtf                  = 'Rich Text Format';
  1914.   szddefmt_PtrPict              = 'Printer_Picture';
  1915.  
  1916. type
  1917.   PMfp = ^Mfp;
  1918.   Mfp = record
  1919.     sizeBounds: PointL; { metafile notional grid size      }
  1920.     sizeMM:     PointL; { metafile size high metric units  }
  1921.     cbLength:   ULong;  { length of metafile data          }
  1922.     mapMode:    Word;   { a PM metaflie map mode           }
  1923.     reserved:   Word;
  1924.     abData:     Byte;   { metafile Data                    }
  1925.   end;
  1926.  
  1927.   PCpText = ^CpText;
  1928.   CpText = record
  1929.     idCountry:   Word;
  1930.     usCodepage:  Word;
  1931.     usLangID:    Word;
  1932.     usSubLangID: Word;
  1933.     abText:      Char;  { text string starts here          }
  1934.   end;
  1935.  
  1936. function WinSetClipbrdOwner(AB: Hab; Wnd: HWnd): Bool;
  1937. function WinSetClipbrdData(AB: Hab; Data,Fmt,rgfFmtInfo: ULong): Bool;
  1938. function WinQueryClipbrdData(AB: Hab; Fmt: ULong): ULong;
  1939. function WinQueryClipbrdFmtInfo(AB: Hab; Fmt: ULong; var FmtInfo: PULong): Bool;
  1940. function WinSetClipbrdViewer(AB: Hab; NewClipViewer: HWnd): Bool;
  1941.  
  1942. { WinSetClipbrdData flags }
  1943. const
  1944.   cfi_OwnerFree                 = $0001;
  1945.   cfi_OwnerDisplay              = $0002;
  1946.   cfi_Pointer                   = $0400;
  1947.   cfi_Handle                    = $0200;
  1948.  
  1949. function WinEnumClipbrdFmts(AB: Hab; Fmt: ULong): ULong;
  1950. function WinEmptyClipbrd(AB: Hab): Bool;
  1951. function WinOpenClipbrd(AB: Hab): Bool;
  1952. function WinCloseClipbrd(AB: Hab): Bool;
  1953. function WinQueryClipbrdOwner(AB: Hab): HWnd;
  1954. function WinQueryClipbrdViewer(AB: Hab): HWnd;
  1955.  
  1956. { Cursor manager common subsection }
  1957. function WinDestroyCursor(Wnd: HWnd): Bool;
  1958. function WinShowCursor(Wnd: HWnd; Show: Bool): Bool;
  1959. function WinCreateCursor(Wnd: HWnd; X,Y,cX,cY: Long; fs: ULong; Clip: PRectL): Bool;
  1960.  
  1961. { WinCreateCursor flags }
  1962. const
  1963.   cursor_Solid                  = $0000;
  1964.   cursor_HalfTone               = $0001;
  1965.   cursor_Frame                  = $0002;
  1966.   cursor_Flash                  = $0004;
  1967.   cursor_SetPos                 = $8000;
  1968.  
  1969. type
  1970.   PCursorInfo = ^CursorInfo;
  1971.   CursorInfo = record
  1972.     HWnd:    HWnd;
  1973.     x:       Long;
  1974.     y:       Long;
  1975.     cx:      Long;
  1976.     cy:      Long;
  1977.     fs:      ULong;
  1978.     rclClip: RectL;
  1979.   end;
  1980.  
  1981. function WinQueryCursorInfo(Desktop: HWnd; var CurInfo: CursorInfo): Bool;
  1982.  
  1983. { Pointer manager }
  1984. type
  1985.   HPointer = LHandle;
  1986.  
  1987. function WinSetPointer(Desktop: HWnd; PtrNew: HPointer): Bool;
  1988. function WinSetPointerOwner(Ptr: HPointer; Pid: Pid; Destroy: Bool): Bool;
  1989. function WinShowPointer(Desktop: HWnd; Show: Bool): Bool;
  1990. function WinQuerySysPointer(Desktop: HWnd; Index: Long; Load: Bool): HPointer;
  1991.  
  1992. { System pointers (NOTE: these are 1-based) }
  1993. const
  1994.   sptr_Arrow                    = 1;
  1995.   sptr_Text                     = 2;
  1996.   sptr_Wait                     = 3;
  1997.   sptr_Size                     = 4;
  1998.   sptr_Move                     = 5;
  1999.   sptr_Sizenwse                 = 6;
  2000.   sptr_Sizenesw                 = 7;
  2001.   sptr_Sizewe                   = 8;
  2002.   sptr_Sizens                   = 9;
  2003.   sptr_AppIcon                  = 10;
  2004.  
  2005.   sptr_IconInformation          = 11;
  2006.   sptr_IconQuestion             = 12;
  2007.   sptr_IconError                = 13;
  2008.   sptr_IconWarning              = 14;
  2009.   sptr_CPtr                     = 14;   { count loaded by pmwin }
  2010.  
  2011.   sptr_Illegal                  = 18;
  2012.   sptr_File                     = 19;
  2013.   sptr_Folder                   = 20;
  2014.   sptr_Multfile                 = 21;
  2015.   sptr_Program                  = 22;
  2016.  
  2017. { backward compatibility }
  2018.   sptr_HandIcon                 = sptr_IconError;
  2019.   sptr_QuesIcon                 = sptr_IconQuestion;
  2020.   sptr_BangIcon                 = sptr_IconWarning;
  2021.   sptr_NoteIcon                 = sptr_IconInformation;
  2022.  
  2023. function WinLoadPointer(Desktop: HWnd; Module: HModule; IdRes: ULong): HPointer;
  2024. function WinCreatePointer(Desktop: HWnd; hbmPointer: HBitMap; fPointer: Bool;
  2025.   xHotspot,yHotspot: Long): HPointer;
  2026. function WinSetPointerPos(Desktop: HWnd; X,Y: Long): Bool;
  2027. function WinDestroyPointer(Ptr: HPointer): Bool;
  2028. function WinQueryPointer(Desktop: HWnd): HPointer;
  2029. function WinQueryPointerPos(Desktop: HWnd; var Point: PointL): Bool;
  2030.  
  2031. type
  2032.   PPointerInfo = ^PointerInfo;
  2033.   PointerInfo = record
  2034.     fPointer:       ULong;
  2035.     xHotspot:       Long;
  2036.     yHotspot:       Long;
  2037.     hbmPointer:     HBitMap;
  2038.     hbmColor:       HBitMap;
  2039.     hbmMiniPointer: HBitMap;
  2040.     hbmMiniColor:   HBitMap;
  2041.   end;
  2042.  
  2043. function WinCreatePointerIndirect(Desktop: HWnd; var PtrInfo: PointerInfo): HPointer;
  2044. function WinQueryPointerInfo(Ptr: HPointer; var PtrInfo: PointerInfo): Bool;
  2045. function WinDrawPointer(PS: Hps; X,Y: Long; Ptr: HPointer; fs: ULong): Bool;
  2046.  
  2047. { WinDrawPointer() constants }
  2048. const
  2049.   dp_Normal                     = $0000;
  2050.   dp_Halftoned                  = $0001;
  2051.   dp_Inverted                   = $0002;
  2052.  
  2053. function WinGetSysBitmap(Desktop: HWnd; ibm: ULong): HBitMap;
  2054.  
  2055. { System bitmaps (NOTE: these are 1-based) }
  2056. const
  2057.   sbmp_Old_SysMenu              = 1;
  2058.   sbmp_Old_SbUpArrow            = 2;
  2059.   sbmp_Old_SbDnArrow            = 3;
  2060.   sbmp_Old_SbRgArrow            = 4;
  2061.   sbmp_Old_SbLfArrow            = 5;
  2062.   sbmp_MenuCheck                = 6;
  2063.   sbmp_Old_CheckBoxes           = 7;
  2064.   sbmp_BtnCorners               = 8;
  2065.   sbmp_Old_MinButton            = 9;
  2066.   sbmp_Old_MaxButton            = 10;
  2067.   sbmp_Old_RestoreButton        = 11;
  2068.   sbmp_Old_ChildSysMenu         = 12;
  2069.   sbmp_Drive                    = 15;
  2070.   sbmp_File                     = 16;
  2071.   sbmp_Folder                   = 17;
  2072.   sbmp_TreePlus                 = 18;
  2073.   sbmp_TreeMinus                = 19;
  2074.   sbmp_Program                  = 22;
  2075.   sbmp_MenuAttached             = 23;
  2076.   sbmp_SizeBox                  = 24;
  2077.   sbmp_SysMenu                  = 25;
  2078.   sbmp_MinButton                = 26;
  2079.   sbmp_MaxButton                = 27;
  2080.   sbmp_RestoreButton            = 28;
  2081.   sbmp_ChildSysMenu             = 29;
  2082.   sbmp_SysMenuDep               = 30;
  2083.   sbmp_MinButtonDep             = 31;
  2084.   sbmp_MaxButtonDep             = 32;
  2085.   sbmp_RestoreButtonDep         = 33;
  2086.   sbmp_ChildSysMenuDep          = 34;
  2087.   sbmp_SbUpArrow                = 35;
  2088.   sbmp_SbDnArrow                = 36;
  2089.   sbmp_SbLfArrow                = 37;
  2090.   sbmp_SbRgArrow                = 38;
  2091.   sbmp_SbUpArrowDep             = 39;
  2092.   sbmp_SbDnArrowDep             = 40;
  2093.   sbmp_SbLfArrowDep             = 41;
  2094.   sbmp_SbRgArrowDep             = 42;
  2095.   sbmp_SbUpArrowDis             = 43;
  2096.   sbmp_SbDnArrowDis             = 44;
  2097.   sbmp_SbLfArrowDis             = 45;
  2098.   sbmp_SbRgArrowDis             = 46;
  2099.   sbmp_ComBoDown                = 47;
  2100.   sbmp_CheckBoxes               = 48;
  2101.  
  2102. { Hook manager }
  2103.  
  2104. function WinSetHook(AB: Hab; Mq: Hmq; iHook: Long; HookFunc: PFn;
  2105.   Module: HModule): Bool;
  2106. function WinReleaseHook(AB: Hab; Mq: Hmq; iHook: Long; HookFunc: Pointer;
  2107.   Module: HModule): Bool;
  2108. function WinCallMsgFilter(AB: Hab; var Msg: QMsg; MsgF: ULong): Bool;
  2109.  
  2110. { Hook codes }
  2111. { 32-bit hook will receive Long parameters }
  2112. const
  2113.   hk_SendMsg                    = 0;
  2114.   { procedure SendMsgHook(AB: Hab;                      ** installer's hab
  2115.   *                       var Smh: SmhStruct;           ** p send msg struct
  2116.   *                       InterTask: Bool);             ** between threads }
  2117.  
  2118.   hk_Input                      = 1;
  2119.   { function InputHook(AB: Hab;                         ** installer's hab
  2120.   *                    var Msg: QMsg;                   ** p qmsg
  2121.   *                    fs: ULong): Bool;                ** remove/noremove }
  2122.  
  2123.   hk_MsgFilter                  = 2;
  2124.   { function MsgFilterHook(AB: Hab;                     ** installer's hab
  2125.   *                        var Msg: QMsgg,              ** p qmsg
  2126.   *                        Msgf: ULong): Bool;          ** filter flag }
  2127.  
  2128.   hk_JournalRecord              = 3;
  2129.   { procedure JournalRecordHook(AB: Hab;                ** installer's hab
  2130.   *                             var Msg: WMsg);         ** p qmsg }
  2131.  
  2132.   hk_JournalPlayBack            = 4;
  2133.   { function JournalPlaybackHook(AB: Hab;               **installer's hab
  2134.   *                           Skip: Bool fSkip,         ** skip messages
  2135.   *                           var Msg: QMsg): ULong;    ** p qmsg }
  2136.  
  2137.   hk_Help                       = 5;
  2138.   { function HelpHook(AB: Hab;                          ** installer's hab
  2139.   *                   Mode:  ULong;                     ** mode
  2140.   *                   Topic: ULong;                     ** main topic
  2141.   *                   SubTopic: ULong;                  ** sub topic
  2142.   *                   var Pos: RectL): Bool;            ** associated position }
  2143.   hk_Loader                     = 6;
  2144.   { function LoaderHook(AB: Hab;                        ** installer's hab
  2145.   *                     IdContext: Long;                ** who called hook
  2146.   *                     LibName: PChar;                 ** lib name string
  2147.   *                     var Lib: HLib;                  ** p to lib handle
  2148.   *                     ProcName: PChar;                ** procedure name
  2149.   *                     WndProc: FnWp): Bool;           ** window procedure }
  2150.  
  2151.   hk_RegisterUserMsg            = 7;
  2152.   { function RegisterUserHook(AB: Hab;                  ** installer's hab
  2153.   *                        Count: ULong;                ** entries in arRMP
  2154.   *                        arPMP: PULong;               ** RMP array
  2155.   *                        var Registered: Bool): Bool; ** msg parms already reg}
  2156.  
  2157.   hk_MsgControl                 = 8;
  2158.   { function MsgControlHook(AB: Hab;                    ** installer's hab
  2159.   *                        IdContext: Long;             ** who called hook
  2160.   *                        Wnd: HWnd;                   ** SEI window handle
  2161.   *                        ClassName: PChar;            ** window class name
  2162.   *                        MsgClass: ULong;             ** interested msg class **
  2163.   *                        IdControl: Long;             ** SMI_*
  2164.   *                        var Success: Bool): Bool;    ** mode already set}
  2165.  
  2166.   hk_PList_eEtry                = 9;
  2167.   { function ProgramListEntryHook(AB: Hab;              ** installer's hab
  2168.   *             var ProfileHookParams: PrfHookParms;    ** data
  2169.   *             var NoExecute: Bool): Bool;             ** cease hook processing}
  2170.  
  2171.   hk_PList_Exit                 = 10;
  2172.   { function ProgramListExitHook(AB: Hab;               ** installer's hab
  2173.   *         var ProfileHookParams: PrfHookParms): Bool; ** data}
  2174.  
  2175.   hk_FindWord                   = 11;
  2176.   { function FindWordHook(Codepage: ULong;              ** code page to use
  2177.   *                       Text: PChar;                  ** text to break
  2178.   *                       cb: ULong;                    ** maximum text size
  2179.   *                       ich: ULong;                   ** break 'near' here
  2180.   *                       pichStart: PULong;            ** where break began
  2181.   *                       pichEnd: PULong;              ** where break ended
  2182.   *                       pichNext: PULong): Bool;      ** where next word begin}
  2183.  
  2184.   hk_CodePageChanged            = 12;
  2185.   { procedure CodePageChangedHook(Mq: Hmq;              ** msg q handle
  2186.   *                               OldCodepage: ULong;   ** old code page
  2187.   *                               NewCodepage: ULong);  ** new code page}
  2188.  
  2189.   hk_WindowDC                   = 15;
  2190.   { function WindowDCHook(AB: Hab;                      ** installer's hab
  2191.   *                       Dc: Hdc;                      ** current Hdc
  2192.   *                       Wnd: HWnd;                    ** current HWnd
  2193.   *                       Assoc: Bool): Bool;           ** association flag}
  2194.  
  2195.   hk_DESTROYWINDOW              = 16;
  2196.   { function DestroyWindowHook(AB: Hab;                 ** installer's hab
  2197.   *                            Wnd: HWnd;               ** destroyed win HWnd
  2198.   *                            Reserved: ULong): Bool;  ** association flag}
  2199.   hk_CHECKMSGFILTER             = 20;
  2200.   { function CheckMsgFilteHook(AB: Hab;                 ** installer's hab
  2201.   *                            Msg: QMsg;               ** p qmsg
  2202.   *                            First,Last: ULong;       ** first and last msg
  2203.   *                            Options: ULong): Bool;   ** flags  }
  2204.  
  2205. { Current message queue constant }
  2206.   hmq_Current                   = Hmq(1);
  2207.  
  2208. { wh_MsgFilter context codes }
  2209.   msgf_DialogBox                = 1;
  2210.   msgf_MessageBox               = 2;
  2211.   msgf_Track                    = 8;
  2212.   msgf_DDepostMsg               = 3;
  2213.  
  2214. { hk_Help Help modes }
  2215.   hlpm_Frame                    = -1;
  2216.   hlpm_Window                   = -2;
  2217.   hlpm_Menu                     = -3;
  2218.  
  2219. { hk_SendMsg structure }
  2220.   pm_Model_1x                   = 0;
  2221.   pm_Model_2x                   = 1;
  2222.  
  2223. type
  2224.   PSmhStruct = ^SmhStruct;
  2225.   SmhStruct = record
  2226.     mp2:   MParam;
  2227.     mp1:   MParam;
  2228.     msg:   ULong;
  2229.     HWnd:  HWnd;
  2230.     model: ULong;
  2231.   end;
  2232.  
  2233. { hk_Loader context codes }
  2234. const
  2235.   lhk_DeleteProc                = 1;
  2236.   lhk_DeleteLib                 = 2;
  2237.   lhk_LoadProc                  = 3;
  2238.   lhk_LoadLib                   = 4;
  2239.  
  2240. { hk_MsgControl context codes }
  2241.   mchk_MsgInterest              = 1;
  2242.   mchk_ClassMsgInterest         = 2;
  2243.   mchk_Synchronisation          = 3;
  2244.   mchk_MsgMode                  = 4;
  2245.  
  2246. { hk_RegisterUserMsg conext codes }
  2247.   rumhk_DataType                = 1;
  2248.   rumhk_Msg                     = 2;
  2249.  
  2250. function WinSetClassThunkProc(ClassName: PChar; ThunkProc: PFn): Bool;
  2251. function WinQueryClassThunkProc(ClassName: PChar): PFn;
  2252. function WinSetWindowThunkProc(Wnd: HWnd; ThunkProc: PFn): Bool;
  2253. function WinQueryWindowThunkProc(Wnd: HWnd): PFn;
  2254. function WinQueryWindowModel(Wnd: HWnd): Long;
  2255.  
  2256. { Shell API is declared in the PmShl unit }
  2257.  
  2258. function WinQueryCp(Mq: Hmq): ULong;
  2259. function WinSetCp(Mq: Hmq; IdCodePage: ULong): Bool;
  2260. function WinQueryCpList(AB: Hab; ccpMax: ULong; PrgCp: PULong): ULong;
  2261. function WinCpTranslateString(AB: Hab; cpSrc: ULong; Src: PChar;
  2262.   cpDst: ULong; cchDestMax: ULong; Dest: PChar): Bool;
  2263. function WinCpTranslateChar(AB: Hab; cpSrc: ULong; Src: Char; cpDest: ULong): Char;
  2264. function WinUpper(AB: Hab; IdCp,IdCc: ULong; Str: PChar): ULong;
  2265. function WinUpperChar(AB: Hab; IdCp,IdCc: ULong; C: ULong): ULong;
  2266. function WinNextChar(AB: Hab; IdCp,IdCc: ULong; Str: PChar): PChar;
  2267. function WinPrevChar(AB: Hab; IdCp,IdCc: ULong; Start,Str: PChar): PChar;
  2268. function WinCompareStrings(AB: Hab; IdCp,IdCcc: ULong; Str1,Str2: PChar;
  2269.   Reserved: ULong): ULong;
  2270.  
  2271. const
  2272.   wcs_Error                     = 0;
  2273.   wcs_Eq                        = 1;
  2274.   wcs_Lt                        = 2;
  2275.   wcs_Gt                        = 3;
  2276.  
  2277. { Atom Manager Interface declarations }
  2278.  
  2279. type
  2280.   HAtomTbl = LHandle;
  2281.   Atom = ULong;
  2282.  
  2283. function WinQuerySystemAtomTable: HAtomTbl;
  2284. function WinCreateAtomTable(cbInitial,cBuckets: ULong): HAtomTbl;
  2285. function WinDestroyAtomTable(AtomTbl: HAtomTbl): HAtomTbl;
  2286. function WinAddAtom(AtomTbl: HAtomTbl; AtomName: PChar): Atom;
  2287. function WinFindAtom(AtomTbl: HAtomTbl; AtomName: Pchar): Atom;
  2288. function WinDeleteAtom(AtomTbl: HAtomTbl; Atom: Atom): Atom;
  2289. function WinQueryAtomUsage(AtomTbl: HAtomTbl; Atom: Atom): ULong;
  2290. function WinQueryAtomLength(AtomTbl: HAtomTbl; Atom: Atom): ULong;
  2291. function WinQueryAtomName(AtomTbl: HAtomTbl; Atom: Atom; Buffer: PChar;
  2292.   BufferMax: ULong): ULong;
  2293.  
  2294. { Error codes for debugging support                              }
  2295. { $1001 - $1021, $1034, $1036 - $1050 are reserved               }
  2296. const
  2297.   windbg_HWnd_Not_Destroyed     = $1022;
  2298.   windbg_HPtr_Not_Destroyed     = $1023;
  2299.   windbg_HAccel_Not_Destroyed   = $1024;
  2300.   windbg_HEnum_Not_Destroyed    = $1025;
  2301.   windbg_Visrgn_Sem_Busy        = $1026;
  2302.   windbg_User_Sem_Busy          = $1027;
  2303.   windbg_Dc_Cache_Busy          = $1028;
  2304.   windbg_Hook_Still_Installed   = $1029;
  2305.   windbg_Window_Still_Locked    = $102A;
  2306.   windbg_Updateps_Assertion_Fail = $102B;
  2307.   windbg_Sendmsg_Within_User_Sem = $102C;
  2308.   windbg_User_Sem_Not_Entered   = $102D;
  2309.   windbg_Proc_Not_Exported      = $102E;
  2310.   windbg_Bad_SendMsg_HWnd       = $102F;
  2311.   windbg_Abnormal_Exit          = $1030;
  2312.   windbg_Internal_Revision      = $1031;
  2313.   windbg_InitSystem_Failed      = $1032;
  2314.   windbg_HAtomTbl_Not_Destroyed = $1033;
  2315.   windbg_Window_Unlock_Wait     = $1035;
  2316.  
  2317. { Get/Set Error Information Interface declarations }
  2318. type
  2319.   PErrInfo = ^ErrInfo;
  2320.   ErrInfo = record
  2321.     cbFixedErrInfo: ULong;
  2322.     idError:        ErrorId;
  2323.     cDetailLevel:   ULong;
  2324.     offaoffszMsg:   ULong;
  2325.     offBinaryData:  ULong;
  2326.   end;
  2327.  
  2328. function WinGetLastError(AB: Hab): ErrorId;
  2329. function WinGetErrorInfo(AB: Hab): PErrInfo;
  2330. function WinFreeErrorInfo(var ErrInf: ErrInfo): Bool;
  2331. function WinSetErrorInfo(Err: ErrorId; Arguments: ULong): ErrorId;
  2332.  
  2333. { Important!: Original C declaration of this function is:            }
  2334. {             ERRORID APIENTRY WinSetErrorInfo(ERRORID, ULONG, ...); }
  2335. { Virtual Pascal doesn't support variable number of parameters, so   }
  2336. { the only issue is to call this function via special wrapper        }
  2337. { function written in the inline assembler.                          }
  2338.  
  2339. const
  2340.   sei_Breakpoint                = $8000; { Always enter an INT 3 breakpt       }
  2341.   sei_NoBeep                    = $4000; { Do not call DosBeep                 }
  2342.   sei_NoPrompt                  = $2000; { Do not prompt the user              }
  2343.   sei_DbgRsrvd                  = $1000; { Reserved for debug use              }
  2344.  
  2345.   sei_StackTrace                = $0001; { save the stack trace                }
  2346.   sei_Registers                 = $0002; { save the registers                  }
  2347.   sei_ArgCount                  = $0004; { first Word in args is arg count     }
  2348.   sei_DosError                  = $0008; { first Word in args is OS2 error code}
  2349.   sei_Reserved                  = $0FE0; { Reserved for future use             }
  2350.   sei_DebugOnly                 = sei_Breakpoint or sei_NoBeep or sei_NoPrompt or sei_Reserved;
  2351.  
  2352. { DDE standard system topic and item strings }
  2353.   szddesys_Topic                = 'System';
  2354.   szddesys_Item_Topics          = 'Topics';
  2355.   szddesys_Item_SysItems        = 'SysItems';
  2356.   szddesys_Item_RtnMsg          = 'ReturnMessage';
  2357.   szddesys_Item_Status          = 'Status';
  2358.   szddesys_Item_Formats         = 'Formats';
  2359.   szddesys_Item_Security        = 'Security';
  2360.   szddesys_Item_ItemFormats     = 'ItemFormats';
  2361.   szddesys_Item_Help            = 'Help';
  2362.   szddesys_Item_Protocols       = 'Protocols';
  2363.   szddesys_Item_Restart         = 'Restart';
  2364.  
  2365. { Dynamic Data Exchange (DDE) Structure Declarations }
  2366. type
  2367.   PConvContext = ^ConvContext;
  2368.   ConvContext = record
  2369.     cb:          ULong;         { SizeOf(ConvContext) }
  2370.     fsContext:   ULong;
  2371.     idCountry:   ULong;
  2372.     usCodepage:  ULong;
  2373.     usLangID:    ULong;
  2374.     usSubLangID: ULong;
  2375.   end;
  2376.  
  2377. const
  2378.   ddectxt_CaseSensitive         = $0001;
  2379.  
  2380. type
  2381.   PDdeInit = ^DdeInit;
  2382.   DdeInit = record
  2383.     cb:             ULong;      { SizeOf(DdeInit) }
  2384.     pszAppName:     PChar;
  2385.     pszTopic:       PChar;
  2386.     offConvContext: ULong;
  2387.   end;
  2388.  
  2389.   PDdeStruct = ^DdeStruct;
  2390.   DdeStruct = record
  2391.     cbData:        ULong;
  2392.     fsStatus:      Word;
  2393.     usFormat:      Word;
  2394.     offszItemName: Word;
  2395.     offabData:     Word;
  2396.   end;
  2397.  
  2398. { DDE constants for wStatus field }
  2399. const
  2400.   dde_Fack                      = $0001;
  2401.   dde_FBusy                     = $0002;
  2402.   dde_FNoData                   = $0004;
  2403.   dde_FackReq                   = $0008;
  2404.   dde_FResponse                 = $0010;
  2405.   dde_NotProcessed              = $0020;
  2406.   dde_FReserved                 = $00C0;
  2407.   dde_FAppStatus                = $FF00;
  2408.  
  2409. { old DDE public formats - new ones are cf_ constants }
  2410.   ddefmt_Text                   = $0001;
  2411.  
  2412. { Dynamic Data Exchange (DDE) Routines }
  2413.  
  2414. function WinDdeInitiate(Client: HWnd; AppName,TopicName: PChar;
  2415.   var Context: ConvContext): Bool;
  2416. function WinDdeRespond(Client,Server: HWnd; AppName,TopicName: PChar;
  2417.   var Context: ConvContext): MResult;
  2418. function WinDdePostMsg(ToWnd,FromWnd: HWnd;Wm: ULong; Dest: PDdeStruct;
  2419.   Options: ULong): Bool;
  2420.  
  2421. const
  2422.   ddepm_RETRY                   = $00000001;
  2423.   ddepm_NOFREE                  = $00000002;
  2424. { Dynamic Data Exchange (DDE) Messages }
  2425.   wm_Dde_First                  = $00A0;
  2426.   wm_Dde_Initiate               = $00A0;
  2427.   wm_Dde_Request                = $00A1;
  2428.   wm_Dde_Ack                    = $00A2;
  2429.   wm_Dde_Data                   = $00A3;
  2430.   wm_Dde_Advise                 = $00A4;
  2431.   wm_Dde_Unadvise               = $00A5;
  2432.   wm_Dde_Poke                   = $00A6;
  2433.   wm_Dde_Execute                = $00A7;
  2434.   wm_Dde_Terminate              = $00A8;
  2435.   wm_Dde_InitiateAck            = $00A9;
  2436.   wm_Dde_Last                   = $00AF;
  2437.  
  2438. { wm_DbcsFirst }
  2439.   wm_QueryConvertPos            = $00B0;
  2440.  
  2441. { Return values for wm_QueryConvertPos }
  2442.   qcp_Convert                   = $0001;
  2443.   qcp_NoConvert                 = $0000;
  2444.  
  2445. { Load/Delete Library/Procedure }
  2446.  
  2447. type
  2448.   PHLib = ^HLib;
  2449.   HLib = HModule;
  2450.  
  2451. function WinDeleteProcedure(AB: Hab; WndProc: FnWp): Bool;
  2452. function WinDeleteLibrary(AB: Hab; LibHandle: HLib): Bool;
  2453. function WinLoadProcedure(AB: Hab; LibHandle: HLib; ProcName: PChar): Pointer;
  2454. function WinLoadLibrary(AB: Hab; LibName: PChar): HLib;
  2455.  
  2456. { Desktop API definitions }
  2457. type
  2458.   PDesktop = ^Desktop;
  2459.   Desktop = record
  2460.     cbSize:       ULong;
  2461.     hbm:          HBitMap;
  2462.     x:            Long;
  2463.     y:            Long;
  2464.     fl:           ULong;
  2465.     lTileCount:   Long;
  2466.     szFile: array [0..259] of Char;
  2467.   end;
  2468.  
  2469. function WinSetDesktopBkgnd(Desktop: HWnd; var DskNew: Desktop): HBitMap;
  2470. function WinQueryDesktopBkgnd(Desktop: HWnd; var Dsk: Desktop): Bool;
  2471.  
  2472. const
  2473.   sdt_Destroy                   = $0001;
  2474.   sdt_NoBkgnd                   = $0002;
  2475.   sdt_Tile                      = $0004;
  2476.   sdt_Scale                     = $0008;
  2477.   sdt_Pattern                   = $0010;
  2478.   sdt_Center                    = $0020;
  2479.   sdt_Retain                    = $0040;
  2480.   sdt_LoadFile                  = $0080;
  2481.  
  2482. { Palette Manager API definitions }
  2483.  
  2484. function WinRealizePalette(Wnd: HWnd; PS: Hps; var CClr: ULong): Long;
  2485.  
  2486. const
  2487.   str_DllName                   = 'keyremap';
  2488.   wm_DbcsFirst                  = $00B0;
  2489.   wm_DbcsLast                   = $00CF;
  2490.  
  2491. {----[ PMMLE ]----}
  2492.  
  2493. const
  2494. { MLE Window styles ( in addition to ws_* ) }
  2495.   mls_WordWrap                  = $00000001;
  2496.   mls_Border                    = $00000002;
  2497.   mls_VScroll                   = $00000004;
  2498.   mls_HScroll                   = $00000008;
  2499.   mls_ReadOnly                  = $00000010;
  2500.   mls_IgnoreTab                 = $00000020;
  2501.   mls_DisableUndo               = $00000040;
  2502.  
  2503. { MLE External Data Types }
  2504. type
  2505.   IPt = Long;                   { insertion point }
  2506.   PIpt = ^Ipt;
  2507.   Pix  = Long;                  { pixel           }
  2508.   Line =  ULong;                { Line number     }
  2509.  
  2510.   PMleFormatRect = ^MleFormatRect;
  2511.   MleFormatRect = record
  2512.      cxFormat: Long;            { format rectangle width  }
  2513.      cyFormat: Long;            { format rectangle height }
  2514.   end;
  2515.  
  2516.   PMleCtlData = ^MleCtlData;
  2517.   MleCtlData = record
  2518.     cbCtlData:     Word;        { Length of the MLECTLDATA structure  }
  2519.     afIEFormat:    Word;        { import/export format                }
  2520.     cchText:       ULong;       { text limit                          }
  2521.     iptAnchor:     IPt;         { beginning of selection              }
  2522.     iptCursor:     IPt;         { ending of selection                 }
  2523.     cxFormat:      Long;        { format rectangle width              }
  2524.     cyFormat:      Long;        { format rectangle height             }
  2525.     afFormatFlags: ULong;       { formatting rectangle flags          }
  2526.   end;
  2527.  
  2528. { afFormatFlags mask }
  2529. const
  2530.   mlffmtrect_LimitHorz          = $00000001;
  2531.   mlffmtrect_LimitVert          = $00000002;
  2532.   mlffmtrect_MatchWindow        = $00000004;
  2533.   mlffmtrect_FormatRect         = $00000007;
  2534. { afIEFormat - Import/Export Format flags }
  2535.   mlfie_CfText                  = 0;
  2536.   mlfie_NoTrans                 = 1;
  2537.   mlfie_WinFmt                  = 2;
  2538.   mlfie_Rtf                     = 3;
  2539.  
  2540. type
  2541.   POverflow = ^MleOverflow;
  2542.   MleOverflow = record
  2543.     afErrInd:    ULong;         { see mask below                         }
  2544.     nBytesOver:  Long;          { number of bytes overflowed             }
  2545.     pixHorzOver: Long;          { number of pixels horizontally overflow }
  2546.     pixVertOver: Long;          { number of pixels vertically overflowed }
  2547.   end;
  2548.  
  2549. { afErrInd - error format rectangle flags }
  2550. const
  2551.   mlfefr_Resize                 = $00000001;
  2552.   mlfefr_TabStop                = $00000002;
  2553.   mlfefr_Font                   = $00000004;
  2554.   mlfefr_Text                   = $00000008;
  2555.   mlfefr_WordWrap               = $00000010;
  2556.   mlfetl_TextBytes              = $00000020;
  2557.  
  2558. type
  2559.   PMargStruct = ^MleMargStruct;
  2560.   MleMargStruct = record
  2561.     afMargins:   Word;          { margin indicator }
  2562.     usMouMsg:    Word;          { mouse message    }
  2563.     iptNear:     IPt;           { the geometrically nearest insertion point }
  2564.   end;
  2565.  
  2566. { afFlags - margin notification indicators }
  2567. const
  2568.   mlfmargin_Left                = $0001;
  2569.   mlfmargin_Bottom              = $0002;
  2570.   mlfmargin_Right               = $0003;
  2571.   mlfmargin_Top                 = $0004;
  2572.  
  2573. { mlm_QuerySelection flags }
  2574.   mlfqs_MinMaxSel               = 0;
  2575.   mlfqs_MinSel                  = 1;
  2576.   mlfqs_MaxSel                  = 2;
  2577.   mlfqs_AnchorSel               = 3;
  2578.   mlfqs_CursorSel               = 4;
  2579.  
  2580. { mln_ClpbdFail flags }
  2581.   mlfclpbd_TooMuchText          = $00000001;
  2582.   mlfclpbd_Error                = $00000002;
  2583.  
  2584. type
  2585.   PMle_SearchData = ^Mle_SearchData;
  2586.   Mle_SearchData = record
  2587.     cb:           Word;     { size of search spec structure       }
  2588.     pchFind:      PChar;    { string to search for                }
  2589.     pchReplace:   PChar;    { string to replace with              }
  2590.     cchFind:      Word;     { length of pchFindString             }
  2591.     cchReplace:   Word;     { length of replace string            }
  2592.     iptStart:     IPt;      { point at which to start search      }
  2593.                             { (negative indicates cursor pt)      }
  2594.                             { becomes pt where string found       }
  2595.     iptStop:      IPt;      { point at which to stop search       }
  2596.                             { (negative indicates EOT)            }
  2597.     cchFound:     Word;     { Length of found string at iptStart  }
  2598.   end;
  2599.  
  2600. { mlm_Search style flags }
  2601. const
  2602.   mlfsearch_CaseSensitive       = $00000001;
  2603.   mlfsearch_SelectMatch         = $00000002;
  2604.   mlfsearch_ChangeAll           = $00000004;
  2605.  
  2606. { MLE messages - MLM from $01B0 to $01DE; MLN from $0001 to $000F }
  2607. { formatting messages }
  2608.   mlm_SetTextLimit              = $01B0;
  2609.   mlm_QueryTextLimit            = $01B1;
  2610.   mlm_SetFormatRect             = $01B2;
  2611.   mlm_QueryFormatRect           = $01B3;
  2612.   mlm_SetWrap                   = $01B4;
  2613.   mlm_QueryWrap                 = $01B5;
  2614.   mlm_SetTabStop                = $01B6;
  2615.   mlm_QueryTabStop              = $01B7;
  2616.   mlm_SetReadOnly               = $01B8;
  2617.   mlm_QueryReadOnly             = $01B9;
  2618.  
  2619. { text content manipulation and queries Messages }
  2620.   mlm_QueryChanged              = $01BA;
  2621.   mlm_SetChanged                = $01BB;
  2622.   mlm_QueryLineCount            = $01BC;
  2623.   mlm_CharFromLine              = $01BD;
  2624.   mlm_LineFromChar              = $01BE;
  2625.   mlm_QueryLineLength           = $01BF;
  2626.   mlm_QueryTextLength           = $01C0;
  2627.  
  2628. { text import and export messages }
  2629.   mlm_Format                    = $01C1;
  2630.   mlm_SetImportExport           = $01C2;
  2631.   mlm_Import                    = $01C3;
  2632.   mlm_Export                    = $01C4;
  2633.   mlm_Delete                    = $01C6;
  2634.   mlm_QueryFormatLineLength     = $01C7;
  2635.   mlm_QueryFormatTextLength     = $01C8;
  2636.   mlm_Insert                    = $01C9;
  2637.  
  2638. { selection messages }
  2639.   mlm_SetSel                    = $01CA;
  2640.   mlm_QuerySel                  = $01CB;
  2641.   mlm_QuerySelText              = $01CC;
  2642.  
  2643. { undo and redo messages }
  2644.   mlm_QueryUndo                 = $01CD;
  2645.   mlm_Undo                      = $01CE;
  2646.   mlm_ResetUndo                 = $01CF;
  2647.  
  2648. { text attributes messages }
  2649.   mlm_QueryFont                 = $01D0;
  2650.   mlm_SetFont                   = $01D1;
  2651.   mlm_SetTextColor              = $01D2;
  2652.   mlm_QueryTextColor            = $01D3;
  2653.   mlm_SetBackColor              = $01D4;
  2654.   mlm_QueryBackColor            = $01D5;
  2655.  
  2656. { scrolling messages }
  2657.   mlm_QueryFirstChar            = $01D6;
  2658.   mlm_SetFirstChar              = $01D7;
  2659.  
  2660. { clipboard messages }
  2661.   mlm_Cut                       = $01D8;
  2662.   mlm_Copy                      = $01D9;
  2663.   mlm_Paste                     = $01DA;
  2664.   mlm_Clear                     = $01DB;
  2665.  
  2666. { display manipulation messages }
  2667.   mlm_EnableRefresh             = $01DC;
  2668.   mlm_DisableRefresh            = $01DD;
  2669.  
  2670. { search message }
  2671.   mlm_Search                    = $01DE;
  2672.   mlm_QueryImportExport         = $01DF;
  2673.  
  2674. { notification messages }
  2675.   mln_Overflow                  = $0001;
  2676.   mln_PixHorzOverflow           = $0002;
  2677.   mln_PixVertOverflow           = $0003;
  2678.   mln_TextOverflow              = $0004;
  2679.   mln_VScroll                   = $0005;
  2680.   mln_HScroll                   = $0006;
  2681.   mln_Change                    = $0007;
  2682.   mln_SetFocus                  = $0008;
  2683.   mln_KillFocus                 = $0009;
  2684.   mln_Margin                    = $000A;
  2685.   mln_SearchPause               = $000B;
  2686.   mln_MemError                  = $000C;
  2687.   mln_UndoOverflow              = $000D;
  2688.   mln_ClpbdFail                 = $000F;
  2689.  
  2690. {----[ PMGPI ]----}
  2691.  
  2692. { General GPI return values }
  2693. const
  2694.   gpi_Error                     = Bool(0);
  2695.   gpi_Ok                        = Bool(1);
  2696.   gpi_AltError                  = Bool(-1);
  2697.  
  2698. { fixed point number - implicit binary point between 2 and 3 hex digits }
  2699. type
  2700.   PFixed = ^Fixed;
  2701.   Fixed  = Long;
  2702. { fixed point number - implicit binary point between 1st and 2nd hex digits }
  2703.   Fixed88 = Word;
  2704. { fixed point signed number - implicit binary point between bits 14 and 13. }
  2705. {                             Bit 15 is the sign bit.                       }
  2706. {                             Thus 1.0 is represented by 16384 (0x4000)     }
  2707. {                             and -1.0 is represented by -16384 (0xc000)    }
  2708.   Fixed114 = Word;
  2709. { structure for size parameters e.g. for GpiCreatePS }
  2710.   PSizeL = ^SizeL;
  2711.   SizeL = record
  2712.     cx: Long;
  2713.     cy: Long;
  2714.   end;
  2715.  
  2716. { return code on GpiQueryLogColorTable,GpiQueryRealColors and GpiQueryPel }
  2717. const
  2718.   clr_NoIndex                   = -254;
  2719.   { units for GpiCreatePS and others }
  2720.   pu_Arbitrary                  = $0004;
  2721.   pu_Pels                       = $0008;
  2722.   pu_Lometric                   = $000C;
  2723.   pu_Himetric                   = $0010;
  2724.   pu_Loenglish                  = $0014;
  2725.   pu_Hienglish                  = $0018;
  2726.   pu_Twips                      = $001C;
  2727.   { format for GpiCreatePS }
  2728.   gpif_Default                  = 0;
  2729.   gpif_Short                    = $0100;
  2730.   gpif_Long                     = $0200;
  2731.   { PS type for GpiCreatePS }
  2732.   gpit_Normal                   = 0;
  2733.   gpit_Micro                    = $1000;
  2734.   { implicit associate flag for GpiCreatePS }
  2735.   gpia_NoAssoc                  = 0;
  2736.   gpia_Assoc                    = $4000;
  2737.   { return error for GpiQueryDevice }
  2738.   hdc_Error                     = Hdc(-1);
  2739.  
  2740.   { common GPICONTROL functions }
  2741.  
  2742. function GpiCreatePS(Ab: Hab; DC: Hdc; var sizlSize: SizeL; Options: ULong): Hps;
  2743. function GpiDestroyPS(PS: Hps): Bool;
  2744. function GpiAssociate(PS: Hps; DC: Hdc): Bool;
  2745. function GpiRestorePS(PS: Hps; lPSid: Long): Bool;
  2746. function GpiSavePS(PS: Hps): Long;
  2747. function GpiErase(PS: Hps): Bool;
  2748. function GpiQueryDevice(PS: Hps): Hdc;
  2749.  
  2750. { options for GpiResetPS }
  2751. const
  2752.   gres_Attrs                    = $0001;
  2753.   gres_Segments                 = $0002;
  2754.   gres_All                      = $0004;
  2755.  
  2756.   { option masks for PS options used by GpiQueryPs }
  2757.   ps_Units                      = $00FC;
  2758.   ps_Format                     = $0F00;
  2759.   ps_Type                       = $1000;
  2760.   ps_Mode                       = $2000;
  2761.   ps_Associate                  = $4000;
  2762.   ps_NoReset                    = $8000;
  2763.  
  2764.   { error context returned by GpiErrorSegmentData }
  2765.   gpie_Segment                  = 0;
  2766.   gpie_Element                  = 1;
  2767.   gpie_Data                     = 2;
  2768.  
  2769.   { control parameter for GpiSetDrawControl }
  2770.   dctl_Erase                    = 1;
  2771.   dctl_Display                  = 2;
  2772.   dctl_Boundary                 = 3;
  2773.   dctl_Dynamic                  = 4;
  2774.   dctl_Correlate                = 5;
  2775.  
  2776.   { constants for GpiSet/QueryDrawControl }
  2777.   dctl_Error                    = -1;
  2778.   dctl_Off                      = 0;
  2779.   dctl_On                       = 1;
  2780.  
  2781.   { constants for GpiSet/QueryStopDraw }
  2782.   sdw_Error                     = -1;
  2783.   sdw_Off                       = 0;
  2784.   sdw_On                        = 1;
  2785.  
  2786.   { drawing for GpiSet/QueryDrawingMode }
  2787.   dm_Error                      = 0;
  2788.   dm_Draw                       = 1;
  2789.   dm_Retain                     = 2;
  2790.   dm_DrawAndRetain              = 3;
  2791.  
  2792. { other GPICONTROL functions }
  2793.  
  2794. function GpiResetPS(PS: Hps; Options: ULong): Bool;
  2795. function GpiSetPS(PS: Hps; var sizlsize: SizeL; Options: ULong): Bool;
  2796. function GpiQueryPS(PS: Hps; var sizlsize: SizeL): ULong;
  2797. function GpiErrorSegmentData(PS: Hps; var Segment,Context: Long): Long;
  2798. function GpiQueryDrawControl(PS: Hps; Control: Long): Long;
  2799. function GpiSetDrawControl(PS: Hps; Control,Value: Long): Bool;
  2800. function GpiQueryDrawingMode(PS: Hps): Long;
  2801. function GpiSetDrawingMode(PS: Hps; Mode: Long): Bool;
  2802. function GpiQueryStopDraw(PS: Hps): Long;
  2803. function GpiSetStopDraw(PS: Hps; Value: Long): Bool;
  2804.  
  2805. { options for GpiSetPickApertureSize }
  2806. const
  2807.   pickap_Default                = 0;
  2808.   pickap_Rec                    = 2;
  2809.  
  2810.   { type of correlation for GpiCorrelateChain }
  2811.   picksel_Visible               = 0;
  2812.   picksel_All                   = 1;
  2813.  
  2814.   { return code to indicate correlate hit(s) }
  2815.   gpi_Hits                      = 2;
  2816.  
  2817. { picking, correlation and boundary functions }
  2818.  
  2819. function GpiCorrelateChain(PS: Hps; lType: Long; var ptlPick: PointL;
  2820.   MaxHits,MaxDepth: Long; var l2: Long): Long;
  2821. function GpiQueryTag(PS: Hps; var Tag: Long): Bool;
  2822. function GpiSetTag(PS: Hps; Tag: Long): Bool;
  2823. function GpiQueryPickApertureSize(PS: Hps; var sizlsize: SizeL): Bool;
  2824. function GpiSetPickApertureSize(PS: Hps; Options: Long; var sizlsize: SizeL): Bool;
  2825. function GpiQueryPickAperturePosition(PS: Hps; var ptlPoint: PointL): Bool;
  2826. function GpiSetPickAperturePosition(PS: Hps; ptlPick: PointL): Bool;
  2827. function GpiQueryBoundaryData(PS: Hps; var rclBoundary: RectL): Bool;
  2828. function GpiResetBoundaryData(PS: Hps): Bool;
  2829. function GpiCorrelateFrom(PS: Hps; FirstSegment,LastSegment,lType: Long;
  2830.   var ptlPick: PointL; MaxHits,MaxDepth: Long; var SegTag: Long): Long;
  2831. function GpiCorrelateSegment(PS: Hps; Segment,lType: Long; var ptlPick: PointL;
  2832.   MaxHits,MaxDepth: Long; var SegTag: Long): Long;
  2833.  
  2834. { data formats for GpiPutData and GpiGetData }
  2835. const
  2836.   dform_NoConv                  = 0;
  2837.   dform_S370Short               = 1;
  2838.   dform_PCShort                 = 2;
  2839.   dform_PCLong                  = 4;
  2840.  
  2841.   { segment attributes used by GpiSet/QuerySegmentAttrs and others }
  2842.   attr_Error                    = -1;
  2843.   attr_Detectable               = 1;
  2844.   attr_Visible                  = 2;
  2845.   attr_Chained                  = 6;
  2846.   attr_Dynamic                  = 8;
  2847.   attr_FastChain                = 9;
  2848.   attr_Prop_Detectable          = 10;
  2849.   attr_Prop_Visible             = 11;
  2850.   { attribute on/off values }
  2851.   attr_Off                      = 0;
  2852.   attr_On                       = 1;
  2853.  
  2854.   { segment priority used by GpiSetSegmentPriority and others }
  2855.   lower_Pri                     = -1;
  2856.   higher_Pri                    = 1;
  2857.  
  2858.   { segment control functions }
  2859.  
  2860. function GpiOpenSegment(PS: Hps; Segment: Long): Bool;
  2861. function GpiCloseSegment(PS: Hps): Bool;
  2862. function GpiDeleteSegment(PS: Hps; Segid: Long): Bool;
  2863. function GpiQueryInitialSegmentAttrs(PS: Hps; Attribute: Long): Long;
  2864. function GpiSetInitialSegmentAttrs(PS: Hps; Attribute,Value: Long): Bool;
  2865. function GpiQuerySegmentAttrs(PS: Hps; Segid,Attribute: Long): Long;
  2866. function GpiSetSegmentAttrs(PS: Hps; Segid,Attribute,Value: Long): Bool;
  2867. function GpiQuerySegmentPriority(PS: Hps; RefSegid,Order: Long): Long;
  2868. function GpiSetSegmentPriority(PS: Hps; Segid,RefSegid,Order: Long): Bool;
  2869. function GpiDeleteSegments(PS: Hps; FirstSegment,LastSegment: Long): Bool;
  2870. function GpiQuerySegmentNames(PS: Hps; FirstSegid,LastSegid,Max: Long;
  2871.   var Segids: Long): Long;
  2872.  
  2873. { draw functions for segments }
  2874. function GpiGetData(PS: Hps; Segid: Long; var Offset: Long; Format,Length: Long;
  2875.   var Data): Long;
  2876. function GpiPutData(PS: Hps; Format: Long; var Count: Long; var Data): Long;
  2877. function GpiDrawChain(PS: Hps): Bool;
  2878. function GpiDrawFrom(PS: Hps; FirstSegment,LastSegment: Long): Bool;
  2879. function GpiDrawSegment(PS: Hps; Segment: Long): Bool;
  2880. function GpiDrawDynamics(PS: Hps): Bool;
  2881. function GpiRemoveDynamics(PS: Hps; FirstSegid,LastSegid: Long): Bool;
  2882.  
  2883. { edit modes used by GpiSet/QueryEditMode }
  2884. const
  2885.   segem_Error                   = 0;
  2886.   segem_Insert                  = 1;
  2887.   segem_Replace                 = 2;
  2888.  
  2889.   { segment editing by element functions }
  2890.  
  2891. function GpiBeginElement(PS: Hps; lType: Long; Desc: PChar): Bool;
  2892. function GpiEndElement(PS: Hps): Bool;
  2893. function GpiLabel(PS: Hps; lLabel: Long): Bool;
  2894. function GpiElement(PS: Hps; lType: Long; Desc: PChar; Length: Long;
  2895.   var Data): Long;
  2896. function GpiQueryElement(PS: Hps; Off,MaxLength: Long; var Data): Long;
  2897. function GpiDeleteElement(PS: Hps): Bool;
  2898. function GpiDeleteElementRange(PS: Hps; FirstElement,LastElement: Long): Bool;
  2899. function GpiDeleteElementsBetweenLabels(PS: Hps; FirstLabel,LastLabel: Long): Bool;
  2900. function GpiQueryEditMode(PS: Hps): Long;
  2901. function GpiSetEditMode(PS: Hps; Mode: Long): Bool;
  2902. function GpiQueryElementPointer(PS: Hps): Long;
  2903. function GpiSetElementPointer(PS: Hps; Element: Long): Bool;
  2904. function GpiOffsetElementPointer(PS: Hps; offset: Long): Bool;
  2905. function GpiQueryElementType(PS: Hps; var lType: Long; Length: Long;
  2906.   Data: PChar): Long;
  2907. function GpiSetElementPointerAtLabel(PS: Hps; lLabel: Long): Bool;
  2908.  
  2909. { co-ordinates space for GpiConvert }
  2910. const
  2911.   cvtc_World                    = 1;
  2912.   cvtc_Model                    = 2;
  2913.   cvtc_DefaultPage              = 3;
  2914.   cvtc_Page                     = 4;
  2915.   cvtc_Device                   = 5;
  2916.  
  2917.   { type of transformation for GpiSetSegmentTransformMatrix }
  2918.   transform_Replace             = 0;
  2919.   transform_Add                 = 1;
  2920.   transform_Preempt             = 2;
  2921.  
  2922.   { transform matrix }
  2923. type
  2924.   PMatrixLf = ^MatrixLf;
  2925.   MatrixLf = record
  2926.     fxM11: Fixed;
  2927.     fxM12: Fixed;
  2928.     lM13:  Long;
  2929.     fxM21: Fixed;
  2930.     fxM22: Fixed;
  2931.     lM23:  Long;
  2932.     lM31:  Long;
  2933.     lM32:  Long;
  2934.     lM33:  Long;
  2935.   end;
  2936.  
  2937.   { transform and transform conversion functions }
  2938. function GpiQuerySegmentTransformMatrix(PS: Hps; Segid,Count: Long;
  2939.   var matlfArray: MatrixLf): Bool;
  2940. function GpiSetSegmentTransformMatrix(PS: Hps; Segid,Count: Long;
  2941.   var matlfarray: MatrixLf; Options: Long): Bool;
  2942. function GpiConvert(PS: Hps; Src,Targ,Count: Long; var aptlPoints: PointL): Bool;
  2943. function GpiConvertWithMatrix(PS: Hps; Countp: Long; var aptlPoints: PointL;
  2944.   Count: Long; var matlfArray: MatrixLf): Bool;
  2945. function GpiQueryModelTransformMatrix(PS: Hps; Count: Long; pmatlfArray: MatrixLf): Bool;
  2946. function GpiSetModelTransformMatrix(PS: Hps; Count: Long; matlfArray: MatrixLf;
  2947.   Options: Long): Bool;
  2948. function GpiCallSegmentMatrix(PS: Hps; Segment,Count: Long; matlfArray: MatrixLf;
  2949.   Options: Long): Long;
  2950. function GpiQueryDefaultViewMatrix(PS: Hps; Count: Long; var matlfArray: MatrixLf): Bool;
  2951. function GpiSetDefaultViewMatrix(PS: Hps; Count: Long; var matlfarray: MatrixLf;
  2952.   Options: Long): Bool;
  2953. function GpiQueryPageViewport(PS: Hps; var rclViewport: RectL): Bool;
  2954. function GpiSetPageViewport(PS: Hps; var rclViewport: RectL): Bool;
  2955. function GpiQueryViewingTransformMatrix(PS: Hps; Count: Long; matlfArray: MatrixLf): Bool;
  2956. function GpiSetViewingTransformMatrix(PS: Hps; Count: Long; matlfArray: MatrixLf;
  2957.   Options: Long): Bool;
  2958. { transform helper routines }
  2959. function GpiTranslate(PS: Hps; var matlfArray: MatrixLf; Options: Long;
  2960.   var ptlTranslation: PointL): Bool;
  2961. function GpiScale(PS: Hps; var matlfArray: MatrixLf; Options: Long;
  2962.   var afxScale: Fixed; var ptlCenter: PointL): Bool;
  2963. function GpiRotate(PS: Hps; var matlfArray: MatrixLf; Options: Long;
  2964.   fxAngle: Fixed; ptlCenter: PPointL): Bool;
  2965. { general clipping functions }
  2966. function GpiSetGraphicsField(PS: Hps; var rclField: RectL): Bool;
  2967. function GpiQueryGraphicsField(PS: Hps; var rclField: RectL): Bool;
  2968. function GpiSetViewingLimits(PS: Hps; var rclLimits: RectL): Bool;
  2969. function GpiQueryViewingLimits(PS: Hps; var rclLimits: RectL): Bool;
  2970.  
  2971. { modes for GpiModifyPath }
  2972. const
  2973.   mpath_Stroke                  = 6;
  2974.  
  2975.   { modes for GpiFillPath }
  2976.   fpath_Alternate               = 0;
  2977.   fpath_Winding                 = 2;
  2978.   fpath_Excl                    = 0;
  2979.   fpath_Incl                    = 8;
  2980.  
  2981.    { modes for GpiSetClipPath }
  2982.   scp_Alternate                 = 0;
  2983.   scp_Winding                   = 2;
  2984.   scp_And                       = 4;
  2985.   scp_Reset                     = 0;
  2986.   scp_Excl                      = 0;
  2987.   scp_Incl                      = 8;
  2988.  
  2989. { Path and Clip Path functions }
  2990.  
  2991. function GpiBeginPath(PS: Hps; Path: Long): Bool;
  2992. function GpiEndPath(PS: Hps): Bool;
  2993. function GpiCloseFigure(PS: Hps): Bool;
  2994. function GpiModifyPath(PS: Hps; Path,Mode: Long): Bool;
  2995. function GpiFillPath(PS: Hps; Path,Options: Long): Long;
  2996. function GpiSetClipPath(PS: Hps; Path,Options: Long): Bool;
  2997. function GpiOutlinePath(PS: Hps; Path,Options: Long): Long;
  2998. function GpiPathToRegion(PS: Hps; Path,Options: Long): HRgn;
  2999. function GpiStrokePath(PS: Hps; Path: Long; Options: ULong): Long;
  3000.  
  3001. { options for GpiCreateLogColorTable and others }
  3002. const
  3003.   lcol_Reset                    = $0001;
  3004.   lcol_Realizable               = $0002;
  3005.   lcol_PureColor                = $0004;
  3006.   lcol_Override_Default_Colors  = $0008;
  3007.   lcol_Realized                 = $0010;
  3008.  
  3009.   { format of logical lColor table for GpiCreateLogColorTable and others }
  3010.   lcolf_Default                 = 0;
  3011.   lcolf_IndRgb                  = 1;
  3012.   lcolf_ConsecRgb               = 2;
  3013.   lcolf_Rgb                     = 3;
  3014.   lcolf_Palette                 = 4;
  3015.  
  3016.   { options for GpiQueryRealColors and others }
  3017.   lcolopt_Realized              = $0001;
  3018.   lcolopt_Index                 = $0002;
  3019.  
  3020.   { return codes from GpiQueryLogColorTable to indicate it is in RGB mode }
  3021.   qlct_Error                    = -1;
  3022.   qlct_Rgb                      = -2;
  3023.  
  3024.   { GpiQueryLogColorTable index returned for colors not explicitly loaded }
  3025.   qlct_NotLoaded                = -1;
  3026.   { return codes for GpiQueryColorData }
  3027.   qcd_lct_Format                = 0;
  3028.   qcd_lct_LoIndex               = 1;
  3029.   qcd_lct_HiIndex               = 2;
  3030.   qcd_lct_Options               = 3;
  3031.  
  3032.   { Palette manager return values }
  3033.   pal_Error                     = -1;
  3034.  
  3035.   { color flags for GpiCreatePalette and others }
  3036.   pc_Reserved                   = $01;
  3037.   pc_Explicit                   = $02;
  3038.   pc_NoCollapse                 = $04;
  3039.  
  3040. { logical lColor table functions }
  3041.  
  3042. function GpiCreateLogColorTable(PS: Hps; Options: ULong; Format,Start,Count: Long;
  3043.   var alTable: ULong): Bool;
  3044. function GpiQueryColorData(PS: Hps; Count: Long; var alArray: Long): Bool;
  3045. function GpiQueryLogColorTable(PS: Hps; Options: ULong; Start,Count: Long;
  3046.   var alArray: Long): Long;
  3047. function GpiQueryRealColors(PS: Hps; Options: ULong; Start,Count: Long;
  3048.   var alColors: Long): Long;
  3049. function GpiQueryNearestColor(PS: Hps; Options: ULong; RgbIn: Long): Long;
  3050. function GpiQueryColorIndex(PS: Hps; Options: ULong; RgbColor: Long): Long;
  3051. function GpiQueryRGBColor(PS: Hps; Options: ULong; ColorIndex: Long): Long;
  3052.  
  3053. { Palette manager functions }
  3054. function GpiCreatePalette(Ab: Hab; Options: ULong; Format,Count: ULong;
  3055.   var aulTable: ULong): HPal;
  3056. function GpiDeletePalette(Pal: HPal): Bool;
  3057. function GpiSelectPalette(PS: Hps; Pal: HPal): HPal;
  3058. function GpiAnimatePalette(Pal: HPal; Format,Start,Count: ULong;
  3059.   var aulTable: ULong): Long;
  3060. function GpiSetPaletteEntries(Pal: HPal; Format,Start,Count: ULong;
  3061.   var aulTable: ULong): Bool;
  3062. function GpiQueryPalette(PS: Hps): HPal;
  3063. function GpiQueryPaletteInfo(Pal: HPal; PS: Hps; Options,Start,Count: ULong;
  3064.   var aulArray: ULong): Long;
  3065.  
  3066. { default color table indices }
  3067. const
  3068.   clr_False                     = -5;
  3069.   clr_True                      = -4;
  3070.  
  3071.   clr_Error                     = -255;
  3072.   clr_Default                   = -3;
  3073.   clr_White                     = -2;
  3074.   clr_Black                     = -1;
  3075.   clr_Background                = 0;
  3076.   clr_Blue                      = 1;
  3077.   clr_Red                       = 2;
  3078.   clr_Pink                      = 3;
  3079.   clr_Green                     = 4;
  3080.   clr_Cyan                      = 5;
  3081.   clr_Yellow                    = 6;
  3082.   clr_Neutral                   = 7;
  3083.  
  3084.   clr_Darkgray                  = 8;
  3085.   clr_Darkblue                  = 9;
  3086.   clr_Darkred                   = 10;
  3087.   clr_Darkpink                  = 11;
  3088.   clr_Darkgreen                 = 12;
  3089.   clr_Darkcyan                  = 13;
  3090.   clr_Brown                     = 14;
  3091.   clr_Palegray                  = 15;
  3092.  
  3093.   { RGB colors }
  3094.   rgb_Error                     = -255;
  3095.   rgb_Black                     = $00000000;
  3096.   rgb_Blue                      = $000000FF;
  3097.   rgb_Green                     = $0000FF00;
  3098.   rgb_Cyan                      = $0000FFFF;
  3099.   rgb_Red                       = $00FF0000;
  3100.   rgb_Pink                      = $00FF00FF;
  3101.   rgb_Yellow                    = $00FFFF00;
  3102.   rgb_White                     = $00FFFFFF;
  3103.  
  3104.   { control flags used by GpiBeginArea }
  3105.   ba_NoBoundary                 = 0;
  3106.   ba_Boundary                   = $0001;
  3107.   ba_Alternate                  = 0;
  3108.   ba_Winding                    = $0002;
  3109.   ba_Excl                       = 0;
  3110.   ba_Incl                       = $0008;
  3111.  
  3112.   { fill options for GpiBox/GpiFullArc }
  3113.   dro_Fill                      = 1;
  3114.   dro_Outline                   = 2;
  3115.   dro_OutlineFill               = 3;
  3116.  
  3117.   { basic pattern symbols }
  3118.   patsym_Error                  = -1;
  3119.   patsym_Default                = 0;
  3120.   patsym_Dense1                 = 1;
  3121.   patsym_Dense2                 = 2;
  3122.   patsym_Dense3                 = 3;
  3123.   patsym_Dense4                 = 4;
  3124.   patsym_Dense5                 = 5;
  3125.   patsym_Dense6                 = 6;
  3126.   patsym_Dense7                 = 7;
  3127.   patsym_Dense8                 = 8;
  3128.   patsym_Vert                   = 9;
  3129.   patsym_Horiz                  = 10;
  3130.   patsym_Diag1                  = 11;
  3131.   patsym_Diag2                  = 12;
  3132.   patsym_Diag3                  = 13;
  3133.   patsym_Diag4                  = 14;
  3134.   patsym_NoShade                = 15;
  3135.   patsym_Solid                  = 16;
  3136.   patsym_Halftone               = 17;
  3137.   patsym_Hatch                  = 18;
  3138.   patsym_DiagHatch              = 19;
  3139.   patsym_Blank                  = 64;
  3140.  
  3141.   { lcid values for GpiSet/QueryPattern and others }
  3142.   lcid_Error                    = -1;
  3143.   lcid_Default                  = 0;
  3144.  
  3145. { global primitive functions }
  3146.  
  3147. function GpiSetColor(PS: Hps; Color: Long): Bool;
  3148. function GpiQueryColor(PS: Hps): Long;
  3149.  
  3150. { line primitive functions }
  3151.  
  3152. function GpiBox(PS: Hps; Control: Long; var ptlPoint: PointL;
  3153.   HRound,VRound: Long): Long;
  3154.  
  3155. function GpiMove(PS: Hps; var ptlPoint: PointL): Bool;
  3156. function GpiLine(PS: Hps; var ptlEndPoint: PointL): Long;
  3157. function GpiPolyLine(PS: Hps; Count: Long; var aptlPoints: PointL): Long;
  3158. function GpiPolyLineDisjoint(PS: Hps; Count: Long; var aptlPoints: PointL): Long;
  3159.  
  3160. { area primitive functions }
  3161.  
  3162. function GpiSetPattern(PS: Hps; PatternSymbol: Long): Bool;
  3163. function GpiQueryPattern(PS: Hps): Long;
  3164. function GpiBeginArea(PS: Hps; Options: ULong): Bool;
  3165. function GpiEndArea(PS: Hps): Long;
  3166.  
  3167. { character primitive functions }
  3168.  
  3169. function GpiCharString(PS: Hps; Count: Long; chString: PChar): Long;
  3170. function GpiCharStringAt(PS: Hps; var ptlPoint: PointL; Count: Long;
  3171.   chString: PChar): Long;
  3172.  
  3173. { mode for GpiSetAttrMode }
  3174. const
  3175.   am_Error                      = -1;
  3176.   am_Preserve                   = 0;
  3177.   am_NoPreserve                 = 1;
  3178.  
  3179.   { foreground mixes }
  3180.   fm_Error                      = -1;
  3181.   fm_Default                    = 0;
  3182.   fm_Or                         = 1;
  3183.   fm_OverPaint                  = 2;
  3184.   fm_LeaveAlone                 = 5;
  3185.  
  3186.   fm_Xor                        = 4;
  3187.   fm_And                        = 6;
  3188.   fm_Subtract                   = 7;
  3189.   fm_MaskSrcNot                 = 8;
  3190.   fm_Zero                       = 9;
  3191.   fm_NotMergeSrc                = 10;
  3192.   fm_NotXorSrc                  = 11;
  3193.   fm_Invert                     = 12;
  3194.   fm_MergeSrcNot                = 13;
  3195.   fm_NotCopySrc                 = 14;
  3196.   fm_MergeNotSrc                = 15;
  3197.   fm_NotMaskSrc                 = 16;
  3198.   fm_One                        = 17;
  3199.  
  3200.   { background mixes }
  3201.   bm_Error                      = -1;
  3202.   bm_Default                    = 0;
  3203.   bm_Or                         = 1;
  3204.   bm_OverPaint                  = 2;
  3205.   bm_LeaveAlone                 = 5;
  3206.  
  3207.   bm_Xor                        = 4;
  3208.   bm_And                        = 6;
  3209.   bm_Subtract                   = 7;
  3210.   bm_MaskSrcNot                 = 8;
  3211.   bm_Zero                       = 9;
  3212.   bm_NotMergeSrc                = 10;
  3213.   bm_NotXorSrc                  = 11;
  3214.   bm_Invert                     = 12;
  3215.   bm_MergeSrcNot                = 13;
  3216.   bm_NotCopySrc                 = 14;
  3217.   bm_MergeNotSrc                = 15;
  3218.   bm_NotMaskSrc                 = 16;
  3219.   bm_One                        = 17;
  3220.   bm_SrcTransparent             = 18;
  3221.   bm_DestTransparent            = 19;
  3222.  
  3223.   { basic line type styles }
  3224.   linetype_Error                = -1;
  3225.   linetype_Default              = 0;
  3226.   linetype_Dot                  = 1;
  3227.   linetype_ShortDash            = 2;
  3228.   linetype_DashDot              = 3;
  3229.   linetype_DoubleDot            = 4;
  3230.   linetype_LongDash             = 5;
  3231.   linetype_DashDoubleDot        = 6;
  3232.   linetype_Solid                = 7;
  3233.   linetype_Invisible            = 8;
  3234.   linetype_Alternate            = 9;
  3235.  
  3236.   { cosmetic line widths }
  3237.   linewidth_Error               = -1;
  3238.   linewidth_Default             = 0;
  3239.   linewidth_Normal              = $00010000;   { 1.0 }
  3240.   linewidth_Thick               = $00020000;   { 2.0 }
  3241.  
  3242.   { actual line widths }
  3243.   lineWidthGeom_Error           = -1;
  3244.  
  3245.   { line end styles }
  3246.   lineend_Error                 = -1;
  3247.   lineend_Default               = 0;
  3248.   lineend_Flat                  = 1;
  3249.   lineend_Square                = 2;
  3250.   lineend_Round                 = 3;
  3251.  
  3252.   { line join styles }
  3253.   linejoin_Error                = -1;
  3254.   linejoin_Default              = 0;
  3255.   linejoin_Bevel                = 1;
  3256.   linejoin_Round                = 2;
  3257.   linejoin_Mitre                = 3;
  3258.  
  3259.   { character directions }
  3260.   chdirn_Error                  = -1;
  3261.   chdirn_Default                = 0;
  3262.   chdirn_LeftRight              = 1;
  3263.   chdirn_TopBottom              = 2;
  3264.   chdirn_RightLeft              = 3;
  3265.   chdirn_BottomTop              = 4;
  3266.  
  3267.   { character text alignments }
  3268.   ta_Normal_Horiz               = $0001;
  3269.   ta_Left                       = $0002;
  3270.   ta_Center                     = $0003;
  3271.   ta_Right                      = $0004;
  3272.   ta_Standard_Horiz             = $0005;
  3273.   ta_Normal_Vert                = $0100;
  3274.   ta_Top                        = $0200;
  3275.   ta_Half                       = $0300;
  3276.   ta_Base                       = $0400;
  3277.   ta_Bottom                     = $0500;
  3278.   ta_Standard_Vert              = $0600;
  3279.  
  3280.   { character modes }
  3281.   cm_Error                      = -1;
  3282.   cm_Default                    = 0;
  3283.   cm_Mode1                      = 1;
  3284.   cm_Mode2                      = 2;
  3285.   cm_Mode3                      = 3;
  3286.  
  3287.   { basic marker symbols }
  3288.   marksym_Error                 = -1;
  3289.   marksym_Default               = 0;
  3290.   marksym_Cross                 = 1;
  3291.   marksym_Plus                  = 2;
  3292.   marksym_Diamond               = 3;
  3293.   marksym_Square                = 4;
  3294.   marksym_SixPointStar          = 5;
  3295.   marksym_EightPointStar        = 6;
  3296.   marksym_SolidDiamond          = 7;
  3297.   marksym_SolidSquare           = 8;
  3298.   marksym_Dot                   = 9;
  3299.   marksym_SmallCircle           = 10;
  3300.   marksym_Blank                 = 64;
  3301.  
  3302.   { formatting options for GpiCharStringPosAt }
  3303.   chs_Opaque                    = $0001;
  3304.   chs_Vector                    = $0002;
  3305.   chs_LeavePos                  = $0008;
  3306.   chs_Clip                      = $0010;
  3307.   chs_Underscore                = $0200;
  3308.   chs_StrikeOut                 = $0400;
  3309.  
  3310.   { bundle codes for GpiSetAttributes and GpiQueryAttributes }
  3311.   prim_Line                     = 1;
  3312.   prim_Char                     = 2;
  3313.   prim_Marker                   = 3;
  3314.   prim_Area                     = 4;
  3315.   prim_Image                    = 5;
  3316.  
  3317.   { line bundle mask bits }
  3318.   lbb_Color                     = $0001;
  3319.   lbb_Back_Color                = $0002;
  3320.   lbb_Mix_Mode                  = $0004;
  3321.   lbb_Back_Mix_Mode             = $0008;
  3322.   lbb_Width                     = $0010;
  3323.   lbb_Geom_Width                = $0020;
  3324.   lbb_Type                      = $0040;
  3325.   lbb_End                       = $0080;
  3326.   lbb_Join                      = $0100;
  3327.  
  3328.   { character bundle mask bits }
  3329.   cbb_Color                     = $0001;
  3330.   cbb_Back_Color                = $0002;
  3331.   cbb_Mix_Mode                  = $0004;
  3332.   cbb_Back_Mix_Mode             = $0008;
  3333.   cbb_Set                       = $0010;
  3334.   cbb_Mode                      = $0020;
  3335.   cbb_Box                       = $0040;
  3336.   cbb_Angle                     = $0080;
  3337.   cbb_Shear                     = $0100;
  3338.   cbb_Direction                 = $0200;
  3339.   cbb_Text_Align                = $0400;
  3340.   cbb_Extra                     = $0800;
  3341.   cbb_Break_Extra               = $1000;
  3342.  
  3343.   { marker bundle mask bits }
  3344.   mbb_Color                     = $0001;
  3345.   mbb_Back_Color                = $0002;
  3346.   mbb_Mix_Mode                  = $0004;
  3347.   mbb_Back_Mix_Mode             = $0008;
  3348.   mbb_Set                       = $0010;
  3349.   mbb_Symbol                    = $0020;
  3350.   mbb_Box                       = $0040;
  3351.  
  3352.   { pattern bundle mask bits }
  3353.   abb_Color                     = $0001;
  3354.   abb_Back_Color                = $0002;
  3355.   abb_Mix_Mode                  = $0004;
  3356.   abb_Back_Mix_Mode             = $0008;
  3357.   abb_Set                       = $0010;
  3358.   abb_Symbol                    = $0020;
  3359.   abb_Ref_Point                 = $0040;
  3360.  
  3361.   { image bundle mask bits }
  3362.   ibb_Color                     = $0001;
  3363.   ibb_Back_Color                = $0002;
  3364.   ibb_Mix_Mode                  = $0004;
  3365.   ibb_Back_Mix_Mode             = $0008;
  3366.  
  3367. { structure for GpiSetArcParams and GpiQueryArcParams }
  3368. type
  3369.   PArcParams = ^ArcParams;
  3370.   ArcParams = record
  3371.     lP: Long;
  3372.     lQ: Long;
  3373.     lR: Long;
  3374.     lS: Long;
  3375.   end;
  3376.  
  3377. { variation of SIZE used for FIXEDs }
  3378.   PSizeF = ^SizeF;
  3379.   SizeF = record
  3380.     cx: Fixed;
  3381.     cy: Fixed;
  3382.   end;
  3383.  
  3384. { structure for gradient parameters e.g. for GpiSetCharAngle }
  3385.   PGradientL = ^GradientL;
  3386.   GradientL = record
  3387.     x: Long;
  3388.     y: Long;
  3389.   end;
  3390.  
  3391. { line bundle for GpiSetAttributes and GpiQueryAttributes }
  3392.   PLineBundle = ^LineBundle;
  3393.   LineBundle = record
  3394.     lColor:        Long;
  3395.     lBackColor:    Long;
  3396.     usMixMode:     Word;
  3397.     usBackMixMode: Word;
  3398.     fxWidth:       Fixed;
  3399.     lGeomWidth:    Long;
  3400.     usType:        Word;
  3401.     usEnd:         Word;
  3402.     usJoin:        Word;
  3403.     usReserved:    Word;
  3404.   end;
  3405.  
  3406. { character bundle for GpiSetAttributes and GpiQueryAttributes }
  3407.   PCharBundle = ^CharBundle;
  3408.   CharBundle = record
  3409.     lColor:        Long;
  3410.     lBackColor:    Long;
  3411.     usMixMode:     Word;
  3412.     usBackMixMode: Word;
  3413.     usSet:         Word;
  3414.     usPrecision:   Word;
  3415.     sizfxCell:     SizeF;
  3416.     ptlAngle:      PointL;
  3417.     ptlShear:      PointL;
  3418.     usDirection:   Word;
  3419.     usTextAlign:   Word;
  3420.     fxExtra:       Fixed;
  3421.     fxBreakExtra:  Fixed;
  3422.   end;
  3423.  
  3424. { marker bundle for GpiSetAttributes and GpiQueryAttributes }
  3425.   PMarkerBundle = ^MarkerBundle;
  3426.   MarkerBundle = record
  3427.     lColor:        Long;
  3428.     lBackColor:    Long;
  3429.     usMixMode:     Word;
  3430.     usBackMixMode: Word;
  3431.     usSet:         Word;
  3432.     usSymbol:      Word;
  3433.     sizfxCell:     SizeF;
  3434.   end;
  3435.  
  3436. { pattern bundle for GpiSetAttributes and GpiQueryAttributes }
  3437.   PAreaBundle = ^AreaBundle;
  3438.   AreaBundle = record
  3439.     lColor:        Long;
  3440.     lBackColor:    Long;
  3441.     usMixMode:     Word;
  3442.     usBackMixMode: Word;
  3443.     usSet:         Word;
  3444.     usSymbol:      Word;
  3445.     ptlRefPoint:   PointL;
  3446.   end;
  3447.  
  3448. { image bundle for GpiSetAttributes and GpiQueryAttributes }
  3449.   PImageBundle = ^ImageBundle;
  3450.   ImageBundle = record
  3451.     lColor:        Long;
  3452.     lBackColor:    Long;
  3453.     usMixMode:     Word;
  3454.     usBackMixMode: Word;
  3455.   end;
  3456.  
  3457. { pointer to any bundle used by GpiSet/QueryAttrs }
  3458.   PBundle = Pointer;
  3459.  
  3460. { array indices for GpiQueryTextBox }
  3461. const
  3462.   txtbox_TopLeft                = 0;
  3463.   txtbox_BottomLeft             = 1;
  3464.   txtbox_TopRight               = 2;
  3465.   txtbox_BottomRight            = 3;
  3466.   txtbox_Concat                 = 4;
  3467.   { array count for GpiQueryTextBox }
  3468.   txtbox_Count                  = 5;
  3469.  
  3470.   { return codes for GpiPtVisible }
  3471.   pvis_Error                    = 0;
  3472.   pvis_Invisible                = 1;
  3473.   pvis_Visible                  = 2;
  3474.  
  3475.   { return codes for GpiRectVisible }
  3476.   rvis_Error                    = 0;
  3477.   rvis_Invisible                = 1;
  3478.   rvis_Partial                  = 2;
  3479.   rvis_Visible                  = 3;
  3480.  
  3481. { attribute mode functions }
  3482.  
  3483. function GpiSetAttrMode(PS: Hps; Mode: Long): Bool;
  3484. function GpiQueryAttrMode(PS: Hps): Long;
  3485.  
  3486. { bundle primitive functions }
  3487.  
  3488. function GpiSetAttrs(PS: Hps; PrimType: Long; AttrMask,DefMask: ULong; bunAttrs: PBundle): Bool;
  3489. function GpiQueryAttrs(PS: Hps; PrimType: Long; AttrMask: ULong; bunAttrs: PBundle): Long;
  3490.  
  3491. { global primitive functions }
  3492.  
  3493. function GpiSetBackColor(PS: Hps; Color: Long): Bool;
  3494. function GpiQueryBackColor(PS: Hps): Long;
  3495. function GpiSetMix(PS: Hps; MixMode: Long): Bool;
  3496. function GpiQueryMix(PS: Hps): Long;
  3497. function GpiSetBackMix(PS: Hps; MixMode: Long): Bool;
  3498. function GpiQueryBackMix(PS: Hps): Long;
  3499.  
  3500. { line primitive functions }
  3501.  
  3502. function GpiSetLineType(PS: Hps; LineType: Long): Bool;
  3503. function GpiQueryLineType(PS: Hps): Long;
  3504. function GpiSetLineWidth(PS: Hps; LineWidth: Fixed): Bool;
  3505. function GpiQueryLineWidth(PS: Hps): Fixed;
  3506. function GpiSetLineWidthGeom(PS: Hps; LineWidth: Long): Bool;
  3507. function GpiQueryLineWidthGeom(PS: Hps): Long;
  3508. function GpiSetLineEnd(PS: Hps; LineEnd: Long): Bool;
  3509. function GpiQueryLineEnd(PS: Hps): Long;
  3510. function GpiSetLineJoin(PS: Hps; LineJoin: Long): Bool;
  3511. function GpiQueryLineJoin(PS: Hps): Long;
  3512. function GpiSetCurrentPosition(PS: Hps; var ptlPoint: PointL): Bool;
  3513. function GpiQueryCurrentPosition(PS: Hps; var ptlPoint: PointL): Bool;
  3514.  
  3515. { arc primitive functions }
  3516.  
  3517. function GpiSetArcParams(PS: Hps; var Params: ArcParams): Bool;
  3518. function GpiQueryArcParams(PS: Hps; Params: ArcParams): Bool;
  3519. function GpiPointArc(PS: Hps; var ptl2: PointL): Long;
  3520. function GpiFullArc(PS: Hps; Control: Long; Multiplier: Fixed): Long;
  3521. function GpiPartialArc(PS: Hps; var ptlCenter: PointL;
  3522.   Multiplier,StartAngle,SweepAngle: Fixed): Long;
  3523. function GpiPolyFillet(PS: Hps; Count: Long; var aptlPoints: PointL): Long;
  3524. function GpiPolySpline(PS: Hps; Count: Long; var aptlPoints: PointL): Long;
  3525. function GpiPolyFilletSharp(PS: Hps; Count: Long; var aptlPoints: PointL;
  3526.   var afxPoints: Fixed): Long;
  3527.  
  3528. { area primitive functions }
  3529.  
  3530. function GpiSetPatternSet(PS: Hps; lSet: Long): Bool;
  3531. function GpiQueryPatternSet(PS: Hps): Long;
  3532. function GpiSetPatternRefPoint(PS: Hps; var ptlRefPoint: PointL): Bool;
  3533. function GpiQueryPatternRefPoint(PS: Hps; var ptlRefPoint: PointL): Bool;
  3534.  
  3535. { character primitive functions }
  3536.  
  3537. function GpiQueryCharStringPos(PS: Hps; Options: ULong; lCount: Long;
  3538.   chString: PChar; var alXincrements: Long; var aptlPositions: PointL): Bool;
  3539. function GpiQueryCharStringPosAt(PS: Hps; var ptlStartL: PointL; Options: ULong;
  3540.   Count: Long; chString: PChar; var alXincrements: Long; var aptlPositions: PointL): Bool;
  3541. function GpiQueryTextBox(PS: Hps; Count1:Long; chString: PChar; Count2: Long;
  3542.   var aptlPoints: PointL): Bool;
  3543. function GpiQueryDefCharBox(PS: Hps; var sizlsize: SizeL): Bool;
  3544. function GpiSetCharSet(PS: Hps; lcid: Long): Bool;
  3545. function GpiQueryCharSet(PS: Hps): Long;
  3546. function GpiSetCharBox(PS: Hps; sizfxBox: SizeF): Bool;
  3547. function GpiQueryCharBox(PS: Hps; var sizfxSize: SizeF): Bool;
  3548. function GpiSetCharAngle(PS: Hps; var gradlAngle: GradientL): Bool;
  3549. function GpiQueryCharAngle(PS: Hps; var gradlAngle: GradientL): Bool;
  3550. function GpiSetCharShear(PS: Hps; var ptlAngle: PointL): Bool;
  3551. function GpiQueryCharShear(PS: Hps; ptlShear: PointL): Bool;
  3552. function GpiSetCharDirection(PS: Hps; Direction: Long): Bool;
  3553. function GpiQueryCharDirection(PS: Hps): Long;
  3554. function GpiSetCharMode(PS: Hps; Mode: Long): Bool;
  3555. function GpiQueryCharMode(PS: Hps): Long;
  3556. function GpiSetTextAlignment(PS: Hps; Horiz,Vert: Long): Bool;
  3557. function GpiQueryTextAlignment(PS: Hps; var Horiz,Vert: Long): Bool;
  3558. function GpiCharStringPos(PS: Hps; var rclRect: RectL; Options: ULong;
  3559.   Count: Long; chString: PChar; var alAdx: Long): Long;
  3560. function GpiCharStringPosAt(PS: Hps; var ptlStart: PointL; var rclRect: RectL;
  3561.   Options: ULong; Count: Long; chString: PChar; var alAdx: Long): Long;
  3562. function GpiSetCharExtra(PS: Hps; Extra: Fixed): Bool;
  3563. function GpiSetCharBreakExtra(PS: Hps; BreakExtra: Fixed): Bool;
  3564. function GpiQueryCharExtra(PS: Hps; var Extra: Fixed): Bool;
  3565. function GpiQueryCharBreakExtra(PS: Hps; var BreakExtra: Fixed): Bool;
  3566.  
  3567. { marker primitive functions  }
  3568.  
  3569. function GpiMarker(PS: Hps; var ptlPoint: PointL): Long;
  3570. function GpiPolyMarker(PS: Hps; Count: Long; var aptlPoints: PointL): Long;
  3571. function GpiSetMarker(PS: Hps; Symbol: Long): Bool;
  3572. function GpiSetMarkerBox(PS: Hps; var sizfxSize: SizeF): Bool;
  3573. function GpiSetMarkerSet(PS: Hps; lSet: Long): Bool;
  3574. function GpiQueryMarker(PS: Hps): Long;
  3575. function GpiQueryMarkerBox(PS: Hps; var sizfxSize: SizeF): Bool;
  3576. function GpiQueryMarkerSet(PS: Hps): Long;
  3577.  
  3578. { image primitive functions }
  3579.  
  3580. function GpiImage(PS: Hps; Format: Long; var sizlImageSize: SizeL;
  3581.   Length: Long; var Data): Long;
  3582.  
  3583. { miscellaneous primitive functions }
  3584.  
  3585. function GpiPop(PS: Hps; Count: Long): Bool;
  3586. function GpiPtVisible(PS: Hps; var ptlPoint: PointL): Long;
  3587. function GpiRectVisible(PS: Hps; var rclRectangle: RectL): Long;
  3588. function GpiComment(PS: Hps; Length: Long; var Data): Bool;
  3589.  
  3590. { return codes from GpiCreateLogFont }
  3591. const
  3592.   font_Default                  = 1;
  3593.   font_Match                    = 2;
  3594.  
  3595.   { lcid type for GpiQuerySetIds }
  3596.   lcidt_Font                    = 6;
  3597.   lcidt_BitMap                  = 7;
  3598.  
  3599.   { constant used to delete all lcids by GpiDeleteSetId }
  3600.   lcid_All                      = -1;
  3601.  
  3602. type
  3603.   { kerning data returned by GpiQueryKerningPairs }
  3604.   PKerningPairs = ^KerningPairs;
  3605.   KerningPairs = record
  3606.     sFirstChar:     Word;
  3607.     sSecondChar:    Word;
  3608.     lKerningAmount: Long;
  3609.   end;
  3610.  
  3611.   { data required by GpiQueryFaceString }
  3612.   PFaceNameDesc = ^FaceNameDesc;
  3613.   FaceNameDesc = record
  3614.     usSize:        Word;
  3615.     usWeightClass: Word;
  3616.     usWidthClass:  Word;
  3617.     usReserved:    Word;
  3618.     flOptions:     ULong;
  3619.   end;
  3620.  
  3621.   { FACENAMEDESC 'WeightClass' options for GpiQueryFaceString }
  3622.   const
  3623.   fweight_Dont_Care             = 0;
  3624.   fweight_Ultra_Light           = 1;
  3625.   fweight_Extra_Light           = 2;
  3626.   fweight_Light                 = 3;
  3627.   fweight_Semi_Light            = 4;
  3628.   fweight_Normal                = 5;
  3629.   fweight_Semi_Bold             = 6;
  3630.   fweight_Bold                  = 7;
  3631.   fweight_Extra_Bold            = 8;
  3632.   fweight_Ultra_Bold            = 9;
  3633.  
  3634.   { faceNAMEDESC 'WidthClass' options for GpiQueryFaceString }
  3635.   fwidth_Dont_Care              = 0;
  3636.   fwidth_Ultra_Condensed        = 1;
  3637.   fwidth_Extra_Condensed        = 2;
  3638.   fwidth_Condensed              = 3;
  3639.   fwidth_Semi_Condensed         = 4;
  3640.   fwidth_Normal                 = 5;
  3641.   fwidth_Semi_Expanded          = 6;
  3642.   fwidth_Expanded               = 7;
  3643.   fwidth_Extra_Expanded         = 8;
  3644.   fwidth_Ultra_Expanded         = 9;
  3645.  
  3646.   { FACENAMEDESC 'options' for GpiQueryFaceString }
  3647.   ftype_Italic                  = $0001;
  3648.   ftype_Italic_Dont_Care        = $0002;
  3649.   ftype_Oblique                 = $0004;
  3650.   ftype_Oblique_Dont_Care       = $0008;
  3651.   ftype_Rounded                 = $0010;
  3652.   ftype_Rounded_Dont_Care       = $0020;
  3653.  
  3654.   { actions for GpiQueryFontAction }
  3655.   qfa_Public                    = 1;
  3656.   qfa_Private                   = 2;
  3657.   qfa_Error                     = GPI_ALTERROR;
  3658.  
  3659.   { options for GpiQueryFonts }
  3660.   qf_Public                     = $0001;
  3661.   qf_Private                    = $0002;
  3662.   qf_No_Generic                 = $0004;
  3663.   qf_No_Device                  = $0008;
  3664.  
  3665. { font file descriptions for GpiQueryFontFileDescriptions }
  3666. type
  3667.   PFfDescs  = ^FfDescS;
  3668.   FfDescs   = array [0..1,0..FaceSize-1] of Char;
  3669.   PFfDescs2 = ^FfDescs2;
  3670.   FfDescs2  = record
  3671.     cbLength:         ULong;
  3672.     cbFacenameOffset: ULong;
  3673.     abFamilyName: array[0..0] of Byte;
  3674.   end;
  3675.  
  3676. { physical and logical font functions }
  3677.  
  3678. function GpiCreateLogFont(PS: Hps; Name: PStr8; Lcid: Long; var fatAttrs: FAttrs): Long;
  3679. function GpiDeleteSetId(PS: Hps; Lcid: Long): Bool;
  3680. function GpiLoadFonts(Ab: Hab; Filename: PChar): Bool;
  3681. function GpiUnloadFonts(Ab: Hab; Filename: PChar): Bool;
  3682. function GpiQueryFonts(PS: Hps; Options: ULong; Facename: PChar; var ReqFonts: Long;
  3683.   MetricsLength: Long; var afmMetrics: FontMetrics): Long;
  3684. function GpiQueryFontMetrics(PS: Hps; MetricsLength: Long; var fmMetrics: FontMetrics): Bool;
  3685. function GpiQueryKerningPairs(PS: Hps; Count: Long; var akrnprData: KerningPairs): Long;
  3686. function GpiQueryWidthTable(PS: Hps; FirstChar,Count: Long; var alData: Long): Bool;
  3687. function GpiQueryNumberSetIds(PS: Hps): Long;
  3688. function GpiQuerySetIds(PS: Hps; Count: Long; var alTypes: Long; var aNames: Str8;
  3689.   var allcids: Long): Bool;
  3690. function GpiQueryFaceString(PS: Hps; FamilyName: PChar; var attrs: FaceNameDesc;
  3691.   length: Long; CompoundFaceName: PChar): ULong;
  3692. function GpiQueryLogicalFont(PS: Hps; cid: Long; var Name: Str8; var attrs: FAttrs;
  3693.   Length: Long): Bool;
  3694. function GpiQueryFontAction(AB: Hab; Options: ULong): ULong;
  3695. function GpiLoadPublicFonts(AB: Hab; Filename: PChar): Bool;
  3696. function GpiUnloadPublicFonts(AB: Hab; Filename: PChar): Bool;
  3697. function GpiSetCp(PS: Hps; CodePage: ULong): Bool;
  3698. function GpiQueryCp(PS: Hps): ULong;
  3699. function GpiQueryFontFileDescriptions(Ab: Hab; Filename: PChar;
  3700.   var Count: Long; var affdescsNames: FfDescs): Long;
  3701. function GpiQueryFullFontFileDescs(Ab: Hab; Filename: PChar;
  3702.   var Count: Long; var Names; var NamesBuffLength: Long): Long;
  3703.  
  3704. { raster operations defined for GpiBitBlt }
  3705. const
  3706.   rop_SrcCopy                   = $00CC;
  3707.   rop_SrcPaint                  = $00EE;
  3708.   rop_SrcAnd                    = $0088;
  3709.   rop_SrcInvert                 = $0066;
  3710.   rop_SrcErase                  = $0044;
  3711.   rop_NotSrcCopy                = $0033;
  3712.   rop_NotSrcErase               = $0011;
  3713.   rop_MergeCopy                 = $00C0;
  3714.   rop_MergePaint                = $00BB;
  3715.   rop_PatCopy                   = $00F0;
  3716.   rop_PatPaint                  = $00FB;
  3717.   rop_PatInvert                 = $005A;
  3718.   rop_DstInvert                 = $0055;
  3719.   rop_Zero                      = $0000;
  3720.   rop_One                       = $00FF;
  3721.  
  3722.   { Blt options for GpiBitBlt }
  3723.   bbo_Or                        = 0;
  3724.   bbo_And                       = 1;
  3725.   bbo_Ignore                    = 2;
  3726.   bbo_Pal_Colors                = 4;
  3727.   bbo_No_Color_Info             = 8;
  3728.  
  3729.   { Fill options for GpiFloodFill }
  3730.   ff_Boundary                   = 0;
  3731.   ff_Surface                    = 1;
  3732.  
  3733.   { error return for GpiSetBitmap }
  3734.   hbm_Error                     = HBitMap(-1);
  3735.  
  3736. { bitmap and pel functions }
  3737.  
  3738. function GpiBitBlt(Target,Src: Hps; Count: Long; var aptlPoints: PointL;
  3739.   Rop: Long; Options: ULong): Long;
  3740. function GpiDeleteBitmap(BitMap: HBitMap): Bool;
  3741. function GpiLoadBitmap(PS: Hps; Resource: HModule; idBitmap: ULong;
  3742.   Width,Height: Long): HBitMap;
  3743. function GpiSetBitmap(PS: Hps; Bitmap: HBitMap): HBitMap;
  3744. function GpiWCBitBlt(PS: Hps; Src: HBitMap; Count: Long; var aptlPoints: PointL;
  3745.   Rop: Long; Options: ULong): Long;
  3746.  
  3747. { bitmap structures and file formats (from PMBITMAP.H) }
  3748.  
  3749. { This is the file format structure for Bit Maps, Pointers and Icons    }
  3750. { as stored in the resource file of a PM application.                   }
  3751. {                                                                       }
  3752. { Notes on file format:                                                 }
  3753. {                                                                       }
  3754. { Each BITMAPFILEHEADER entry is immediately followed by the color table}
  3755. { for the bit map bits it references.                                   }
  3756. { Icons and Pointers contain two BITMAPFILEHEADERs for each ARRAYHEADER }
  3757. { item.  The first one is for the ANDXOR mask, the second is for the    }
  3758. { COLOR mask.  All offsets are absolute based on the start of the FILE. }
  3759. {                                                                       }
  3760. { For OS/2 Version 2.0 and later BITMAPFILEHEADER2 and the other '2'    }
  3761. { versions of each structure are recommended. Use the non-2 versions    }
  3762. { of each structure if compatibility with OS/2 Version 1.X is required. }
  3763.  
  3764. { bitmap parameterization used by GpiCreateBitmap and others }
  3765. type
  3766.   PBitMapInfoHeader = ^BitMapInfoHeader;
  3767.   BitMapInfoHeader = record
  3768.     cbFix:     ULong;
  3769.     cx:        Word;
  3770.     cy:        Word;
  3771.     cPlanes:   Word;
  3772.     cBitCount: Word;
  3773.   end;
  3774.  
  3775.   { RGB data for _BITMAPINFO struct }
  3776.   RGB = record
  3777.     bBlue:  Byte;
  3778.     bGreen: Byte;
  3779.     bRed:   Byte;
  3780.   end;
  3781.  
  3782.   { bitmap data used by GpiSetBitmapBits and others }
  3783.   PBitMapInfo = ^BitMapInfo;
  3784.   BitMapInfo = record
  3785.     cbFix:        ULong;
  3786.     cx:           Word;
  3787.     cy:           Word;
  3788.     cPlanes:      Word;
  3789.     cBitCount:    Word;
  3790.     argbColor: array[0..0] of RGB;
  3791.   end;
  3792.  
  3793. { Constants for compression/decompression command }
  3794. const
  3795.   cbd_Compression               = 1;
  3796.   cbd_DeCompression             = 2;
  3797.   cbd_Bits                      = 0;
  3798.  
  3799.   { Flags for compression/decompression option }
  3800.  
  3801.   cbd_Color_Conversion          = $00000001;
  3802.  
  3803.   { Compression scheme in the ulCompression field of the bitmapinfo structure }
  3804.  
  3805.   bca_Uncomp                    = 0;
  3806.   bca_Huffman1d                 = 3;
  3807.   bca_Rle4                      = 2;
  3808.   bca_Rle8                      = 1;
  3809.   bca_Rle24                     = 4;
  3810.  
  3811.   bru_Metric                    = 0;
  3812.  
  3813.   bra_BottomUp                  = 0;
  3814.  
  3815.   brh_NotHalfToned              = 0;
  3816.   brh_ErrorDiffusion            = 1;
  3817.   brh_Panda                     = 2;
  3818.   brh_SuperCircle               = 3;
  3819.  
  3820.   bce_Palette                   = -1;
  3821.   bce_Rgb                       = 0;
  3822.  
  3823. type
  3824.   PBitMapInfoHeader2 = ^BitMapInfoHeader2;
  3825.   BitMapInfoHeader2 = record
  3826.     cbFix:           ULong;     { Length of structure                    }
  3827.     cx:              ULong;     { Bit-map width in pels                  }
  3828.     cy:              ULong;     { Bit-map height in pels                 }
  3829.     cPlanes:         Word;      { Number of bit planes                   }
  3830.     cBitCount:       Word;      { Number of bits per pel within a plane  }
  3831.     ulCompression:   ULong;     { Compression scheme used to store the bitmap }
  3832.     cbImage:         ULong;     { Length of bit-map storage data in bytes}
  3833.     cxResolution:    ULong;     { x resolution of target device          }
  3834.     cyResolution:    ULong;     { y resolution of target device          }
  3835.     cclrUsed:        ULong;     { Number of color indices used           }
  3836.     cclrImportant:   ULong;     { Number of important color indices      }
  3837.     usUnits:         Word;      { Units of measure                       }
  3838.     usReserved:      Word;      { Reserved                               }
  3839.     usRecording:     Word;      { Recording algorithm                    }
  3840.     usRendering:     Word;      { Halftoning algorithm                   }
  3841.     cSize1:          ULong;     { Size value 1                           }
  3842.     cSize2:          ULong;     { Size value 2                           }
  3843.     ulColorEncoding: ULong;     { Color encoding                         }
  3844.     ulIdentifier:    ULong;     { Reserved for application use           }
  3845.   end;
  3846.  
  3847.   PRGB2 = ^RGB2;
  3848.   RGB2 = record
  3849.     bBlue:     Byte;            { Blue component of the color definition }
  3850.     bGreen:    Byte;            { Green component of the color definition}
  3851.     bRed:      Byte;            { Red component of the color definition  }
  3852.     fcOptions: Byte;            { Reserved, must be zero                 }
  3853.    end;
  3854.  
  3855.    PBitMapInfo2 = ^BitMapInfo2;
  3856.    BitMapInfo2 = record
  3857.      cbFix:           ULong;    { Length of fixed portion of structure   }
  3858.      cx:              ULong;    { Bit-map width in pels                  }
  3859.      cy:              ULong;    { Bit-map height in pels                 }
  3860.      cPlanes:         Word;     { Number of bit planes                   }
  3861.      cBitCount:       Word;     { Number of bits per pel within a plane  }
  3862.      ulCompression:   ULong;    { Compression scheme used to store the bitmap }
  3863.      cbImage:         ULong;    { Length of bit-map storage data in bytes}
  3864.      cxResolution:    ULong;    { x resolution of target device          }
  3865.      cyResolution:    ULong;    { y resolution of target device          }
  3866.      cclrUsed:        ULong;    { Number of color indices used           }
  3867.      cclrImportant:   ULong;    { Number of important color indices      }
  3868.      usUnits:         Word;     { Units of measure                       }
  3869.      usReserved:      Word;     { Reserved                               }
  3870.      usRecording:     Word;     { Recording algorithm                    }
  3871.      usRendering:     Word;     { Halftoning algorithm                   }
  3872.      cSize1:          ULong;    { Size value 1                           }
  3873.      cSize2:          ULong;    { Size value 2                           }
  3874.      ulColorEncoding: ULong;    { Color encoding                         }
  3875.      ulIdentifier:    ULong;    { Reserved for application use           }
  3876.      argbColor: array [0..0] of RGB2; { Color definition record          }
  3877.   end;
  3878.  
  3879.   PBitMapFileHeader = ^BitMapFileHeader;
  3880.   BitMapFileHeader = record
  3881.     usType:   Word;
  3882.     cbSize:   ULong;
  3883.     xHotspot: Integer;
  3884.     yHotspot: Integer;
  3885.     offBits:  ULong;
  3886.     bmp:      BitMapInfoHeader;
  3887.   end;
  3888.  
  3889.   PBitMapArrayFileHeader = ^BitMapArrayFileHeader;
  3890.   BitMapArrayFileHeader = record
  3891.     usType:    Word;
  3892.     cbSize:    ULong;
  3893.     offNext:   ULong;
  3894.     cxDisplay: Word;
  3895.     cyDisplay: Word;
  3896.     bfh:       BitMapFileHeader;
  3897.   end;
  3898.  
  3899.   PBitMapFileHeader2 = ^BitMapFileHeader2;
  3900.   BitMapFileHeader2 = record
  3901.     usType:   Word;
  3902.     cbSize:   ULong;
  3903.     xHotspot: Integer;
  3904.     yHotspot: Integer;
  3905.     offBits:  ULong;
  3906.     bmp2:     BitMapInfoHeader2;
  3907.   end;
  3908.  
  3909.   PBitMapArrayFileHeader2 = ^BitMapArrayFileHeader2;
  3910.   BitMapArrayFileHeader2 = record
  3911.     usType:    Word;
  3912.     cbSize:    ULong;
  3913.     offNext:   ULong;
  3914.     cxDisplay: Word;
  3915.     cyDisplay: Word;
  3916.     bfh2:      BitMapFileHeader2;
  3917.   end;
  3918.  
  3919. { These are the identifying values that go in the usType field of the }
  3920. { BitMapFileHeader(2) and BitMapArrayFileHeader(2).                   }
  3921. { (bft_ => Bit map File Type                                          }
  3922. const
  3923.   bft_Icon                      = $4349;   { 'IC' }
  3924.   bft_BMap                      = $4D42;   { 'BM' }
  3925.   bft_Pointer                   = $5450;   { 'PT' }
  3926.   bft_ColorIcon                 = $4943;   { 'CI' }
  3927.   bft_ColorPointer              = $5043;   { 'CP' }
  3928.   bft_BitMapArray               = $4142;   { 'BA' }
  3929.  
  3930.   { usage flags for GpiCreateBitmap }
  3931.   cbm_Init                      = $0004;
  3932.  
  3933.   { error return code for GpiSet/QueryBitmapBits }
  3934.   bmb_Error                             = -1;
  3935.  
  3936. { bitmap and pel functions }
  3937.  
  3938. function GpiCreateBitmap(PS: Hps; var bmpNew: BitMapInfoHeader2; Options: ULong;
  3939.   var InitData; var bmiInfoTable: BitMapInfo2): HBitMap;
  3940. function GpiSetBitmapBits(PS: Hps; ScanStart,Scans: Long; var Buffer;
  3941.   var bmiInfoTable: BitMapInfo2): Long;
  3942. function GpiSetBitmapDimension(BitMap: HBitMap; var sizlBitmapDimension: SizeL): Bool;
  3943. function GpiSetBitmapId(PS: Hps; BitMap: HBitMap; Lcid: Long): Bool;
  3944. function GpiQueryBitmapBits(PS: Hps; ScanStart,Scans: Long; var Buffer;
  3945.   var bmiInfoTable: BitMapInfo2): Long;
  3946. function GpiQueryBitmapDimension(BitMap: HBitMap; var sizlBitmapDimension: SizeL): Bool;
  3947. function GpiQueryBitmapHandle(PS: Hps; Lcid: Long): HBitMap;
  3948. function GpiQueryBitmapParameters(BitMap: HBitMap; var bmpData: BitMapInfoHeader): Bool;
  3949. function GpiQueryBitmapInfoHeader(BitMap: HBitMap; var bmpData: BitMapInfoHeader2): Bool;
  3950. function GpiQueryDeviceBitmapFormats(PS: Hps; Count: Long; var alArray: Long): Bool;
  3951. function GpiSetPel(PS: Hps; var ptlPoint: PointL): Long;
  3952. function GpiQueryPel(PS: Hps; var ptlPoint: PointL): Long;
  3953. function GpiFloodFill(PS: Hps; Options,Color: Long): Long;
  3954. function GpiDrawBits(PS: Hps; var Bits; bmiInfoTable: BitMapInfo2; Count: Long;
  3955.   var aptlPoints: PointL; Rop: Long; Options: ULong): Long;
  3956.  
  3957. { options for GpiCombineRegion }
  3958. const
  3959.   crgn_Or                       = 1;
  3960.   crgn_Copy                     = 2;
  3961.   crgn_Xor                      = 4;
  3962.   crgn_And                      = 6;
  3963.   crgn_Diff                     = 7;
  3964.  
  3965.   { usDirection of returned region data for GpiQueryRegionRects }
  3966.   rectdir_LfRt_TopBot           = 1;
  3967.   rectdir_RtLf_TopBot           = 2;
  3968.   rectdir_LfRt_BotTop           = 3;
  3969.   rectdir_RtLf_BotTop           = 4;
  3970.  
  3971. { control data for GpiQueryRegionRects }
  3972. type
  3973.   PRgnRect = ^RgnRect;
  3974.   RgnRect = record
  3975.     ircStart:    ULong;
  3976.     crc:         ULong;
  3977.     crcReturned: ULong;
  3978.     ulDirection: ULong;
  3979.   end;
  3980.  
  3981. { return code to indicate type of region for GpiCombineRegion and others }
  3982. const
  3983.   rgn_Error                     = 0;
  3984.   rgn_Null                      = 1;
  3985.   rgn_Rect                      = 2;
  3986.   rgn_Complex                   = 3;
  3987.  
  3988.   { return codes for GpiPtInRegion }
  3989.   prgn_Error                    = 0;
  3990.   prgn_Outside                  = 1;
  3991.   prgn_Inside                   = 2;
  3992.  
  3993.   { return codes for GpiRectInRegion }
  3994.   rrgn_Error                    = 0;
  3995.   rrgn_Outside                  = 1;
  3996.   rrgn_Partial                  = 2;
  3997.   rrgn_Inside                   = 3;
  3998.  
  3999.   { return codes for GpiEqualRegion }
  4000.   eqrgn_Error                   = 0;
  4001.   eqrgn_NotEqual                = 1;
  4002.   eqrgn_Equal                   = 2;
  4003.  
  4004.   { error return code for GpiSetRegion }
  4005.   hrgn_Error                    = HRgn(-1);
  4006.  
  4007.   { main region functions }
  4008. function GpiCombineRegion(PS: Hps; Dest,Src1,Src2: HRgn; Mode: Long): Long;
  4009. function GpiCreateRegion(PS: Hps; Count: Long; var arclRectangles: RectL): HRgn;
  4010. function GpiDestroyRegion(PS: Hps; Rgn: HRgn): Bool;
  4011. function GpiEqualRegion(PS: Hps; Src1,Src2: HRgn): Long;
  4012. function GpiOffsetRegion(PS: Hps; Rgn: HRgn; var ptlOffset: PointL): Bool;
  4013. function GpiPaintRegion(PS: Hps; Rgn: HRgn): Long;
  4014. function GpiFrameRegion(PS: Hps; Rgn: HRgn; var thickness: SizeL): Long;
  4015. function GpiPtInRegion(PS: Hps; Rgn: HRgn; var ptlPoint: PointL): Long;
  4016. function GpiQueryRegionBox(PS: Hps; Rgn: HRgn; var rclBound: RectL): Long;
  4017. function GpiQueryRegionRects(PS: Hps; Rgn: HRgn; var rclBound: RectL;
  4018.   var rgnrcControl: RgnRect; var rclRect: RectL): Bool;
  4019. function GpiRectInRegion(PS: Hps; Rgn: HRgn; var rclRect: RectL): Long;
  4020. function GpiSetRegion(PS: Hps; Rgn: HRgn; Count: Long; var arclRectangles: RectL): Bool;
  4021.  
  4022. { clip region functions }
  4023.  
  4024. function GpiSetClipRegion(PS: Hps; Rgn: HRgn; var RgnOld: HRgn): Long;
  4025. function GpiQueryClipRegion(PS: Hps): HRgn;
  4026. function GpiQueryClipBox(PS: Hps; var rclBound: RectL): Long;
  4027. function GpiExcludeClipRectangle(PS: Hps; var rclRectangle: RectL): Long;
  4028. function GpiIntersectClipRectangle(PS: Hps; var rclRectangle: RectL): Long;
  4029. function GpiOffsetClipRegion(PS: Hps; var ptlPoint: PointL): Long;
  4030.  
  4031. { constants for index values of options array for GpiPlayMetaFile }
  4032. const
  4033.   pmf_SegBase                   = 0;
  4034.   pmf_LoadType                  = 1;
  4035.   pmf_Resolve                   = 2;
  4036.   pmf_Lcids                     = 3;
  4037.   pmf_Reset                     = 4;
  4038.   pmf_Suppress                  = 5;
  4039.   pmf_ColorTables               = 6;
  4040.   pmf_ColorRealizable           = 7;
  4041.   pmf_Defaults                  = 8;
  4042.   pmf_DeleteObjects             = 9;
  4043.  
  4044.   { options for GpiPlayMetaFile }
  4045.   rs_Default                    = 0;
  4046.   rs_NoDiscard                  = 1;
  4047.   lc_Default                    = 0;
  4048.   lc_Noload                     = 1;
  4049.   lc_LoadDisc                   = 3;
  4050.   lt_Default                    = 0;
  4051.   lt_NoModify                   = 1;
  4052.   lt_OriginalView               = 4;
  4053.   res_Default                   = 0;
  4054.   res_NoReset                   = 1;
  4055.   res_Reset                     = 2;
  4056.   sup_Default                   = 0;
  4057.   sup_NoSuppress                = 1;
  4058.   sup_Suppress                  = 2;
  4059.   ctab_Default                  = 0;
  4060.   ctab_NoModify                 = 1;
  4061.   ctab_Replace                  = 3;
  4062.   ctab_ReplacePalette           = 4;
  4063.   crea_Default                  = 0;
  4064.   crea_Realize                  = 1;
  4065.   crea_NoRealize                = 2;
  4066.   crea_DoRealize                = 3;
  4067.  
  4068.   ddef_Default                  = 0;
  4069.   ddef_Ignore                   = 1;
  4070.   ddef_Loaddisc                 = 3;
  4071.   dobj_Default                  = 0;
  4072.   dobj_Nodelete                 = 1;
  4073.   dobj_Delete                   = 2;
  4074.   rsp_Default                   = 0;
  4075.   rsp_NoDiscard                 = 1;
  4076.  
  4077. { MetaFile functions }
  4078.  
  4079. function GpiCopyMetaFile(MF: Hmf): Hmf;
  4080. function GpiDeleteMetaFile(MF: Hmf): Bool;
  4081. function GpiLoadMetaFile(Ab: Hab; Filename: PChar): Hmf;
  4082. function GpiPlayMetaFile(PS: Hps; MF: Hmf; Count1: Long; var alOptarray,lSegCount: Long;
  4083.   Count2: Long; Desc: PChar): Long;
  4084. function GpiQueryMetaFileBits(MF: Hmf; Offset,Length: Long; var Data): Bool;
  4085. function GpiQueryMetaFileLength(MF: Hmf): Long;
  4086. function GpiSaveMetaFile(MF: Hmf; Filename: PChar): Bool;
  4087. function GpiSetMetaFileBits(MF: Hmf; Offset,Length: Long; var Buffer): Bool;
  4088.  
  4089. { default functions }
  4090.  
  4091. function GpiQueryDefArcParams(PS: Hps; var arcpArcParams: ArcParams): Bool;
  4092. function GpiQueryDefAttrs(PS: Hps; PrimType: Long; flAttrMask: ULong; bunAttr: PBundle): Bool;
  4093. function GpiQueryDefTag(PS: Hps; var Tag: Long): Bool;
  4094. function GpiQueryDefViewingLimits(PS: Hps; var rclLimits: RectL): Bool;
  4095. function GpiSetDefArcParams(PS: Hps; arcpArcParams: ArcParams): Bool;
  4096. function GpiSetDefAttrs(PS: Hps; PrimType: Long; AttrMask: ULong; bunAttrs: PBundle): Bool;
  4097. function GpiSetDefTag(PS: Hps; Tag: Long): Bool;
  4098. function GpiSetDefViewingLimits(PS: Hps; var rclLimits: RectL): Bool;
  4099.  
  4100. type
  4101.   PPolygon = ^Polygon;
  4102.   Polygon = record
  4103.     ulPoints: ULong;
  4104.     aPointl:  PPointL;
  4105.   end;
  4106.  
  4107.   PPolySet = ^PolySet;
  4108.   PolySet = record
  4109.     ulPolys:     ULong;
  4110.     aPolygon: array [0..0] of Polygon;
  4111.   end;
  4112.  
  4113. { control flags used by GpiPolygons }
  4114. const
  4115.   polygon_NoBoundary            = 0;
  4116.   polygon_Boundary              = $0001;
  4117.  
  4118.   polygon_Alternate             = 0;
  4119.   polygon_Winding               = $0002;
  4120.  
  4121.   polygon_Excl                  = 0;
  4122.   polygon_Incl                  = $0008;
  4123.  
  4124. { default function }
  4125.  
  4126. function GpiPolygons(PS: Hps; Count: ULong; var aplgn: Polygon; Options,Model: ULong): Long;
  4127.  
  4128. { General DEV return values }
  4129.  
  4130. const
  4131.   dev_Error                     = 0;
  4132.   dev_Ok                        = 1;
  4133.  
  4134. { DC type for DevOpenDC }
  4135.   od_Queued                     = 2;
  4136.   od_Direct                     = 5;
  4137.   od_Info                       = 6;
  4138.   od_Metafile                   = 7;
  4139.   od_Memory                     = 8;
  4140.   od_Metafile_NoQuery           = 9;
  4141.  
  4142. { Codes for DevQueryCaps }
  4143.   caps_Family                   = 0;
  4144.   caps_Io_Caps                  = 1;
  4145.   caps_Technology               = 2;
  4146.   caps_Driver_Version           = 3;
  4147.   caps_Width                    = 4;    { pels }
  4148.   caps_Height                   = 5;    { pels }
  4149.   caps_Width_In_Chars           = 6;
  4150.   caps_Height_In_Chars          = 7;
  4151.   caps_Horizontal_Resolution    = 8;    { pels per meter }
  4152.   caps_Vertical_Resolution      = 9;    { pels per meter }
  4153.   caps_Char_Width               = 10;   { pels }
  4154.   caps_Char_Height              = 11;   { pels }
  4155.   caps_Small_Char_Width         = 12;   { pels }
  4156.   caps_Small_Char_Height        = 13;   { pels }
  4157.   caps_Colors                   = 14;
  4158.   caps_Color_Planes             = 15;
  4159.   caps_Color_BitCount           = 16;
  4160.   caps_Color_Table_Support      = 17;
  4161.   caps_Mouse_Buttons            = 18;
  4162.   caps_Foreground_Mix_Support   = 19;
  4163.   caps_Background_Mix_Support   = 20;
  4164.   caps_Device_Windowing         = 31;
  4165.   caps_Additional_Graphics      = 32;
  4166.   caps_Vio_Loadable_Fonts       = 21;
  4167.   caps_Window_Byte_Alignment    = 22;
  4168.   caps_Bitmap_Formats           = 23;
  4169.   caps_Raster_Caps              = 24;
  4170.   caps_Marker_Height            = 25;   { pels }
  4171.   caps_Marker_Width             = 26;   { pels }
  4172.   caps_Device_Fonts             = 27;
  4173.   caps_Graphics_Subset          = 28;
  4174.   caps_Graphics_Version         = 29;
  4175.   caps_Graphics_Vector_Subset   = 30;
  4176.   caps_Phys_Colors              = 33;
  4177.   caps_Color_Index              = 34;
  4178.   caps_Graphics_Char_Width      = 35;
  4179.   caps_Graphics_Char_Height     = 36;
  4180.   caps_Horizontal_Font_Res      = 37;
  4181.   caps_Vertical_Font_Res        = 38;
  4182.   caps_Device_Font_Sim          = 39;
  4183.   caps_LineWidth_Thick          = 40;
  4184.   caps_Device_Polyset_Points    = 41;
  4185.  
  4186. { Constants for CAPS_IO_CAPS }
  4187.   caps_Io_Dummy                 = 1;
  4188.   caps_Io_Supports_Op           = 2;
  4189.   caps_Io_Supports_Ip           = 3;
  4190.   caps_Io_Supports_Io           = 4;
  4191.  
  4192. { Constants for caps_Technology }
  4193.   caps_Tech_Unknown             = 0;
  4194.   caps_Tech_Vector_Plotter      = 1;
  4195.   caps_Tech_Raster_Display      = 2;
  4196.   caps_Tech_Raster_Printer      = 3;
  4197.   caps_Tech_Raster_Camera       = 4;
  4198.   caps_Tech_PostScript          = 5;
  4199.  
  4200. { Constants for caps_Color_Table_Support }
  4201.   caps_Coltabl_Rgb_8            = 1;
  4202.   caps_Coltabl_Rgb_8_Plus       = 2;
  4203.   caps_Coltabl_True_Mix         = 4;
  4204.   caps_Coltabl_Realize          = 8;
  4205.  
  4206. { Constants for caps_Foreground_Mix_Support }
  4207.   caps_Fm_Or                    = 1;
  4208.   caps_Fm_Overpaint             = 2;
  4209.   caps_Fm_Xor                   = 8;
  4210.   caps_Fm_Leavealone            = 16;
  4211.   caps_Fm_And                   = 32;
  4212.   caps_Fm_General_Boolean       = 64;
  4213.  
  4214. { Constants for caps_Background_Mix_Support }
  4215.   caps_Bm_Or                    = 1;
  4216.   caps_Bm_OverPaint             = 2;
  4217.   caps_Bm_Xor                   = 8;
  4218.   caps_Bm_LeaveAlone            = 16;
  4219.   caps_Bm_And                   = 32;
  4220.   caps_Bm_General_Boolean       = 64;
  4221.   caps_Bm_SrcTransparent        = 128;
  4222.   caps_Bm_DestTransparent       = 256;
  4223.  
  4224. { Constants for caps_Device_Windowing }
  4225.   caps_Dev_Windowing_Support    = 1;
  4226.  
  4227. { Constants for caps_Dev_Font_Sim     }
  4228.   caps_Dev_Font_Sim_Bold        = 1;
  4229.   caps_Dev_Font_Sim_Italic      = 2;
  4230.   caps_Dev_Font_Sim_Underscore  = 4;
  4231.   caps_Dev_Font_Sim_Strikeout   = 8;
  4232.  
  4233. { Constants for caps_Additional_Graphics }
  4234.   caps_Vdd_Ddb_Transfer         = 1;
  4235.   caps_Graphics_Kerning_Support = 2;
  4236.   caps_Font_Outline_Default     = 4;
  4237.   caps_Font_Image_Default       = 8;
  4238. { bits represented by values 16 and 32 are reserved }
  4239.   caps_Scaled_Default_Markers   = 64;
  4240.   caps_Color_Cursor_Support     = 128;
  4241.   caps_Palette_Manager          = 256;
  4242.   caps_Cosmetic_WideLine_Support = 512;
  4243.   caps_Direct_Fill              = 1024;
  4244.   caps_Rebuild_Fills            = 2048;
  4245.   caps_Clip_Fills               = $00001000 { 4096  };
  4246.   caps_Enhanced_FontMetrics     = $00002000 { 8192  };
  4247.   caps_Transform_Support        = $00004000 { 16384 };
  4248.   caps_External_16_BitCount     = $00008000 { 32768 };
  4249.  
  4250. { Constants for caps_Window_Byte_Alignment }
  4251.   caps_Byte_Align_Required      = 0;
  4252.   caps_Byte_Align_Recommended   = 1;
  4253.   caps_Byte_Align_Not_Required  = 2;
  4254.  
  4255. { Constants for caps_Raster_Caps }
  4256.   caps_Raster_Bitblt            = 1;
  4257.   caps_Raster_Banding           = 2;
  4258.   caps_Raster_Bitblt_Scaling    = 4;
  4259.   caps_Raster_Set_Pel           = 16;
  4260.   caps_Raster_Fonts             = 32;
  4261.   caps_Raster_Flood_Fill        = 64;
  4262.  
  4263. function DevOpenDC(AB: HAB; lType: Long; Token: PChar; Count: Long;
  4264.   var dopData: PChar; dcComp: HDC): HDC;
  4265.  
  4266. function DevCloseDC(DC: HDC): HMF;
  4267.  
  4268. function DevQueryCaps(DC: HDC; Start,Count: Long; var lArray: Long): Bool;
  4269.  
  4270. { Records for devesc_QueryVioCellSizes }
  4271. type
  4272.   PVioSizeCount = ^VioSizeCount;
  4273.   VioSizeCount = record
  4274.     maxcount: Long;
  4275.     count:    Long;
  4276.   end;
  4277.  
  4278.   PVioFontCellSize = ^VioFontCellSize;
  4279.   VioFontCellSize = record
  4280.     cx: Long;
  4281.     cy: Long;
  4282.   end;
  4283.  
  4284. { Record for devesc_GetScalingFactor }
  4285.  
  4286.   PSFactors = ^SFactors;
  4287.   SFactors = record
  4288.     x: Long;
  4289.     y: Long;
  4290.   end;
  4291.  
  4292. { Record for devesc_NextBand }
  4293.  
  4294.   PBandRect = ^BandRect;
  4295.   BandRect = record
  4296.     xleft:   Long;
  4297.     ybottom: Long;
  4298.     xright:  Long;
  4299.     ytop:    Long;
  4300.   end;
  4301.  
  4302. { Return codes for DevEscape }
  4303. const
  4304.   devesc_Error                  = -1;
  4305.   devesc_NotImplemented         = 0;
  4306.  
  4307. { codes for DevEscape }
  4308.   devesc_QueryEscSupport        = 0;
  4309.   devesc_GetScalingFactor       = 1;
  4310.   devesc_QueryVioCellSizes      = 2;
  4311.   devesc_GetCp                  = 8000;
  4312.  
  4313.   devesc_StartDoc               = 8150;
  4314.   devesc_EndDoc                 = 8151;
  4315.   devesc_NextBand               = 8152;
  4316.   devesc_AbortDoc               = 8153;
  4317.  
  4318.   devesc_NewFrame               = 16300;
  4319.   devesc_DraftMode              = 16301;
  4320.   devesc_FlushOutput            = 16302;
  4321.   devesc_RawData                = 16303;
  4322.   devesc_SetMode                = 16304;
  4323.  
  4324.   devesc_Dbe_First              = 24450;
  4325.   devesc_Dbe_Last               = 24455;
  4326.  
  4327. { DevEscape codes for adding extra space to character strings }
  4328.   devesc_Char_Extra             = 16998;
  4329.   devesc_Break_Extra            = 16999;
  4330.  
  4331. { Codes for DevEscape PM_Q_ESC spool files }
  4332.   devesc_Std_Journal            = 32600;
  4333.  
  4334. { Record for devesc_SetMode }
  4335. type
  4336.   PEscMode = ^EscMode;
  4337.   EscMode = record
  4338.     mode:     ULong;
  4339.     modedata: array[0..0] of Byte;
  4340.   end;
  4341.  
  4342. { Return codes for DevPostDeviceModes }
  4343. const
  4344.   dpdm_Error                    = -1;
  4345.   dpdm_None                     = 0;
  4346.  
  4347. { Codes for DevPostDeviceModes }
  4348.   dpdm_PostJobProp              = 0;
  4349.   dpdm_ChangeProp               = 1;
  4350.   dpdm_QueryJobProp             = 2;
  4351.  
  4352. { String types for DevQueryDeviceNames }
  4353. type
  4354.   Str16 = array [0..15] of Char;
  4355.   Str32 = array [0..31] of Char;
  4356.   Str64 = array [0..63] of Char;
  4357.   PStr16 = ^Str16;
  4358.   PStr32 = ^Str32;
  4359.   PStr64 = ^Str64;
  4360.  
  4361. { Return code for DevQueryHardcopyCaps }
  4362. const
  4363.   dqhc_Error                    = -1;
  4364.  
  4365. { codes for DevQueryHardcopyCaps }
  4366.   hcaps_Current                 = 1;
  4367.   hcaps_Selectable              = 2;
  4368.  
  4369. { Record for DevQueryHardcopyCaps }
  4370. type
  4371.   PHcInfo = ^HcInfo;
  4372.   HcInfo = record
  4373.     szFormname: array [0..31] of Char;
  4374.     cx:             Long;
  4375.     cy:             Long;
  4376.     xLeftClip:      Long;
  4377.     yBottomClip:    Long;
  4378.     xRightClip:     Long;
  4379.     yTopClip:       Long;
  4380.     xPels:          Long;
  4381.     yPels:          Long;
  4382.     flAttributes:   Long;
  4383.   end;
  4384.  
  4385. { Device Context Functions }
  4386.  
  4387. function DevEscape(DC: HDC; Code,InCount: Long; var InData; var OutCount: Long;
  4388.   OutData: Pointer): Long;
  4389. function DevQueryDeviceNames(AB: HAB; DriverName: PChar; var dn: Long;
  4390.   DeviceName: PStr32; DeviceDesc: PStr64; var dt: Long; DataType: PStr16): Bool;
  4391. function DevQueryHardcopyCaps(DC: HDC; StartForm,Forms: Long; var HcInf: HcInfo): Long;
  4392. function DevPostDeviceModes(AB: HAB; DriverData: PDrivData; DriverName,
  4393.   DeviceName,Name: PChar; Options: ULong): Long;
  4394.  
  4395. {----[ PMHELP ]----}
  4396.  
  4397. { HelpSubTable entry structure }
  4398. type
  4399.   PHelpSubTable = ^HelpSubTable;
  4400.   HelpSubTable = Word;
  4401.  
  4402. { HelpTable entry structure }
  4403. type
  4404.   PHelpTable = ^HelpTable;
  4405.   HelpTable = record
  4406.     idAppWindow:      Word;
  4407.     phstHelpSubTable: PHelpSubTable;
  4408.     idExtPanel:       Word;
  4409.   end;
  4410.  
  4411. { IPF Initialization record used on the WinCreateHelpInstance call }
  4412.  
  4413.   PHelpInit = ^HelpInit;
  4414.   HelpInit = record
  4415.     cb:                       ULong;
  4416.     ulReturnCode:             ULong;
  4417.     pszTutorialName:          PChar;
  4418.     phtHelpTable:             PHelpTable;
  4419.     hmodHelpTableModule:      HModule;
  4420.     hmodAccelActionBarModule: HModule;
  4421.     idAccelTable:             ULong;
  4422.     idActionBar:              ULong;
  4423.     PCharHelpWindowTitle:     PChar;
  4424.     fShowPanelId:             ULong;
  4425.     PCharHelpLibraryName:     PChar;
  4426.   end;
  4427.  
  4428. { Search parent chain indicator for hm_Set_Active_Window message }
  4429. const
  4430.   hwnd_Parent                   = HWnd(0);
  4431.  
  4432. { Constants used to define whether user wants to display panel using }
  4433. { panel number or panel name                                         }
  4434.   hm_ResourceId                 = 0;
  4435.   hm_PanelName                  = 1;
  4436.  
  4437.   hmPanelType_Number            = 0;
  4438.   hmPanelType_Name              = 1;
  4439.  
  4440. { Constants used to define how the panel IDs are displayed on }
  4441. { help panels                                                 }
  4442.   cmic_Hide_Panel_Id            = $0000;
  4443.   cmic_Show_Panel_Id            = $0001;
  4444.   cmic_Toggle_Panel_Id          = $0002;
  4445.  
  4446. { Window Help API declarations }
  4447.  
  4448. function WinDestroyHelpInstance(HelpInstance: HWnd): Bool;
  4449. function WinCreateHelpInstance(AB: Hab; var InitHMInitRec: HelpInit): HWnd;
  4450. function WinAssociateHelpInstance(HelpInstance,App: HWnd): Bool;
  4451. function WinQueryHelpInstance(App: HWnd): HWnd;
  4452. function WinLoadHelpTable(HelpInstance: HWnd; IdHelpTable: ULong;
  4453.   Module: HModule): Bool;
  4454. function WinCreateHelpTable(HelpInstance: HWnd; var HelpTbl: HelpTable): Bool;
  4455.  
  4456. { IPF message base }
  4457. const
  4458.   hm_Msg_base                   = $0220;
  4459.   { Messages applications can send to the IPF }
  4460.   hm_Dismiss_Window             = hm_Msg_Base + $0001;
  4461.   hm_Display_Help               = hm_Msg_Base + $0002;
  4462.   hm_Ext_Help                   = hm_Msg_Base + $0003;
  4463.   hm_General_Help               = hm_Ext_Help;
  4464.   hm_Set_Active_Window          = hm_Msg_Base + $0004;
  4465.   hm_Load_Help_Table            = hm_Msg_Base + $0005;
  4466.   hm_Create_Help_Table          = hm_Msg_Base + $0006;
  4467.   hm_Set_Help_Window_Title      = hm_Msg_Base + $0007;
  4468.   hm_Set_Show_Panel_Id          = hm_Msg_Base + $0008;
  4469.   hm_Replace_Help_For_Help      = hm_Msg_Base + $0009;
  4470.   hm_Replace_Using_Help         = hm_Replace_Help_For_Help;
  4471.   hm_Help_Index                 = hm_Msg_Base + $000A;
  4472.   hm_Help_Contents              = hm_Msg_Base + $000B;
  4473.   hm_Keys_Help                  = hm_Msg_Base + $000C;
  4474.   hm_Set_Help_Library_Name      = hm_Msg_Base + $000D;
  4475.  
  4476.   hm_Set_ObjCom_Window          = hm_Msg_Base + $0018;
  4477.   hm_Update_ObjCom_Window_Chain = hm_Msg_Base + $0019;
  4478.   hm_Query_Ddf_Data             = hm_Msg_Base + $001A;
  4479.   hm_Invalidate_Ddf_Data        = hm_Msg_Base + $001B;
  4480.   hm_Query                      = hm_Msg_Base + $001C;
  4481.   hm_Set_CoverPage_Size         = hm_Msg_Base + $001D;
  4482.  
  4483. { Constants used to query the info from IPF in hm_Query message }
  4484. { Hi word in lParam 1 }
  4485.   hmqw_CoverPage                = $0001;
  4486.   hmqw_Index                    = $0002;
  4487.   hmqw_Toc                      = $0003;
  4488.   hmqw_Search                   = $0004;
  4489.   hmqw_ViewPages                = $0005;
  4490.   hmqw_Library                  = $0006;
  4491.   hmqw_ViewPort                 = $0007;
  4492.   hmqw_ObjCom_Window            = $0008;
  4493.   hmqw_Instance                 = $0009;
  4494.   hmqw_ActiveViewPort           = $000A;
  4495.   Control_Selected              = $000B;
  4496.  
  4497.   hmqw_Group_ViewPort           = $00F1;
  4498.   hmqw_Res_ViewPort             = $00F2;
  4499.   UserData                      = $00F3;
  4500.  
  4501. { Lo word in lParam1 of hmqw_ViewPort }
  4502.   hmqvp_Number                  = $0001;
  4503.   hmqvp_Name                    = $0002;
  4504.   hmqvp_Group                   = $0003;
  4505.  
  4506. { Predefined Control IDs }
  4507.   ctrl_Previous_Id              = $0001;
  4508.   ctrl_Search_Id                = $0002;
  4509.   ctrl_Print_Id                 = $0003;
  4510.   ctrl_Index_Id                 = $0004;
  4511.   ctrl_Contents_Id              = $0005;
  4512.   ctrl_Back_Id                  = $0006;
  4513.   ctrl_Forward_Id               = $0007;
  4514.   ctrl_Tutorial_Id              = $00FF;
  4515.  
  4516.   ctrl_User_Id_Base             = 257;
  4517.  
  4518. { Messages the IPF sends to the applications active window }
  4519. { as defined by the IPF.                                   }
  4520.   hm_Error                      = hm_Msg_Base + $000E;
  4521.   hm_HelpSubitem_Not_Found      = hm_Msg_Base + $000F;
  4522.   hm_Query_Keys_Help            = hm_Msg_Base + $0010;
  4523.   hm_Tutorial                   = hm_Msg_Base + $0011;
  4524.   hm_Ext_Help_Undefined         = hm_Msg_Base + $0012;
  4525.   hm_General_Help_Undefined     = hm_Ext_Help_Undefined;
  4526.   hm_ActionBar_Command          = hm_Msg_Base + $0013;
  4527.   hm_Inform                     = hm_Msg_Base + $0014;
  4528.   hm_Notify                     = hm_Msg_Base + $0022;
  4529.   hm_Set_UserData               = hm_Msg_Base + $0023;
  4530.   hm_Control                    = hm_Msg_Base + $0024;
  4531.  
  4532. { notify information for hm_Notify }
  4533.   open_CoverPage                = $0001;
  4534.   open_Page                     = $0002;
  4535.   swap_Page                     = $0003;
  4536.   open_Toc                      = $0004;
  4537.   open_Index                    = $0005;
  4538.   open_History                  = $0006;
  4539.   open_Search_Hit_List          = $0007;
  4540.   open_Library                  = $0008;
  4541.  
  4542. {  hmerr_No_Frame_Wnd_In_Chain - There is no frame window in the        }
  4543. {  window chain from which to find or set the associated help instance  }
  4544.   hmerr_No_Frame_Wnd_In_Chain   = $00001001;
  4545.  
  4546. { hmerr_Invalid_Assoc_App_Wnd - The application window handle specified }
  4547. { on the WinAssociateHelpInstance call is not a valid window handle     }
  4548.   hmerr_Invalid_Assoc_App_Wnd   = $00001002;
  4549.  
  4550. { hmerr_Invalid_Assoc_Help_Inst - The help instance handle specified on }
  4551. { the WinAssociateHelpInstance call is not a valid window handle        }
  4552.   hmerr_Invalid_Assoc_Help_Inst = $00001003;
  4553.  
  4554. { hmerr_Invalid_Destroy_Help_Inst - The window handle specified as the  }
  4555. { help instance to destroy is not of the help instance class            }
  4556.   hmerr_Invalid_Destroy_Help_Inst = $00001004;
  4557.  
  4558. { hmerr_No_Help_Inst_In_chain - The parent or owner chain of the        }
  4559. { application window specified does not have a help instance associated }
  4560. { with it }
  4561.   hmerr_No_Help_Inst_In_chain   = $00001005;
  4562.  
  4563. { hmerr_Invalid_Help_Instance_Hdl - The handle specified to be a help   }
  4564. { instance does not have the class name of a IPF help instance          }
  4565.   hmerr_Invalid_Help_Instance_Hdl = $00001006;
  4566.  
  4567. { hmerr_Invalid_Query_App_Wnd - The application window specified on     }
  4568. { a WinQueryHelpInstance call is not a valid window handle              }
  4569.   hmerr_Invalid_Query_App_Wnd   = $00001007;
  4570.  
  4571. { hmerr_Help_Inst_Called_Invalid - The handle of the help instance      }
  4572. { specified on an API call to the IPF does not have the class name of   }
  4573. { an IPF help instance }
  4574.   hmerr_Help_Inst_Called_Invalid = $00001008;
  4575.  
  4576.   hmerr_HelpTable_Undefine      = $00001009;
  4577.   hmerr_Help_Instance_Undefine  = $0000100A;
  4578.   hmerr_Helpitem_Not_Found      = $0000100B;
  4579.   hmerr_Invalid_HelpSubitem_Size = $0000100C;
  4580.   hmerr_HelpSubitem_Not_Found   = $0000100D;
  4581.  
  4582. { hmerr_Index_Not_Found - No index in library file }
  4583.   hmerr_Index_Not_Found         = $00002001;
  4584.  
  4585. { hmerr_Content_Not_Found - Library file does not have any contents }
  4586.   hmerr_Content_Not_Found       = $00002002;
  4587.  
  4588. { hmerr_Open_Lib_File - Cannot open library file }
  4589.   hmerr_Open_Lib_File           = $00002003;
  4590.  
  4591. { hmerr_Read_Lib_File - Cannot read library file }
  4592.   hmerr_Read_Lib_File           = $00002004;
  4593.  
  4594. { hmerr_Close_Lib_File - Cannot close library file }
  4595.   hmerr_Close_Lib_File          = $00002005;
  4596.  
  4597. { hmerr_Invalid_Lib_File - Improper library file provided }
  4598.   hmerr_Invalid_Lib_File        = $00002006;
  4599.  
  4600. {  hmerr_No_Memory - Unable to allocate the requested amount of memory }
  4601.   hmerr_No_Memory               = $00002007;
  4602.  
  4603. { hmerr_Allocate_Segment - Unable to allocate a segment of memory for memory }
  4604. { allocation requested from the IPF                                          }
  4605.   hmerr_Allocate_Segment        = $00002008;
  4606.  
  4607. { hmerr_Free_Memory - Unable to free allocated  memory }
  4608.   hmerr_FREE_MEMORY             = $00002009;
  4609.  
  4610. { hmerr_Panel_Not_Found - Unable to find a help panel requested to }
  4611. { help manager }
  4612.   hmerr_Panel_Not_Found         = $00002010;
  4613.  
  4614. { hmerr_Database_Not_Open - Unable to read the unopened database }
  4615.   hmerr_Database_Not_Open       = $00002011;
  4616.  
  4617. { hmerr_Load_Dll - Unable to load resource dll }
  4618.   hmerr_Load_Dll                = $00002013;
  4619.  
  4620. { AC Viewport stucture definitions }
  4621. type
  4622.   PAcVp = ^AcVp;
  4623.   AcVp = record
  4624.     cb:         ULong;
  4625.     hAB:        Hab;
  4626.     hmq:        Hmq;
  4627.     ObjectID:   ULong;          { object identifier }
  4628.     HWndParent: HWnd;           { IPF viewport client handle }
  4629.     HWndOwner:  HWnd;           { IPF viewport client handle }
  4630.     HWndACVP:   HWnd;           { applications frame window HWnd }
  4631.   end;
  4632.  
  4633. { DDF types and constants }
  4634.   Hddf = Pointer;
  4635.  
  4636. { DdfHyperText Flags }
  4637. const
  4638.   reference_By_Id               = 0;
  4639.   reference_By_Res              = 1;
  4640.  
  4641. { DdfBeginList formatting flags }
  4642.   hmbt_None                     = 1;
  4643.   hmbt_All                      = 2;
  4644.   hmbt_Fit                      = 3;
  4645.  
  4646.   hmls_SingleLine               = 1;
  4647.   hmls_DoubleLine               = 2;
  4648.  
  4649. { DdfBitmap alignment flags }
  4650.   art_RunIn                     = $10;
  4651.   art_Left                      = $01;
  4652.   art_Right                     = $02;
  4653.   art_Center                    = $04;
  4654.  
  4655. { DdfSetColor Color Flag }
  4656.   clr_Unchanged                 = -6;
  4657.  
  4658. { DDF API declarations }
  4659.  
  4660. function DdfInitialize(HelpInstance: HWnd; cbBuffer,Increment: ULong): Hddf;
  4661. function DdfPara(Ddf: Hddf): Bool;
  4662. function DdfSetFormat(Ddf: Hddf; FormatType: ULong): Bool;
  4663. function DdfSetTextAlign(Ddf: Hddf; Align: ULong): Bool;
  4664. function DdfSetColor(Ddf: Hddf; BackColor,ForColor: Color): Bool;
  4665. function DdfInform(Ddf: Hddf; Text: PChar; InformNumber: ULong): Bool;
  4666. function DdfSetFontStyle(Ddf: Hddf; FontStyle: ULong): Bool;
  4667. function DdfHyperText(Ddf: Hddf; Text,Reference: PChar; RefType: ULong): Bool;
  4668. function DdfBeginList(Ddf: Hddf; WidthDT,BreakType,Spacing: ULong): Bool;
  4669. function DdfListItem(Ddf: Hddf; Term,Description: PChar): Bool;
  4670. function DdfEndList(Ddf: Hddf): Bool;
  4671. function DdfMetafile(Ddf: Hddf; mf: Hmf; R: PRectL): Bool;
  4672. function DdfText(Ddf: Hddf; Text: PChar): Bool;
  4673. function DdfSetFont(Ddf: Hddf; FaceName: PChar; Width,Height: ULong): Bool;
  4674. function DdfBitmap(Ddf: Hddf; Hbm: HBitMap; Align: ULong): Bool;
  4675.  
  4676. { Error codes returned by DDF API functions }
  4677. const
  4678.   hmerr_Ddf_Memory              = $3001;
  4679.   hmerr_Ddf_Align_Type          = $3002;
  4680.   hmerr_Ddf_BackColor           = $3003;
  4681.   hmerr_Ddf_ForeColor           = $3004;
  4682.   hmerr_Ddf_FontStyle           = $3005;
  4683.   hmerr_Ddf_RefType             = $3006;
  4684.   hmerr_Ddf_List_Unclosed       = $3007;
  4685.   hmerr_Ddf_List_Uninitialized  = $3008;
  4686.   hmerr_Ddf_List_BreakType      = $3009;
  4687.   hmerr_Ddf_List_Spacing        = $300A;
  4688.   hmerr_Ddf_HInstance           = $300B;
  4689.   hmerr_Ddf_Exceed_Max_Length   = $300C;
  4690.   hmerr_Ddf_Exceed_Max_Inc      = $300D;
  4691.   hmerr_Ddf_Invalid_Ddf         = $300E;
  4692.   hmerr_Ddf_Format_Type         = $300F;
  4693.   hmerr_Ddf_Invalid_Parm        = $3010;
  4694.   hmerr_Ddf_Invalid_Font        = $3011;
  4695.   hmerr_Ddf_Severe              = $3012;
  4696.  
  4697. { From HMTAILOR.H }
  4698. { OS/2 Help window menu identifiers }
  4699.  
  4700.   idm_ChildVpSysMenu            = 810;
  4701.  
  4702.   idm_File                      = $7F00;
  4703.   idm_Search                    = $7F01;
  4704.   idm_Print                     = $7F02;
  4705.   idm_Viewport                  = $7F05;
  4706.  
  4707.   idm_Edit                      = $7F10;
  4708.   idm_Clip_Copy                 = $7F11;
  4709.   idm_Clip_Cf                   = $7F12;
  4710.   idm_Clip_Af                   = $7F13;
  4711.   idm_Libraries                 = $7F14;
  4712.  
  4713.   idm_Options                   = $7F20;
  4714.   idm_Viewpages                 = $7F21;
  4715.   idm_Toc                       = $7F23;
  4716.   idm_Option_ExpLevel           = $7F24;
  4717.   idm_Option_ExpBranch          = $7F25;
  4718.   idm_Option_ExpAll             = $7F26;
  4719.   idm_Option_ColBranch          = $7F27;
  4720.   idm_Option_ColAll             = $7F28;
  4721.   idm_Previous                  = $7F29;
  4722.  
  4723.   idm_Help                      = $7F30;
  4724.   idm_HelpHelp                  = $7F31;
  4725.   idm_Help_Extended             = $7F32;
  4726.   idm_Using_Help                = idm_HelpHelp;
  4727.   idm_General_Help              = idm_Help_Extended;
  4728.   idm_Help_Keys                 = $7F33;
  4729.   idm_Help_Index                = $7F34;
  4730.  
  4731.   idm_Tutorial                  = $7F37;
  4732.  
  4733. {----[ PMSHL ]----}
  4734.  
  4735. const
  4736.   { Maximum title length }
  4737.   MaxNameL                      = 60;
  4738.  
  4739. { program handle }
  4740. type
  4741.    PHProgram = ^HProgram;
  4742.    HProgram  = LHandle;
  4743.    HApp      = LHandle;
  4744.    { ini file handle }
  4745.    PHIni     = ^HIni;
  4746.    HIni      = LHandle;
  4747.  
  4748. const
  4749.   HIni_Profile                  = HIni( 0);
  4750.   HIni_UserProfile              = HIni(-1);
  4751.   HIni_SystemProfile            = HIni(-2);
  4752.   HIni_User                     = HIni_UserProfile;
  4753.   HIni_System                   = HIni_SystemProfile;
  4754.  
  4755. type
  4756.   PPrfProfile = ^PrfProfile;
  4757.   PrfProfile = record
  4758.     cchUserName: ULong;
  4759.     pszUserName: PChar;
  4760.     cchSysName:  ULong;
  4761.     pszSysName:  PChar;
  4762.   end;
  4763.  
  4764. { program list section }
  4765. { maximum path length  }
  4766. const
  4767.   MaxPathL                      = 128;
  4768.  
  4769. { root group handle }
  4770.   sgh_Root                      = HProgram(-1);
  4771.  
  4772. type
  4773.   PHProgArray   = ^HProgArray;
  4774.   HProgArray    = HProgram;
  4775.   PProgCategory = ^ProgCategory;
  4776.   ProgCategory  = ULong;
  4777.  
  4778. { values acceptable for ProgCategory for PM groups }
  4779. const
  4780.   prog_Default                  = ProgCategory(0);
  4781.   prog_FullScreen               = ProgCategory(1);
  4782.   prog_WindowableVio            = ProgCategory(2);
  4783.   prog_Pm                       = ProgCategory(3);
  4784.   prog_Group                    = ProgCategory(5);
  4785.   prog_Real                     = ProgCategory(4);
  4786.   prog_Vdm                      = ProgCategory(4);
  4787.   prog_WindowedVdm              = ProgCategory(7);
  4788.   prog_Dll                      = ProgCategory(6);
  4789.   prog_Pdd                      = ProgCategory(8);
  4790.   prog_Vdd                      = ProgCategory(9);
  4791.   prog_Window_Real              = ProgCategory(10);
  4792.   prog_Window_Prot              = ProgCategory(11);
  4793.   prog_Window_Auto              = ProgCategory(12);
  4794.   prog_SeamlessVdm              = ProgCategory(13);
  4795.   prog_SeamlessCommon           = ProgCategory(14);
  4796.   prog_Reserved                 = ProgCategory(255);
  4797.  
  4798. type
  4799.   PProgType = ^ProgType;
  4800.   ProgType = record
  4801.     progc:     ProgCategory;
  4802.     fbVisible: ULong;
  4803.   end;
  4804.  
  4805. { visibility flag for ProgType record }
  4806. const
  4807.   she_Visible                   = $00;
  4808.   she_Invisible                 = $01;
  4809.   she_Reserved                  = $FF;
  4810.  
  4811. { Protected group flag for ProgType record }
  4812.   she_Unprotected               = $00;
  4813.   she_Protected                 = $02;
  4814.  
  4815. { Records associated with 'Prf' calls }
  4816. type
  4817.   PProgDetails = ^ProgDetails;
  4818.   ProgDetails = record
  4819.     Length:         ULong;      { set this to SizeOf(ProgDetails)  }
  4820.     progt:          ProgType;
  4821.     pszTitle:       PChar;      { any of the pointers can be Nil   }
  4822.     pszExecutable:  PChar;
  4823.     pszParameters:  PChar;
  4824.     pszStartupDir:  PChar;
  4825.     pszIcon:        PChar;
  4826.     pszEnvironment: PChar;      { this is terminated by  #0#0      }
  4827.     swpInitial:     Swp;        { this replaces XYWINSIZE          }
  4828.   end;
  4829.  
  4830.   PProgTitle = ^ProgTitle;
  4831.   ProgTitle = record
  4832.     hprog:    HProgram;
  4833.     progt:    ProgType;
  4834.     pszTitle: PChar;
  4835.   end;
  4836.  
  4837. { Program List API Function Definitions }
  4838. { Program List API available 'Prf' calls }
  4839.  
  4840. function PrfQueryProgramTitles(Ini: HIni; PrgGroup: HProgram;
  4841.   Titles: PProgTitle; cchBufferMax: ULong; var Count: ULong): ULong;
  4842.  
  4843. {  NOTE: string information is concatanated after the array of      }
  4844. {        ProgTitle structures so you need to allocate storage       }
  4845. {        greater than SizeOf(ProgTitle)*cPrograms to query programs }
  4846. {        in a group.                                                }
  4847. {                                                                   }
  4848. {  PrfQueryProgramTitles recommended usage to obtain titles of all  }
  4849. {  programs in a group (Hgroup=sgh_Root is for all groups):         }
  4850. {                                                                   }
  4851. {  BufLen := PrfQueryProgramTitles(HIni, Hgroup, nil, 0 Count);     }
  4852. {                                                                   }
  4853. {  Alocate buffer of  Buflen                                        }
  4854. {                                                                   }
  4855. {  Len = PrfQueryProgramTitles(HIni, Hgroup, PProgTitle(pBuffer),   }
  4856. {                               BufLen, Count);                     }
  4857. {                                                                   }
  4858.  
  4859. function PrfAddProgram(Ini: HIni; pDetails: PProgDetails;
  4860.   ProgGroup: HProgram): HProgram;
  4861. function PrfChangeProgram(Ini: HIni; Prog: HProgram;
  4862.   Details: PProgDetails): Bool;
  4863. function PrfQueryDefinition(Ini: HIni; Prog: HProgram; Details: PProgDetails;
  4864.   cchBufferMax: ULong): ULong;
  4865.  
  4866. {  NOTE: string information is concatanated after the ProgDetails   }
  4867. {        field structure so you need to allocate storage greater    }
  4868. {        than SizeOf(ProgDetails) to query programs                 }
  4869. {                                                                   }
  4870. {  PrfQueryDefinition recomended usage:                             }
  4871. {                                                                   }
  4872. {  BufferLen := PrfQueryDefinition(HIni,Hprog,nil,0)                }
  4873. {                                                                   }
  4874. {  Alocate buffer of bufferlen bytes                                }
  4875. {  set Length field (0 will be supported)                           }
  4876. {                                                                   }
  4877. {  PProgDetails(pBuffer)^.Length := SizeOf(PProgDetails)            }
  4878. {                                                                   }
  4879. {  Len := PrfQueryDefinition(HIni, Hprog, PProgDetails(pBuffer),    }
  4880. {      bufferlen)                                                   }
  4881.  
  4882. function PrfRemoveProgram(Ini: HIni; Prog: HProgram): Bool;
  4883. function PrfQueryProgramHandle(Ini: HIni; pszExe: PChar;
  4884.   ProgArray: PHProgArray; cchBufferMax: ULong; var Count: ULong): ULong;
  4885. function PrfCreateGroup(Ini: HIni; Title: PChar; Visibility: Byte): HProgram;
  4886. function PrfDestroyGroup(Ini: HIni; ProgGroup: HProgram): Bool;
  4887. function PrfQueryProgramCategory(Ini: HIni; Exe: PChar): ProgCategory;
  4888. function WinStartApp(Notify: HWnd; Details: PProgDetails; Params: PChar;
  4889.   Reserved: Pointer; Options: ULong): HApp;
  4890.  
  4891. { bit values for Options parameter }
  4892. const
  4893.   saf_ValidFlags                = $001F;
  4894.   saf_InstalledCmdLine          = $0001;    { use installed parameters }
  4895.   saf_StartChildApp             = $0002;    { related application }
  4896.   saf_Maximized                 = $0004;    { Start App maximized }
  4897.   saf_Minimized                 = $0008;    { Start App minimized, if not saf_Maximized }
  4898.   saf_Background                = $0010;    { Start app in the background }
  4899.  
  4900. function WinTerminateApp(App: HApp): Bool;
  4901.  
  4902. { switch list section }
  4903.  
  4904. type
  4905.   PHSwitch = ^LHandle;
  4906.   HSwitch = LHandle;
  4907.  
  4908.   PSwCntrl = ^SwCntrl;
  4909.   SwCntrl = record
  4910.     hwnd:                  HWnd;
  4911.     hwndIcon:              HWnd;
  4912.     hprog:                 HProgram;
  4913.     idProcess:             Pid;
  4914.     idSession:             ULong;
  4915.     uchVisibility:         ULong;
  4916.     fbJump:                ULong;
  4917.     szSwtitle: array [0..MaxNameL+3] of Char;
  4918.     bProgType:             ULong;
  4919.   end;
  4920.  
  4921. { visibility flag for SwCntrl record }
  4922. const
  4923.   swl_Visible                   = $04;
  4924.   swl_Invisible                 = $01;
  4925.   swl_Grayed                    = $02;
  4926.  
  4927. { jump flag for SwCntrl record }
  4928.   swl_Jumpable                  = $02;
  4929.   swl_NotJumpable               = $01;
  4930.  
  4931. { Switching Program functions }
  4932.  
  4933. function WinAddSwitchEntry(Sw: PSwCntrl): HSwitch;
  4934. function WinRemoveSwitchEntry(Sw: HSwitch): ULong;
  4935.  
  4936. type
  4937.   PSwEntry = ^SwEntry;
  4938.   SwEntry = record
  4939.     HSwitch: HSwitch;
  4940.     swctl:   SwCntrl;
  4941.   end;
  4942.  
  4943.   PSwbLock = ^SwbLock;
  4944.   SwbLock = record
  4945.     cswentry: ULong;
  4946.     aswentry: SwEntry;
  4947.   end;
  4948.  
  4949. function WinChangeSwitchEntry(Switch: HSwitch; pswctlSwitchData: PSwCntrl): ULong;
  4950. function WinCreateSwitchEntry(AB: Hab; pswctlSwitchData: PSwCntrl): HSwitch;
  4951. function WinQuerySessionTitle(AB: Hab; Session: ULong; Title: PChar;
  4952.   Titlelen: ULong): ULong;
  4953. function WinQuerySwitchEntry(Switch: HSwitch; pswctlSwitchData: PSwCntrl): ULong;
  4954. function WinQuerySwitchHandle(Wnd: HWnd; Process: Pid): HSwitch;
  4955. function WinQuerySwitchList(AB: Hab; pswblkSwitchEntries: PSwbLock;
  4956.   DataLength: ULong): ULong;
  4957. function WinQueryTaskSizePos(AB: Hab; ScreenGroup: ULong; PositionData: PSwp): ULong;
  4958. function WinQueryTaskTitle(Session: ULong; Title: PChar; Titlelen: ULong): ULong;
  4959. function WinSwitchToProgram(HSwitchSwHandle: HSwitch): ULong;
  4960.  
  4961. { OS2.INI Access functions }
  4962.  
  4963. function PrfQueryProfileInt(Ini: HIni; App,Key: PChar; Default: Long): Long;
  4964. function PrfQueryProfileString(Ini: HIni; App,Key,Default: PChar;
  4965.   Buffer: Pointer; cchBufferMax: ULong): ULong;
  4966. function PrfWriteProfileString(Ini: HIni; App,Key,Data: PChar): Bool;
  4967. function PrfQueryProfileSize(Ini: HIni; App,Key: PChar; var ReqLen: ULong): Bool;
  4968. function PrfQueryProfileData(Ini: HIni; App,Key: PChar; Buffer: Pointer;
  4969.   var BufLen: ULong): Bool;
  4970. function PrfWriteProfileData(Ini: HIni; App,Key: PChar; Data: Pointer;
  4971.   DataLen: ULong): Bool;
  4972. function PrfOpenProfile(AB: Hab; FileName: PChar): HIni;
  4973. function PrfCloseProfile(Ini: HIni): Bool;
  4974. function PrfReset(AB: Hab; Prf: PPrfProfile): Bool;
  4975. function PrfQueryProfile(AB: Hab; Prf: PPrfProfile): Bool;
  4976.  
  4977. { public message, broadcast on WinReset }
  4978. const
  4979.   pl_Altered                    = $008E; { wm_ShellFirst + $0E }
  4980.  
  4981. {----[ PMTYPES ]----}
  4982.  
  4983. const
  4984.   dtyp_User                     = 16384;
  4985.   dtyp_Ctl_Array                = 1;
  4986.   dtyp_Ctl_PArray               = -1;
  4987.   dtyp_Ctl_offset               = 2;
  4988.   dtyp_Ctl_length               = 3;
  4989. { Ordinary datatypes }
  4990.   dtyp_Accel                    = 28;
  4991.   dtyp_AccelTable               = 29;
  4992.   dtyp_ArcParams                = 38;
  4993.   dtyp_AreaBundle               = 139;
  4994.   dtyp_Atom                     = 90;
  4995.   dtyp_BitMapInfo               = 60;
  4996.   dtyp_BitMapInfoHeader         = 61;
  4997.   dtyp_BitMapInfo2              = 170;
  4998.   dtyp_BitMapInfoHeader2        = 171;
  4999.   dtyp_Bit16                    = 20;
  5000.   dtyp_Bit32                    = 21;
  5001.   dtyp_Bit8                     = 19;
  5002.   dtyp_Bool                     = 18;
  5003.   dtyp_BtncData                 = 35;
  5004.   dtyp_Byte                     = 13;
  5005.   dtyp_CatchBuf                 = 141;
  5006.   dtyp_Char                     = 15;
  5007.   dtyp_CharBundle               = 135;
  5008.   dtyp_ClassInfo                = 95;
  5009.   dtyp_Count2                   = 93;
  5010.   dtyp_Count2b                  = 70;
  5011.   dtyp_Count2Ch                 = 82;
  5012.   dtyp_Count4                   = 152;
  5013.   dtyp_Count4b                  = 42;
  5014.   dtyp_Cpid                     = 57;
  5015.   dtyp_CreateStruct             = 98;
  5016.   dtyp_CursorInfo               = 34;
  5017.   dtyp_DevOpenStruc             = 124;
  5018.   dtyp_DlgTemplate              = 96;
  5019.   dtyp_DlgTItem                 = 97;
  5020.   dtyp_EntryFData               = 127;
  5021.   dtyp_ErrorId                  = 45;
  5022.   dtyp_FAttrs                   = 75;
  5023.   dtyp_Ffdescs                  = 142;
  5024.   dtyp_Fixed                    = 99;
  5025.   dtyp_FontMetrics              = 74;
  5026.   dtyp_FrameCData               = 144;
  5027.   dtyp_Gradientl                = 48;
  5028.   dtyp_Hab                      = 10;
  5029.   dtyp_Haccel                   = 30;
  5030.   dtyp_Happ                     = 146;
  5031.   dtyp_HAtomTbl                 = 91;
  5032.   dtyp_HBitMap                  = 62;
  5033.   dtyp_HcInfo                   = 46;
  5034.   dtyp_Hdc                      = 132;
  5035.   dtyp_HEnum                    = 117;
  5036.   dtyp_HHeap                    = 109;
  5037.   dtyp_HIni                     = 53;
  5038.   dtyp_HLib                     = 147;
  5039.   dtyp_Hmf                      = 85;
  5040.   dtyp_Hmq                      = 86;
  5041.   dtyp_HPointer                 = 106;
  5042.   dtyp_HProgram                 = 131;
  5043.   dtyp_Hps                      = 12;
  5044.   dtyp_HRgn                     = 116;
  5045.   dtyp_HSem                     = 140;
  5046.   dtyp_Hspl                     = 32;
  5047.   dtyp_HSwitch                  = 66;
  5048.   dtyp_Hvps                     = 58;
  5049.   dtyp_HWnd                     = 11;
  5050.   dtyp_Identity                 = 133;
  5051.   dtyp_Identity4                = 169;
  5052.   dtyp_ImageBundle              = 136;
  5053.   dtyp_Index2                   = 81;
  5054.   dtyp_Ipt                      = 155;
  5055.   dtyp_KerningPairs             = 118;
  5056.   dtyp_Length2                  = 68;
  5057.   dtyp_Length4                  = 69;
  5058.   dtyp_LineBundle               = 137;
  5059.   dtyp_Long                     = 25;
  5060.   dtyp_MarkerBundle             = 138;
  5061.   dtyp_Matrixlf                 = 113;
  5062.   dtyp_MlectlData               = 161;
  5063.   dtyp_MLeMargStruct            = 157;
  5064.   dtyp_MLeOverflow              = 158;
  5065.   dtyp_Offset2b                 = 112;
  5066.   dtyp_OwnerItem                = 154;
  5067.   dtyp_Pid                      = 92;
  5068.   dtyp_Pix                      = 156;
  5069.   dtyp_PointerInfo              = 105;
  5070.   dtyp_PointL                   = 77;
  5071.   dtyp_ProgCategory             = 129;
  5072.   dtyp_ProgramEntry             = 128;
  5073.   dtyp_ProgType                 = 130;
  5074.   dtyp_Property2                = 88;
  5075.   dtyp_Property4                = 89;
  5076.   dtyp_Qmsg                     = 87;
  5077.   dtyp_RectL                    = 121;
  5078.   dtyp_ResId                    = 125;
  5079.   dtyp_RGB                      = 111;
  5080.   dtyp_RgnRect                  = 115;
  5081.   dtyp_SbcData                  = 159;
  5082.   dtyp_SegOff                   = 126;
  5083.   dtyp_Short                    = 23;
  5084.   dtyp_SizeF                    = 101;
  5085.   dtyp_SizeL                    = 102;
  5086.   dtyp_StrL                     = 17;
  5087.   dtyp_Str16                    = 40;
  5088.   dtyp_Str32                    = 37;
  5089.   dtyp_Str64                    = 47;
  5090.   dtyp_Str8                     = 33;
  5091.   dtyp_SwBlock                  = 63;
  5092.   dtyp_SwCntrl                  = 64;
  5093.   dtyp_SwEntry                  = 65;
  5094.   dtyp_Swp                      = 31;
  5095.   dtyp_Tid                      = 104;
  5096.   dtyp_Time                     = 107;
  5097.   dtyp_TrackInfo                = 73;
  5098.   dtyp_UChar                    = 22;
  5099.   dtyp_ULong                    = 26;
  5100.   dtyp_UserButton               = 36;
  5101.   dtyp_UShort                   = 24;
  5102.   dtyp_Width4                   = 108;
  5103.   dtyp_WndParams                = 83;
  5104.   dtyp_WndProc                  = 84;
  5105.   dtyp_WPoint                   = 59;
  5106.   dtyp_WRect                    = 55;
  5107.   dtyp_xyMinSize                = 52;
  5108. { pointer datatypes }
  5109.   dtyp_PAccel                   = -28;
  5110.   dtyp_PAccelTable              = -29;
  5111.   dtyp_PArcParams               = -38;
  5112.   dtyp_PAreaBundle              = -139;
  5113.   dtyp_PAtom                    = -90;
  5114.   dtyp_PBitMapInfo              = -60;
  5115.   dtyp_PBitMapInfoHeader        = -61;
  5116.   dtyp_PBitMapInfo2             = -170;
  5117.   dtyp_PBitMapInfoHeader2       = -171;
  5118.   dtyp_PBit16                   = -20;
  5119.   dtyp_PBit32                   = -21;
  5120.   dtyp_PBit8                    = -19;
  5121.   dtyp_PBool                    = -18;
  5122.   dtyp_PBtnCData                = -35;
  5123.   dtyp_PByte                    = -13;
  5124.   dtyp_PCatchBuf                = -141;
  5125.   dtyp_PChar                    = -15;
  5126.   dtyp_PCharBundle              = -135;
  5127.   dtyp_PClassInfo               = -95;
  5128.   dtyp_PCount2                  = -93;
  5129.   dtyp_PCount2b                 = -70;
  5130.   dtyp_PCount2Ch                = -82;
  5131.   dtyp_PCount4                  = -152;
  5132.   dtyp_PCount4b                 = -42;
  5133.   dtyp_PCPid                    = -57;
  5134.   dtyp_PCreateStruct            = -98;
  5135.   dtyp_PCursorInfo              = -34;
  5136.   dtyp_PDevOpenStruc            = -124;
  5137.   dtyp_PDlgTemplate             = -96;
  5138.   dtyp_PDlgTItem                = -97;
  5139.   dtyp_PEntryFData              = -127;
  5140.   dtyp_PErrorId                 = -45;
  5141.   dtyp_PFAttrs                  = -75;
  5142.   dtyp_Pffdescs                 = -142;
  5143.   dtyp_PFixed                   = -99;
  5144.   dtyp_PFontMetrics             = -74;
  5145.   dtyp_PFrameCData              = -144;
  5146.   dtyp_PGradientl               = -48;
  5147.   dtyp_PHab                     = -10;
  5148.   dtyp_PHAccel                  = -30;
  5149.   dtyp_PHApp                    = -146;
  5150.   dtyp_PHAtomTbl                = -91;
  5151.   dtyp_PHBitMap                 = -62;
  5152.   dtyp_PHcInfo                  = -46;
  5153.   dtyp_PHdc                     = -132;
  5154.   dtyp_PHEnum                   = -117;
  5155.   dtyp_PHHeap                   = -109;
  5156.   dtyp_PHIni                    = -53;
  5157.   dtyp_PHLib                    = -147;
  5158.   dtyp_PHmf                     = -85;
  5159.   dtyp_PHmq                     = -86;
  5160.   dtyp_PHPointer                = -106;
  5161.   dtyp_PHProgram                = -131;
  5162.   dtyp_PHps                     = -12;
  5163.   dtyp_PHRgn                    = -116;
  5164.   dtyp_PHSem                    = -140;
  5165.   dtyp_PHSpl                    = -32;
  5166.   dtyp_PHSwitch                 = -66;
  5167.   dtyp_PHvps                    = -58;
  5168.   dtyp_PHWnd                    = -11;
  5169.   dtyp_PIdentity                = -133;
  5170.   dtyp_PIdentity4               = -169;
  5171.   dtyp_PImageBundle             = -136;
  5172.   dtyp_PIndex2                  = -81;
  5173.   dtyp_Pipt                     = -155;
  5174.   dtyp_PkerningPairs            = -118;
  5175.   dtyp_PLength2                 = -68;
  5176.   dtyp_PLength4                 = -69;
  5177.   dtyp_PLinebundle              = -137;
  5178.   dtyp_PLong                    = -25;
  5179.   dtyp_PMarkerBundle            = -138;
  5180.   dtyp_PMatrixlf                = -113;
  5181.   dtyp_PmLeCtlData              = -161;
  5182.   dtyp_PmLeMargStruct           = -157;
  5183.   dtyp_PmLeOverflow             = -158;
  5184.   dtyp_POffset2b                = -112;
  5185.   dtyp_POwnerItem               = -154;
  5186.   dtyp_PPid                     = -92;
  5187.   dtyp_PPix                     = -156;
  5188.   dtyp_PPointerInfo             = -105;
  5189.   dtyp_PPointL                  = -77;
  5190.   dtyp_PProgCategory            = -129;
  5191.   dtyp_PProgramEntry            = -128;
  5192.   dtyp_PProgType                = -130;
  5193.   dtyp_PProperty2               = -88;
  5194.   dtyp_PProperty4               = -89;
  5195.   dtyp_PQMsg                    = -87;
  5196.   dtyp_PRectL                   = -121;
  5197.   dtyp_PResid                   = -125;
  5198.   dtyp_PRGB                     = -111;
  5199.   dtyp_PRgnRect                 = -115;
  5200.   dtyp_PSbcData                 = -159;
  5201.   dtyp_PSegOff                  = -126;
  5202.   dtyp_PShort                   = -23;
  5203.   dtyp_PSizeF                   = -101;
  5204.   dtyp_PSizeL                   = -102;
  5205.   dtyp_PStrL                    = -17;
  5206.   dtyp_PStr16                   = -40;
  5207.   dtyp_PStr32                   = -37;
  5208.   dtyp_PStr64                   = -47;
  5209.   dtyp_PStr8                    = -33;
  5210.   dtyp_PSwBlock                 = -63;
  5211.   dtyp_PSwCntrl                 = -64;
  5212.   dtyp_PSwEntry                 = -65;
  5213.   dtyp_PSwp                     = -31;
  5214.   dtyp_PTid                     = -104;
  5215.   dtyp_PTime                    = -107;
  5216.   dtyp_PTrackInfo               = -73;
  5217.   dtyp_PUChar                   = -22;
  5218.   dtyp_PULong                   = -26;
  5219.   dtyp_PUserButton              = -36;
  5220.   dtyp_PUShort                  = -24;
  5221.   dtyp_PWidth4                  = -108;
  5222.   dtyp_PWndParams               = -83;
  5223.   dtyp_PWndProc                 = -84;
  5224.   dtyp_PWPoint                  = -59;
  5225.   dtyp_PWRect                   = -55;
  5226.   dtyp_PxyWinSize               = -52;
  5227.  
  5228. {----[ PMSTDDLG ]----}
  5229.  
  5230. {---------------[ F I L E    D I A L O G ]----------------}
  5231.  
  5232. { File Dialog Invocation Flag Definitions }
  5233. const
  5234.   fds_Center                    = $00000001; { Center within owner wnd   }
  5235.   fds_Custom                    = $00000002; { Use custom user template  }
  5236.   fds_FilterUnion               = $00000004; { Use union of filters      }
  5237.   fds_HelpButton                = $00000008; { Display Help button       }
  5238.   fds_ApplyButton               = $00000010; { Display Apply button      }
  5239.   fds_Preload_VolInfo           = $00000020; { Preload volume info       }
  5240.   fds_ModeLess                  = $00000040; { Make dialog modeless      }
  5241.   fds_Include_Eas               = $00000080; { Always load EA info       }
  5242.   fds_Open_Dialog               = $00000100; { Select Open dialog        }
  5243.   fds_Saveas_Dialog             = $00000200; { Select SaveAs dialog      }
  5244.   fds_MultipleSel               = $00000400; { Enable multiple selection }
  5245.   fds_EnableFileLb              = $00000800; { Enable SaveAs Listbox     }
  5246. { File Dialog Selection returned attribute }
  5247.   fds_EfSelection               = 0;
  5248.   fds_LbSelection               = 1;
  5249. { Error Return Codes from dialog (self defining) }
  5250.   fds_Successful                = 0;
  5251.   fds_Err_Deallocate_Memory     = 1;
  5252.   fds_Err_Filter_Trunc          = 2;
  5253.   fds_Err_Invalid_Dialog        = 3;
  5254.   fds_Err_Invalid_Drive         = 4;
  5255.   fds_Err_Invalid_Filter        = 5;
  5256.   fds_Err_Invalid_PathFile      = 6;
  5257.   fds_Err_Out_Of_Memory         = 7;
  5258.   fds_Err_Path_Too_Long         = 8;
  5259.   fds_Err_Too_Many_File_Types   = 9;
  5260.   fds_Err_Invalid_Version       = 10;
  5261.   fds_Err_Invalid_Custom_Handle = 11;
  5262.   fds_Err_Dialog_Load_Error     = 12;
  5263.   fds_Err_Drive_Error           = 13;
  5264. { File Dialog Messages }
  5265.   fdm_Filter                    = wm_User+40; { mp1 = PChar pszFileName}
  5266.   {                                      mp2 = Chap EA .TYPE value     }
  5267.   {                                      mr  = True -> keep file.      }
  5268.   fdm_Validate                  = wm_User+41; { mp1 = PChar pszPathName}
  5269.   {                                      mp2 = Word Field name id      }
  5270.   {                                      mr  = True -> Valid name      }
  5271.   fdm_Error                     = wm_User+42; { mp1 = Word Error message id }
  5272.   {                                      mp2 = nil   reserved          }
  5273.   {                                      mr  = nil -> Use default msg  }
  5274.  
  5275.   { Define the type that is a pointer to an array of pointers.         }
  5276.   {     Hence: pointer to an array of Z string pointers.               }
  5277. type
  5278.    PApSz = ^ApSz;
  5279.    ApSz  = array[0..1*1024*1024] of PChar;
  5280.  
  5281.   { File Dialog application data record }
  5282.    PFileDlg = ^FileDlg;
  5283.    FileDlg = record
  5284.      cbSize:          ULong;     { Size of FileDlg record.            }
  5285.      fl:              ULong;     { fds_ flags. Alter behavior of dlg. }
  5286.      ulUser:          ULong;     { User defined field.                }
  5287.      lReturn:         Long;      { Result code from dialog dismissal. }
  5288.      lSRC:            Long;      { System return code.                }
  5289.      pszTitle:        PChar;     { String to display in title bar.    }
  5290.      pszOKButton:     PChar;     { String to display in OK button.    }
  5291.      pfnDlgProc:      FnWp;      { Entry point to custom dialog proc. }
  5292.      pszIType:        PChar;     { Pointer to string containing       }
  5293.                                  {   initial EA type filter. Type     }
  5294.                                  {   does not have to exist in list.  }
  5295.      papszITypeList:  PApSz;     { Pointer to table of pointers that  }
  5296.                                  {    point to null terminated Type   }
  5297.                                  {    strings. End of table is marked }
  5298.                                  {    by a nil pointer.               }
  5299.      pszIDrive:       PChar;     { Pointer to string containing       }
  5300.                                  {   initial drive. Drive does not    }
  5301.                                  {   have to exist in drive list.     }
  5302.      papszIDriveList: PApSz;     { Pointer to table of pointers that  }
  5303.                                  {    point to null terminated Drive  }
  5304.                                  {    strings. End of table is marked }
  5305.                                  {    by a nil pointer.               }
  5306.      hMod:             HModule;  { Custom File Dialog template.       }
  5307.      szFullFile: array[0..cchMaxPath-1] of Char;{ Initial or selected }
  5308.                                  { fully qualified path and file.     }
  5309.      papszFQFilename:  PApSz;    { Pointer to table of pointers that  }
  5310.                                  {    point to null terminated FQFname}
  5311.                                  {    strings. End of table is marked }
  5312.                                  {    by a nil pointer.               }
  5313.      ulFQFCount:       ULong;    { Number of files selected           }
  5314.      usDlgId:          Word;     { Custom dialog id.                  }
  5315.      x:                Integer;  { X coordinate of the dialog         }
  5316.      y:                Integer;  { Y coordinate of the dialog         }
  5317.      sEAType:          Integer;  { Selected file's EA Type.           }
  5318.    end;
  5319.  
  5320. { File Dialog functions }
  5321.  
  5322. function WinFileDlg(WndP,WndO: HWnd; var fild: FileDlg): HWnd;
  5323. function WinDefFileDlgProc(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  5324. function WinFreeFileDlgList(papszFQFilename: PApSz): Bool;
  5325.  
  5326. { File Dialog - dialog and control ids }
  5327. const
  5328.   did_File_Dialog               = 256;
  5329.   did_Filename_Txt              = 257;
  5330.   did_Filename_Ed               = 258;
  5331.   did_Drive_Txt                 = 259;
  5332.   did_Drive_Cb                  = 260;
  5333.   did_Filter_Txt                = 261;
  5334.   did_Filter_Cb                 = 262;
  5335.   did_Directory_Txt             = 263;
  5336.   did_Directory_Lb              = 264;
  5337.   did_Files_Txt                 = 265;
  5338.   did_Files_Lb                  = 266;
  5339.   did_Help_Pb                   = 267;
  5340.   did_Apply_Pb                  = 268;
  5341.   did_Ok_Pb                     = did_Ok;
  5342.   did_Cancel_Pb                 = did_Cancel;
  5343.  
  5344.   ids_File_All_Files_Selector   = 1000;
  5345.   ids_File_Back_Cur_Path        = 1001;
  5346.   ids_File_Back_Prev_Path       = 1002;
  5347.   ids_File_Back_Slash           = 1003;
  5348.   ids_File_Base_Filter          = 1004;
  5349.   ids_File_Blank                = 1005;
  5350.   ids_File_Colon                = 1006;
  5351.   ids_File_Dot                  = 1007;
  5352.   ids_File_Drive_Letters        = 1008;
  5353.   ids_File_Fwd_Cur_Path         = 1009;
  5354.   ids_File_Fwd_Prev_Path        = 1010;
  5355.   ids_File_Forward_Slash        = 1011;
  5356.   ids_File_Parent_Dir           = 1012;
  5357.   ids_File_Q_Mark               = 1013;
  5358.   ids_File_Splat                = 1014;
  5359.   ids_File_Splat_Dot            = 1015;
  5360.   ids_File_SaveAs_Title         = 1016;
  5361.   ids_File_SaveAs_Filter_Txt    = 1017;
  5362.   ids_File_SaveAs_FileNm_Txt    = 1018;
  5363.   ids_File_Dummy_File_Name      = 1019;
  5364.   ids_File_Dummy_File_Ext       = 1020;
  5365.   ids_File_Dummy_Drive          = 1021;
  5366.   ids_File_Dummy_Root_Dir       = 1022;
  5367.   ids_File_Path_Ptr             = 1023;
  5368.   ids_File_Volume_Prefix        = 1024;
  5369.   ids_File_Volume_Suffix        = 1025;
  5370.   ids_File_Path_Ptr2            = 1026;
  5371.   ids_File_Invalid_Chars        = 1027;
  5372.  
  5373.   ids_File_Bad_Drive_Name       = 1100;
  5374.   ids_File_Bad_Drive_Or_Path_Name = 1101;
  5375.   ids_File_Bad_File_Name        = 1102;
  5376.   ids_File_Bad_Fqf              = 1103;
  5377.   ids_File_Bad_Network_Name     = 1104;
  5378.   ids_File_Bad_Sub_Dir_Name     = 1105;
  5379.   ids_File_Drive_Not_Available  = 1106;
  5380.   ids_File_Fqfname_Too_Long     = 1107;
  5381.   ids_File_Open_Dialog_Note     = 1108;
  5382.   ids_File_Path_Too_Long        = 1109;
  5383.   ids_File_SaveAs_Dialog_Note   = 1110;
  5384.  
  5385.   ids_File_Drive_Disk_Change    = 1120;
  5386.   ids_File_Drive_Not_Ready      = 1122;
  5387.   ids_File_Drive_Locked         = 1123;
  5388.   ids_File_Drive_No_Sector      = 1124;
  5389.   ids_File_Drive_Some_Error     = 1125;
  5390.   ids_File_Drive_Invalid        = 1126;
  5391.   ids_File_Insert_Disk_Note     = 1127;
  5392.   ids_File_Ok_When_Ready        = 1128;
  5393.  
  5394. {---------------[ F O N T    D I A L O G ]----------------}
  5395.  
  5396. { Font Dialog Creation record }
  5397. type
  5398.   PFontDlg = ^FontDlg;
  5399.   FontDlg = record
  5400.     cbSize:            ULong;      { SizeOf(FontDlg)                 }
  5401.     hpsScreen:         Hps;        { Screen presentation space       }
  5402.     hpsPrinter:        Hps;        { Printer presentation space      }
  5403.     pszTitle:          PChar;      { Application supplied title      }
  5404.     pszPreview:        PChar;      { String to print in preview wndw }
  5405.     pszPtSizeList:     PChar;      { Application provided size list  }
  5406.     pfnDlgProc:        FnWp;       { Dialog subclass procedure       }
  5407.     pszFamilyname:     PChar;      { Family name of font             }
  5408.     fxPointSize:       Fixed;      { Point size the user selected    }
  5409.     fl:                ULong;      { fnts_* flags - dialog styles    }
  5410.     flFlags:           ULong;      { fntf_* state flags              }
  5411.     flType:            ULong;      { Font type option bits           }
  5412.     flTypeMask:        ULong;      { Mask of which font types to use }
  5413.     flStyle:           ULong;      { The selected style bits         }
  5414.     flStyleMask:       ULong;      { Mask of which style bits to use }
  5415.     clrFore:           Long;       { Selected foreground color       }
  5416.     clrBack:           Long;       { Selected background color       }
  5417.     ulUser:            ULong;      { Blank field for application     }
  5418.     lReturn:           Long;       { Return Value of the Dialog      }
  5419.     lSRC:              Long;       { System return code.             }
  5420.     lEmHeight:         Long;       { Em height of the current font   }
  5421.     lXHeight:          Long;       { X height of the current font    }
  5422.     lExternalLeading:  Long;       { External Leading of font        }
  5423.     hMod:              HModule;    { Module to load custom template  }
  5424.     fAttrs:            FAttrs;     { Font attribute record           }
  5425.     sNominalPointSize: Word;       { Nominal Point Size of font      }
  5426.     usWeight:          Word;       { The boldness of the font        }
  5427.     usWidth:           Word;       { The width of the font           }
  5428.     x:                 Integer;    { X coordinate of the dialog      }
  5429.     y:                 Integer;    { Y coordinate of the dialog      }
  5430.     usDlgId:           Word;       { ID of a custom dialog template  }
  5431.     usFamilyBufLen:    Word;       { Length of family buffer provided}
  5432.     usReserved:        Word;       { reserved                        }
  5433.   end;
  5434.  
  5435. { Font Dialog Style Flags }
  5436. const
  5437.   fnts_Center                   = $00000001; { Center in owner dialog}
  5438.   fnts_Custom                   = $00000002; { Use custom template   }
  5439.   fnts_OwnerDrawPreview         = $00000004; { Allow app to draw     }
  5440.   fnts_HelpButton               = $00000008; { Display Help button   }
  5441.   fnts_ApplyButton              = $00000010; { Display Apply button  }
  5442.   fnts_ResetButton              = $00000020; { Display Reset button  }
  5443.   fnts_Modeless                 = $00000040; { Make dialog modeless  }
  5444.   fnts_InitFromFAttrs           = $00000080; { Initialize from FATTRs}
  5445.   fnts_BitmapOnly               = $00000100; { Only allow bitmap font}
  5446.   fnts_VectorOnly               = $00000200; { Only allow vector font}
  5447.   fnts_FixedWidthOnly           = $00000400; { Only allow monospaced }
  5448.   fnts_ProportionalOnly         = $00000800; { Only proportional font}
  5449.   fnts_NoSynthesizedFonts       = $00001000; { Don't synthesize fonts}
  5450. { Font Dialog Flags }
  5451.   fntf_NoViewScreenFonts        = 1;
  5452.   fntf_NoViewPrinterFonts       = 2;
  5453.   fntf_ScreenFontSelected       = 4;
  5454.   fntf_PrinterFontSelected      = 8;
  5455. { Color code definitions }
  5456.   clrc_Foreground               = 1;
  5457.   clrc_Background               = 2;
  5458. { Filter List message string identifiers }
  5459.   fnti_BitmapFont               = $0001;
  5460.   fnti_VectorFont               = $0002;
  5461.   fnti_FixedWidthFont           = $0004;
  5462.   fnti_ProportionalFont         = $0008;
  5463.   fnti_Synthesized              = $0010;
  5464.   fnti_DefaultList              = $0020;
  5465.   fnti_FamilyName               = $0100;
  5466.   fnti_StyleName                = $0200;
  5467.   fnti_PointSize                = $0400;
  5468. { Error Return Codes from dialog (self defining) }
  5469.   fnts_Successful               = 0;
  5470.   fnts_Err_Invalid_Dialog       = 3;
  5471.   fnts_Err_Alloc_Shared_Mem     = 4;
  5472.   fnts_Err_Invalid_Parm         = 5;
  5473.   fnts_Err_Out_Of_Memory        = 7;
  5474.   fnts_Err_Invalid_Version      = 10;
  5475.   fnts_Err_Dialog_Load_Error    = 12;
  5476. { Font Dialog Messages }
  5477.   fntm_FaceNameChanged          = wm_User+50; { mp1 = PChar pszFacename   }
  5478.   fntm_PointSizeChanged         = wm_User+51; { mp1 = PChar pszPointSize, }
  5479.                                               { mp2 = Fixed fxPointSize   }
  5480.   fntm_StyleChanged             = wm_User+52; { mp1 = PStyleChange pstyc  }
  5481.   fntm_ColorChanged             = wm_User+53; { mp1 = Long clr            }
  5482.                                               { mp2 = Word codeClr        }
  5483.   fntm_UpdatePreview            = wm_User+54; { mp1 = HWnd HWndPreview    }
  5484.   fntm_FilterList               = wm_User+55; { mp1 = PChar pszFacename   }
  5485.                                               { mp2 = Word usStrStyle     }
  5486.                                               { mr=True(Add),False(Dont)  }
  5487. { StyleChange message parameter record }
  5488. type
  5489.   PStyleChange = ^StyleChange;
  5490.   StyleChange = record
  5491.     usWeight:       Word;
  5492.     usWeightOld:    Word;
  5493.     usWidth:        Word;
  5494.     usWidthOld:     Word;
  5495.     flType:         ULong;
  5496.     flTypeOld:      ULong;
  5497.     flTypeMask:     ULong;
  5498.     flTypeMaskOld:  ULong;
  5499.     flStyle:        ULong;
  5500.     flStyleOld:     ULong;
  5501.     flStyleMask:    ULong;
  5502.     flStyleMaskOld: ULong;
  5503.   end;
  5504.  
  5505. { Font Dialog functions }
  5506.  
  5507. function WinFontDlg(WndP,WndO: HWnd; var fntd: FontDlg): HWnd;
  5508. function WinDefFontDlgProc(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  5509.  
  5510. { font dialog and control id's }
  5511. const
  5512.   did_Font_Dialog               = 300;
  5513.   did_Name                      = 301;
  5514.   did_Style                     = 302;
  5515.   did_Display_Filter            = 303;
  5516.   did_Printer_Filter            = 304;
  5517.   did_Size                      = 305;
  5518.   did_Sample                    = 306;
  5519.   did_Outline                   = 307;
  5520.   did_Underscore                = 308;
  5521.   did_Strikeout                 = 309;
  5522.   did_Help_Button               = 310;
  5523.   did_Apply_Button              = 311;
  5524.   did_Reset_Button              = 312;
  5525.   did_Ok_Button                 = did_OK;
  5526.   did_Cancel_Button             = did_Cancel;
  5527.   did_Name_Prefix               = 313;
  5528.   did_Style_Prefix              = 314;
  5529.   did_Size_Prefix               = 315;
  5530.   did_Sample_Groupbox           = 316;
  5531.   did_Emphasis_Groupbox         = 317;
  5532. { stringtable id's }
  5533.   ids_Font_Sample               = 350;
  5534.   ids_Font_Blank                = 351;
  5535.   ids_Font_Key_0                = 352;
  5536.   ids_Font_Key_9                = 353;
  5537.   ids_Font_Key_Sep              = 354;
  5538.   ids_Font_Disp_Only            = 355;
  5539.   ids_Font_Printer_Only         = 356;
  5540.   ids_Font_Combined             = 357;
  5541.   ids_Font_Weight1              = 358;
  5542.   ids_Font_Weight2              = 359;
  5543.   ids_Font_Weight3              = 360;
  5544.   ids_Font_Weight4              = 361;
  5545.   ids_Font_Weight5              = 362;
  5546.   ids_Font_Weight6              = 363;
  5547.   ids_Font_Weight7              = 364;
  5548.   ids_Font_Weight8              = 365;
  5549.   ids_Font_Weight9              = 366;
  5550.   ids_Font_Width1               = 367;
  5551.   ids_Font_Width2               = 368;
  5552.   ids_Font_Width3               = 369;
  5553.   ids_Font_Width4               = 370;
  5554.   ids_Font_Width5               = 371;
  5555.   ids_Font_Width6               = 372;
  5556.   ids_Font_Width7               = 373;
  5557.   ids_Font_Width8               = 374;
  5558.   ids_Font_Width9               = 375;
  5559.   ids_Font_Option0              = 376;
  5560.   ids_Font_Option1              = 377;
  5561.   ids_Font_Option2              = 378;
  5562.   ids_Font_Option3              = 379;
  5563.   ids_Font_Point_Size_List      = 380;
  5564.  
  5565. {---------------[ S P I N    B U T T O N ]----------------}
  5566.  
  5567. { SPINBUTTON Creation Flags }
  5568. const
  5569. { Character Acceptance      }
  5570.   spbs_AllCharActers            = $00000000; { Default: All chars accepted }
  5571.   spbs_NumericOnly              = $00000001; { Only 0 - 9 accepted & VKeys }
  5572.   spbs_ReadOnly                 = $00000002; { No chars allowed in entryfld}
  5573. { Type of Component }
  5574.   spbs_Master                   = $00000010;
  5575.   spbs_Servant                  = $00000000; { Default: Servant            }
  5576. { Type of Justification }
  5577.   spbs_JustDefault              = $00000000; { Default: Same as Left       }
  5578.   spbs_JustLeft                 = $00000008;
  5579.   spbs_JustRight                = $00000004;
  5580.   spbs_JustCenter               = $0000000C;
  5581. { Border or not }
  5582.   spbs_NoBorder                 = $00000020; { Borderless SpinField        }
  5583.                                              { Default is to have a border }
  5584. { Fast spin or not }
  5585.   spbs_FastSpin                 = $00000100; { Allow fast spinning.  Fast  }
  5586.                                              { spinning is performed by    }
  5587.                                              { skipping over numbers       }
  5588. { Pad numbers on front with 0's }
  5589.   spbs_PadWithZeros             = $00000080; { Pad the number with zeroes  }
  5590.  
  5591. { SPINBUTTON Messages }
  5592. { Notification from Spinbutton to the application is sent in a }
  5593. { wm_Control message.                                          }
  5594.   spbn_UpArrow                  = $20A;      { up arrow button was pressed  }
  5595.   spbn_DownArrow                = $20B;      { down arrow button was pressed}
  5596.   spbn_EndSpin                  = $20C;      { mouse button was released    }
  5597.   spbn_Change                   = $20D;      { spinfield text has changed   }
  5598.   spbn_SetFocus                 = $20E;      { spinfield received focus     }
  5599.   spbn_KillFocus                = $20F;      { spinfield lost focus         }
  5600. { Messages from application to Spinbutton }
  5601.   spbm_OverrideSetLimits        = $200; { Set spinbutton limits without }
  5602.                                         {   resetting the current value }
  5603.   spbm_QueryLimits              = $201; { Query limits set by           }
  5604.                                         {   spbm_SetLimits              }
  5605.   spbm_SetTextLimit             = $202; { Max entryfield characters     }
  5606.   spbm_SpinUp                   = $203; { Tell entry field to spin up   }
  5607.   spbm_SpinDown                 = $204; { Tell entry field to spin down }
  5608.   spbm_QueryValue               = $205; { Tell entry field to send      }
  5609.                                         { current value                 }
  5610. { Query Flags }
  5611.   spbq_UpdateIfValid            = 0;    { Default                       }
  5612.   spbq_AlwaysUpdate             = 1;
  5613.   spbq_DoNotUpdate              = 3;
  5614.  
  5615. { Return value for Empty Field }
  5616. { If ptr too Long, variable sent in query msg }
  5617.   spbm_SetArray                 = $206; { Change the data to spin      }
  5618.   spbm_SetLimits                = $207; { Change the numeric Limits    }
  5619.   spbm_SetCurrentValue          = $208; { Change the current value     }
  5620.   spbm_SetMaster                = $209; { Tell entryfield who master is}
  5621.  
  5622. {---------------[ DIRECT MANIPULATION ]-------------------}
  5623.  
  5624.   pmerr_Not_Dragging            = $1F00;
  5625.   pmerr_Already_Dragging        = $1F01;
  5626.  
  5627.   msgf_Drag                     = $0010    { message filter identifier };
  5628.  
  5629.   wm_DragFirst                  = $0310;
  5630.   wm_DragLast                   = $032F;
  5631.  
  5632.   dm_Drop                       = $032F;
  5633.   dm_DragOver                   = $032E;
  5634.   dm_DragLeave                  = $032D;
  5635.   dm_DropHelp                   = $032C;
  5636.   dm_EndConversation            = $032B;
  5637.   dm_Print                      = $032A;
  5638.   dm_Render                     = $0329;
  5639.   dm_RenderComplete             = $0328;
  5640.   dm_RenderPrepare              = $0327;
  5641.   dm_DragFileComplete           = $0326;
  5642.   dm_EmphasizeTarget            = $0325;
  5643.   dm_DragError                  = $0324;
  5644.   dm_FileRendered               = $0323;
  5645.   dm_RenderFile                 = $0322;
  5646.   dm_DragOverNotify             = $0321;
  5647.   dm_PrintObject                = $0320;
  5648.   dm_DiscardObject              = $031F;
  5649.  
  5650.   drt_Asm                       = 'Assembler Code';  { drag type constants  }
  5651.   drt_Basic                     = 'BASIC Code';
  5652.   drt_BinData                   = 'Binary Data';
  5653.   drt_Bitmap                    = 'Bitmap';
  5654.   drt_C                         = 'C Code';
  5655.   drt_Cobol                     = 'COBOL Code';
  5656.   drt_Dll                       = 'Dynamic Link Library';
  5657.   drt_DosCmd                    = 'DOS Command File';
  5658.   drt_Exe                       = 'Executable';
  5659.   drt_Fortran                   = 'FORTRAN Code';
  5660.   drt_Icon                      = 'Icon';
  5661.   drt_Lib                       = 'Library';
  5662.   drt_MetaFile                  = 'Metafile';
  5663.   drt_Os2Cmd                    = 'OS/2 Command File';
  5664.   drt_Pascal                    = 'Pascal Code';
  5665.   drt_Resource                  = 'Resource File';
  5666.   drt_Text                      = 'Plain Text';
  5667.   drt_Unknown                   = 'Unknown';
  5668.  
  5669.   dor_NoDrop                    = $0000;  { dm_DragOver response codes }
  5670.   dor_Drop                      = $0001;
  5671.   dor_NoDropOp                  = $0002;
  5672.   dor_NeverDrop                 = $0003;
  5673.  
  5674.   do_Copyable                   = $0001;  { supported operation flags  }
  5675.   do_Moveable                   = $0002;
  5676.   do_Linkable                   = $0004;
  5677.  
  5678.   dc_Open                       = $0001;  { source control flags       }
  5679.   dc_Ref                        = $0002;
  5680.   dc_Group                      = $0004;
  5681.   dc_Container                  = $0008;
  5682.   dc_Prepare                    = $0010;
  5683.   dc_RemoveableMedia            = $0020;
  5684.  
  5685.   do_Default                    = $BFFE;  { Default operation          }
  5686.   do_Unknown                    = $BFFF;  { Unknown operation          }
  5687.   do_Copy                       = $0010;
  5688.   do_Move                       = $0020;
  5689.   do_Link                       = $0018;
  5690.   do_Create                     = $0040;
  5691.  
  5692.   dmfl_TargetSuccessful         = $0001;  { transfer reply flags       }
  5693.   dmfl_TargetFail               = $0002;
  5694.   dmfl_NativeRender             = $0004;
  5695.   dmfl_RenderRetry              = $0008;
  5696.   dmfl_RenderOk                 = $0010;
  5697.   dmfl_RenderFail               = $0020;
  5698.  
  5699.   drg_Icon                      = $00000001;    { drag image manipulation    }
  5700.   drg_Bitmap                    = $00000002;    {   flags                    }
  5701.   drg_Polygon                   = $00000004;
  5702.   drg_Stretch                   = $00000008;
  5703.   drg_Transparent               = $00000010;
  5704.   drg_Closed                    = $00000020;
  5705.  
  5706.   dme_IgnoreAbort               = 1;            { dm_DragError return values }
  5707.   dme_IgnoreContinue            = 2;
  5708.   dme_Replace                   = 3;
  5709.   dme_Retry                     = 4;
  5710.  
  5711.   df_Move                       = $0001;        { dm_DragFileComplete flags  }
  5712.   df_Source                     = $0002;
  5713.   df_Successful                 = $0004;
  5714.  
  5715.   drr_Source                    = 1;
  5716.   drr_Target                    = 2;
  5717.   drr_Abort                     = 3;
  5718.  
  5719.   dff_Move                      = 1;            { dm_DragError operation IDs }
  5720.   dff_Copy                      = 2;
  5721.   dff_Delete                    = 3;
  5722.  
  5723. type
  5724.   HStr = LHandle;
  5725.   PDragItem = ^DragItem;
  5726.   DragItem = record
  5727.     hWndItem:          HWnd;           { conversation partner          }
  5728.     ulItemID:          ULong;          { identifies item being dragged }
  5729.     HStrType:          HStr;           { type of item                  }
  5730.     HStrRMF:           HStr;           { rendering mechanism and format}
  5731.     HStrContainerName: HStr;           { name of source container      }
  5732.     HStrSourceName:    HStr;           { name of item at source        }
  5733.     HStrTargetName:    HStr;           { suggested name of item at dest}
  5734.     cxOffset:          Integer;        { x offset of the origin of the }
  5735.                                        {   image from the mouse hotspot}
  5736.     cyOffset:          Integer;        { y offset of the origin of the }
  5737.                                        {   image from the mouse hotspot}
  5738.     fsControl:         Word;           { source item control flags     }
  5739.     fsSupportedOps:    Word;           { ops supported by source       }
  5740.   end;
  5741.  
  5742.   PDragInfo = ^DragInfo;
  5743.   DragInfo = record
  5744.     cbDraginfo:  ULong;                { Size of DragInfo and DragItems}
  5745.     cbDragitem:  Word;                 { size of DragItem              }
  5746.     usOperation: Word;                 { current drag operation        }
  5747.     hWndSource:  HWnd;                 { window handle of source       }
  5748.     xDrop:       Integer;              { x coordinate of drop position }
  5749.     yDrop:       Integer;              { y coordinate of drop position }
  5750.     cditem:      Word;                 { count of DragItems            }
  5751.     usReserved:  Word;                 { reserved for future use       }
  5752.   end;
  5753.  
  5754.   PDragImage = ^DragImage;
  5755.   DragImage = record
  5756.     cb:          Word;                 { size control block            }
  5757.     cptl:        Word;                 { count of pts, if drg_Polygon  }
  5758.     hImage:      LHandle;              { image handle passed to DrgDrag}
  5759.     sizlStretch: SizeL;                { size to strecth ico or bmp to }
  5760.     fl:          ULong;                { flags passed to DrgDrag       }
  5761.     cxOffset:    Integer;              { x offset of the origin of the }
  5762.                                        {   image from the mouse hotspot}
  5763.     cyOffset:    Integer;              { y offset of the origin of the }
  5764.   end;                                 {   image from the mouse hotspot}
  5765.  
  5766.   PDragTransfer = ^DragTransfer;
  5767.   DragTransfer = record
  5768.     cb:               ULong;           { size of control block         }
  5769.     hWndClient:       HWnd;            { handle of target              }
  5770.     pditem:           PDragItem;       { DragItem being transferred    }
  5771.     HStrSelectedRMF:  HStr;            { rendering mech & fmt of choice}
  5772.     HStrRenderToName: HStr;            { name source will use          }
  5773.     ulTargetInfo:     ULong;           { reserved for target's use     }
  5774.     usOperation:      Word;            { operation being performed     }
  5775.     fsReply:          Word;            { reply flags                   }
  5776.   end;
  5777.  
  5778.   PRenderFile = ^RenderFile;
  5779.   RenderFile = record
  5780.     hWndDragFiles: HWnd;               { conversation window           }
  5781.     HStrSource:    HStr;               { handle to source file name    }
  5782.     HStrTarget:    HStr;               { handle to target file name    }
  5783.     fMove:         Word;               { True - move, False - copy     }
  5784.     usRsvd:        Word;               { reserved                      }
  5785.   end;
  5786.  
  5787. function DrgAcceptDroppedFiles(Wnd: HWnd; Path,Types: PChar;
  5788.   DefaultOp,Reserved: ULong): Bool;
  5789. function DrgAllocDraginfo(cditem: ULong): PDragInfo;
  5790. function DrgAllocDragtransfer(cdxfer: ULong): PDragTransfer;
  5791. function DrgDrag(Source: HWnd; var dinfo: DragInfo; var dimg: DragImage;
  5792.   cdimg: ULong; vkTerminate: Long; Reserved: Pointer): HWnd;
  5793. function DrgDragFiles(Wnd: HWnd; var apszFiles,apszTypes,apszTargets: PChar;
  5794.   cFiles: ULong; hptrDrag: HPointer; vkTerm: ULong; fSourceRender: Bool; Reserved: ULong): Bool;
  5795. function DrgPostTransferMsg(Wnd: HWnd; Msg: ULong; var dxfer: DragTransfer;
  5796.   fl,Reserved: ULong; fRetry: Bool): Bool;
  5797. function DrgQueryDragitem(var dinfo: DragInfo; cbBuffer: ULong; var ditem: DragItem;
  5798.   iItem: ULong): Bool;
  5799. function DrgQueryDragitemCount(var dinfo: DragInfo): ULong;
  5800. function DrgQueryDragitemPtr(var dinfo: DragInfo; I: ULong): PDragItem;
  5801. function DrgQueryNativeRMF(var ditem: DragItem; cbBuffer: ULong; var Buffer): Bool;
  5802. function DrgQueryNativeRMFLen(var ditem: DragItem): ULong;
  5803. function DrgQueryStrName(Str: HStr; cbBuffer: ULong; Buffer: PChar): ULong;
  5804. function DrgQueryStrNameLen(Str: HStr): ULong;
  5805. function DrgQueryTrueType(var ditem: DragItem; cbBuffer: ULong; Buffer: PChar): Bool;
  5806. function DrgQueryTrueTypeLen(var ditem: DragItem): ULong;
  5807. function DrgSendTransferMsg(Wnd: HWnd; Msg: ULong; Mp1,Mp2: MParam): MResult;
  5808. function DrgSetDragitem(var dinfo: DragInfo; var ditem: DragItem;
  5809.   cbBuffer,iItem: ULong): Bool;
  5810. function DrgSetDragImage(var dinfo: DragInfo; var dimg: DragImage; cdimg: ULong;
  5811.   Reserved: Pointer): Bool;
  5812. function DrgVerifyTypeSet(var ditem: DragItem; pszType: PChar; cbMatch: ULong;
  5813.   pszMatch: PChar): Bool;
  5814. function DrgAccessDraginfo(var dinfo: DragInfo): Bool;
  5815. function DrgAddStrHandle(P: PChar): HStr;
  5816. function DrgDeleteDraginfoStrHandles(var dinfo: DragInfo): Bool;
  5817. function DrgDeleteStrHandle(Str: HStr): Bool;
  5818. function DrgFreeDraginfo(var dinfo: DragInfo): Bool;
  5819. function DrgFreeDragtransfer(var dxfer: DragTransfer): Bool;
  5820. function DrgGetPS(Wnd: HWnd): Hps;
  5821. function DrgPushDraginfo(var dinfo: DragInfo; WndDest: HWnd): Bool;
  5822. function DrgReleasePS(PS: Hps): Bool;
  5823. function DrgSetDragPointer(var dinfo: DragInfo; hptr: HPointer): Bool;
  5824. function DrgVerifyNativeRMF(var ditem: DragItem; pszRMF: PChar): Bool;
  5825. function DrgVerifyRMF(var ditem: DragItem; Mech,Fmt: PChar): Bool;
  5826. function DrgVerifyTrueType(var ditem: DragItem; pszType: PChar): Bool;
  5827. function DrgVerifyType(var ditem: DragItem; pszType: PChar): Bool;
  5828.  
  5829. {---------------[ C O N T A I N E R ]---------------------}
  5830.  
  5831. const
  5832. { Error constants }
  5833.   pmerr_Nofiltered_Items        = $1F02;
  5834.   pmerr_Comparison_Failed       = $1F03;
  5835.   pmerr_Record_Currently_Inserted = $1F04;
  5836.   pmerr_Fi_Currently_Inserted   = $1F05;
  5837. { Container control styles }
  5838.   ccs_ExtendSel                 = $00000001;
  5839.   ccs_MultipleSel               = $00000002;
  5840.   ccs_SingleSel                 = $00000004;
  5841.   ccs_AutoPosition              = $00000008;
  5842.   ccs_VerifyPointers            = $00000010;
  5843.   ccs_ReadOnly                  = $00000020;
  5844.   ccs_MiniRecordCore            = $00000040;
  5845. { view identifiers (flWindowAttr) }
  5846.   cv_Text                       = $00000001;  { text view            }
  5847.   cv_Name                       = $00000002;  { name view            }
  5848.   cv_Icon                       = $00000004;  { icon view            }
  5849.   cv_Detail                     = $00000008;  { detail view          }
  5850.   cv_Flow                       = $00000010;  { flow items           }
  5851.   cv_Mini                       = $00000020;  { use mini icon        }
  5852.   cv_Tree                       = $00000040;  { tree view            }
  5853. { Container Attributes (flWindowAttr) }
  5854.   ca_ContainerTitle             = $00000200;
  5855.   ca_TitleSeparator             = $00000400;
  5856.   ca_TitleLeft                  = $00000800;
  5857.   ca_TitleRight                 = $00001000;
  5858.   ca_TitleCenter                = $00002000;
  5859.   ca_OwnerDraw                  = $00004000;
  5860.   ca_DetailsViewTitles          = $00008000;
  5861.   ca_OrderedTargetEmph          = $00010000;
  5862.   ca_DrawBitmap                 = $00020000;
  5863.   ca_DrawIcon                   = $00040000;
  5864.   ca_TitleReadOnly              = $00080000;
  5865.   ca_OwnerPaintBackground       = $00100000;
  5866.   ca_MixedTargetEmph            = $00200000;
  5867.   ca_TreeLine                   = $00400000;
  5868. { child window IDs }
  5869.   cid_LeftColTitleWnd           = $7FF0;   { column title (left)       }
  5870.   cid_RightColTitleWnd          = $7FF1;   { right column title        }
  5871.   cid_BlankBox                  = $7FF2;   { blank box at bottom right }
  5872.   cid_HScroll                   = $7FF3;   { horizontal scroll bar     }
  5873.   cid_RighthScroll              = $7FF4;   { right horz scroll bar     }
  5874.   cid_CnrTitleWnd               = $7FF5;   { Container title window    }
  5875.   cid_LeftDvWnd                 = $7FF7;   { Left Details View window  }
  5876.   cid_RightDvWnd                = $7FF8;   { Right Details View window }
  5877.   cid_VScroll                   = $7FF9;   { vertical scroll bar       }
  5878.   cid_Mle                       = $7FFA;   { MLE window for direct edit}
  5879.  
  5880. { Bitmap descriptor array element }
  5881.  
  5882. type
  5883.   PTreeItemDesc = ^TreeItemDesc;
  5884.   TreeItemDesc = record
  5885.     hbmExpanded:   HBitMap;
  5886.     hbmCollapsed:  HBitMap;
  5887.     hptrExpanded:  HPointer;
  5888.     hptrCollapsed: HPointer;
  5889.   end;
  5890.  
  5891. { Field Info data record, attribute and data types, cv_Detail }
  5892.  
  5893.   PFieldInfo = ^FieldInfo;
  5894.   FieldInfo = record
  5895.     cb:           ULong;              { size of FieldInfo record         }
  5896.     flData:       ULong;              { attributes of field's data       }
  5897.     flTitle:      ULong;              { attributes of field's title      }
  5898.     pTitleData:   Pointer;            { title data (default is string)   }
  5899.                                       { If cft_Bitmap, must be HBitMap   }
  5900.     offStruct:    ULong;              { offset from RecordCore to data   }
  5901.     pUserData:    Pointer;            { pointer to user data             }
  5902.     pNextFieldInfo: PFieldInfo;       { pointer to next linked FieldInfo }
  5903.     cxWidth:      ULong;              { width of field in pels           }
  5904.   end;
  5905.  
  5906. { RecordCore data record, attribute values }
  5907.  
  5908.   PRecordCore = ^RecordCore;
  5909.   RecordCore = record
  5910.     cb:              ULong;
  5911.     flRecordAttr:    ULong;            { record attributes                }
  5912.     ptlIcon:         PointL;           { Position of cv_Icon item         }
  5913.     preccNextRecord: PRecordCore;      { ptr to next record               }
  5914.     pszIcon:         PChar;            { Text for cv_Icon view            }
  5915.     hptrIcon:        HPointer;         { Icon to display for not cv_Mini  }
  5916.     hptrMiniIcon:    HPointer;         { Icon to display for cv_Mini      }
  5917.     hbmBitmap:       HBitMap;          { Bitmap to display for not cv_Mini}
  5918.     hbmMiniBitmap:   HBitMap;          { Bitmap to display for cv_Mini    }
  5919.     TreeItemDesc:    PTreeItemDesc;    { Icons for the tree view          }
  5920.     pszText:         PChar;            { Text for cv_Text view            }
  5921.     pszName:         PChar;            { Text for cv_Name view            }
  5922.     pszTree:         PChar;            { Text for cv_Tree view            }
  5923.   end;
  5924.  
  5925. { MiniRecordCore data record, attribute values }
  5926.  
  5927.   PMiniRecordCore = ^MiniRecordCore;
  5928.   MiniRecordCore = record
  5929.     cb:              ULong;
  5930.     flRecordAttr:    ULong;          { record attributes              }
  5931.     ptlIcon:         PointL;         { Position of cv_Icon item       }
  5932.     preccNextRecord: PMiniRecordCore;{ ptr to next record             }
  5933.     pszIcon:         PChar;          { Text for cv_Icon view          }
  5934.     hptrIcon:        HPointer;       { Icon to display for not cv_Mini}
  5935.   end;
  5936.  
  5937. { CnrInfo data record, describes the container control }
  5938.  
  5939.   PCnrInfo = ^CnrInfo;
  5940.   CnrInfo = record
  5941.     cb:                 ULong;       { size of CnrInfo record        }
  5942.     pSortRecord:        Pointer;     { ptr to sort function,         }
  5943.                                      { RecordCore                    }
  5944.     PFieldInfoLast:     PFieldInfo;  { pointer to last column in     }
  5945.                                      { left pane of a split window.  }
  5946.     PFieldInfoObject:   PFieldInfo;  { Pointer to a column to        }
  5947.                                      { represent an object.  This is }
  5948.                                      { the column which will receive }
  5949.                                      { IN-USE emphasis.              }
  5950.     pszCnrTitle:        PChar;       { text for container title. One }
  5951.                                      { string separated by line      }
  5952.                                      { separators for multi-lines    }
  5953.     flWindowAttr:       ULong;       { container attrs - cv_*, ca_*  }
  5954.     ptlOrigin:          PointL;      { lower-left origin in virtual  }
  5955.                                      {   coordinates. cv_Icon view   }
  5956.     cDelta:             ULong;       { Application defined threshold }
  5957.                                      {   or number of records from   }
  5958.                                      {   either end of the list.     }
  5959.     cRecords:           ULong;       { number of records in container}
  5960.     slBitmapOrIcon:     SizeL;       { size of bitmap in pels        }
  5961.     slTreeBitmapOrIcon: SizeL;       { size of tree bitmaps in pels  }
  5962.     hbmExpanded:        HBitMap;     { bitmap  for tree node         }
  5963.     hbmCollapsed:       HBitMap;     { bitmap  for tree node         }
  5964.     hptrExpanded:       HPointer;    { icon    for tree node         }
  5965.     hptrCollapsed:      HPointer;    { icon    for tree node         }
  5966.     cyLineSpacing:      Long;        { space between two rows        }
  5967.     cxTreeIndent:       Long;        { indent for children           }
  5968.     cxTreeLine:         Long;        { thickness of the Tree Line    }
  5969.     cFields:            ULong;       { number of fields  in container}
  5970.     xVertSplitbar:      Long;        { position relative to the      }
  5971.                                      {   container (cv_Detail): if   }
  5972.                                      {   $FFFF then unsplit          }
  5973.   end;
  5974.  
  5975.   PCDate = ^CDate;
  5976.   CDate = record
  5977.     day:   Byte;                     { current day               }
  5978.     month: Byte;                     { current month             }
  5979.     year:  Word;                     { current year              }
  5980.   end;
  5981.  
  5982.   PCTime = ^CTime;
  5983.   CTime = record
  5984.     hours:      Byte;                { current hour              }
  5985.     minutes:    Byte;                { current minute            }
  5986.     seconds:    Byte;                { current second            }
  5987.     ucReserved: Byte;                { reserved                  }
  5988.   end;
  5989.  
  5990. { attribute and type values for flData and flTitle members of }
  5991. { FieldInfo, cfa_ (attributes), cft_ (types)                  }
  5992. const
  5993.   cfa_Left                      = $00000001; { left align text            }
  5994.   cfa_Right                     = $00000002; { right align text           }
  5995.   cfa_Center                    = $00000004; { center text                }
  5996.   cfa_Top                       = $00000008; { top-align text             }
  5997.   cfa_VCenter                   = $00000010; { vertically center text     }
  5998.   cfa_Bottom                    = $00000020; { bottom-align text          }
  5999.   cfa_Invisible                 = $00000040; { Specify invisible column.  }
  6000.   cfa_BitmapOrIcon              = $00000100; { field title is bitmap      }
  6001.   cfa_Separator                 = $00000200; { vert sep, right of fld     }
  6002.   cfa_HorzSeparator             = $00000400; { horz sep, bottom of fld    }
  6003.  
  6004.   cfa_String                    = $00000800; { string of characters       }
  6005.   cfa_Owner                     = $00001000; { ownerdraw field            }
  6006.   cfa_Date                      = $00002000; { date record                }
  6007.   cfa_Time                      = $00004000; { time record                }
  6008.   cfa_FiReadOnly                = $00008000; { Column is read-only.       }
  6009.   cfa_FiTitleReadOnly           = $00010000; { Column Title is read-only  }
  6010.   cfa_ULong                     = $00020000; { Column is number format    }
  6011. { attribute values for flRecordAttr member of RecordCore }
  6012.   cra_Selected                  = $00000001; { record is selected         }
  6013.   cra_Target                    = $00000002; { record has target emphasis }
  6014.   cra_Cursored                  = $00000004; { cursor is on the record    }
  6015.   cra_Inuse                     = $00000008; { record has in-use emphasis }
  6016.   cra_Filtered                  = $00000010; { record has been filtered   }
  6017.   cra_Droponable                = $00000020; { record can be dropped on   }
  6018.   cra_RecordReadOnly            = $00000040; { record is read-only        }
  6019.   cra_Expanded                  = $00000080; { record is expanded         }
  6020.   cra_Collapsed                 = $00000100; { record is collapsed        }
  6021.  
  6022. { Container messages }
  6023.   cm_AllocDetailFieldInfo       = $0330;
  6024.   cm_AllocRecord                = $0331;
  6025.   cm_Arrange                    = $0332;
  6026.   cm_EraseRecord                = $0333;
  6027.   cm_Filter                     = $0334;
  6028.   cm_FreeDetailFieldInfo        = $0335;
  6029.   cm_FreeRecord                 = $0336;
  6030.   cm_HorzScrollSplitWindow      = $0337;
  6031.   cm_InsertDetailFieldInfo      = $0338;
  6032.   cm_InsertRecord               = $0339;
  6033.   cm_InvalidateDetailFieldInfo  = $033A;
  6034.   cm_InvalidateRecord           = $033B;
  6035.   cm_PaintBackground            = $033C;
  6036.   cm_QueryCnrInfo               = $033D;
  6037.   cm_QueryDetailFieldInfo       = $033E;
  6038.   cm_QueryDragImage             = $033F;
  6039.   cm_QueryRecord                = $0340;
  6040.   cm_QueryRecordEmphasis        = $0341;
  6041.   cm_QueryRecordFromRect        = $0342;
  6042.   cm_QueryRecordRect            = $0343;
  6043.   cm_QueryViewPortRect          = $0344;
  6044.   cm_RemoveDetailFieldInfo      = $0345;
  6045.   cm_RemoveRecord               = $0346;
  6046.   cm_ScrollWindow               = $0347;
  6047.   cm_SearchString               = $0348;
  6048.   cm_SetCnrInfo                 = $0349;
  6049.   cm_SetRecordEmphasis          = $034A;
  6050.   cm_SortRecord                 = $034B;
  6051.   cm_OpenEdit                   = $034C;
  6052.   cm_CloseEdit                  = $034D;
  6053.   cm_CollapseTree               = $034E;
  6054.   cm_ExpandTree                 = $034F;
  6055.   cm_QueryRecordInfo            = $0350;
  6056. { Container notifications }
  6057.   cn_DragAfter                  = 101;
  6058.   cn_DragLeave                  = 102;
  6059.   cn_DragOver                   = 103;
  6060.   cn_Drop                       = 104;
  6061.   cn_DropHelp                   = 105;
  6062.   cn_Enter                      = 106;
  6063.   cn_InitDrag                   = 107;
  6064.   cn_Emphasis                   = 108;
  6065.   cn_KillFocus                  = 109;
  6066.   cn_Scroll                     = 110;
  6067.   cn_QueryDelta                 = 111;
  6068.   cn_SetFocus                   = 112;
  6069.   cn_ReallocPsz                 = 113;
  6070.   cn_BeginEdit                  = 114;
  6071.   cn_EndEdit                    = 115;
  6072.   cn_CollapseTree               = 116;
  6073.   cn_ExpandTree                 = 117;
  6074.   cn_Help                       = 118;
  6075.   cn_ContextMenu                = 119;
  6076.  
  6077. { Data records for Message Parameters   }
  6078. { Container Direct Manipulation records }
  6079. type
  6080.   PCnrDragInit = ^CnrDragInit;
  6081.   CnrDragInit = record
  6082.     hWndCnr: HWnd;                      { Container window handle   }
  6083.     pRecord: PRecordCore;               { record under mouse ptr    }
  6084.     x:       Long;                      { x coordinate of mouse ptr }
  6085.     y:       Long;                      { y coordinate of mouse ptr }
  6086.     cx:      Long;                      { x offset from record      }
  6087.     cy:      Long;                      { y offset from record      }
  6088.   end;
  6089.  
  6090. { Data record for cm_insertDetailFieldInfo                       }
  6091. { This record is used by the application to specify the position }
  6092. { of the FieldInfo records they are inserting.                   }
  6093.  
  6094.   PFieldInfoInsert = ^FieldInfoInsert;
  6095.   FieldInfoInsert = record
  6096.     cb:                   ULong;        { Size of record.           }
  6097.     PFieldInfoOrder:      PFieldInfo;   { Specifies the order of the}
  6098.                                         {  FieldInfo records.       }
  6099.     fInvalidateFieldInfo: ULong;        { Invalidate on Insert.     }
  6100.     cFieldInfoInsert:     ULong;        { The number of FieldInfo   }
  6101.                                         { records to insert.        }
  6102.   end;
  6103.  
  6104. { Data record for cm_InsertRecord }
  6105.  
  6106.   PRecordInsert = ^RecordInsert;
  6107.   RecordInsert = record
  6108.     cb:                ULong;
  6109.     pRecordOrder:      PRecordCore;
  6110.     pRecordParent:     PRecordCore;
  6111.     fInvalidateRecord: ULong;
  6112.     zOrder:            ULong;
  6113.     cRecordsInsert:    ULong;
  6114.   end;
  6115.  
  6116. { Data record for cm_QueryRecordFromRect }
  6117.  
  6118.   PQueryRecFromRect = ^QueryRecFromRect;
  6119.   QueryRecFromRect = record
  6120.     cb:       ULong;
  6121.     rect:     RectL;
  6122.     fsSearch: ULong;
  6123.   end;
  6124.  
  6125. { Data record for cm_QueryRecordRect }
  6126.  
  6127.   PQueryRecordRect = ^QueryRecordRect;
  6128.   QueryRecordRect = record
  6129.     cb:                ULong;
  6130.     pRecord:           PRecordCore;
  6131.     fRightSplitWindow: ULong;
  6132.     fsExtent:          ULong;
  6133.   end;
  6134.  
  6135. { Data record for cm_SearchString }
  6136.  
  6137.   PSearchString = ^SearchString;
  6138.   SearchString = record
  6139.     cb:              ULong;
  6140.     pszSearch:       PChar;
  6141.     fsPrefix:        ULong;
  6142.     fsCaseSensitive: ULong;
  6143.     usView:          ULong;
  6144.   end;
  6145.  
  6146.   { Data record for cn_DragLeave,cn_DragOver,cn_Drop,cn_DropHelp }
  6147.  
  6148.   PCnrDragInfo = ^CnrDragInfo;
  6149.   CnrDragInfo = record
  6150.     PDragInfo: PDragInfo;
  6151.     pRecord:  PRecordCore;
  6152.   end;
  6153.  
  6154. { Data record for cn_Emphasis }
  6155.  
  6156.   PNotifyRecordEmphasis = ^NotifyRecordEmphasis;
  6157.   NotifyRecordEmphasis = record
  6158.     hWndCnr:       HWnd;
  6159.     pRecord:       PRecordCore;
  6160.     fEmphasisMask: ULong;
  6161.   end;
  6162.  
  6163. { Data record for cn_Enter }
  6164.  
  6165.   PNotifyRecordEnter = ^NotifyRecordEnter;
  6166.   NotifyRecordEnter = record
  6167.     hWndCnr: HWnd;
  6168.     fKey:    ULong;
  6169.     pRecord: PRecordCore;
  6170.   end;
  6171.  
  6172. { Data record for cn_QueryDelta }
  6173.  
  6174.   PNotifyDelta = ^NotifyDelta;
  6175.   NotifyDelta = record
  6176.     hWndCnr: HWnd;
  6177.     fDelta:  ULong;
  6178.   end;
  6179.  
  6180. { Data record for cn_Scroll }
  6181.  
  6182.   PNotifyScroll = ^NotifyScroll;
  6183.   NotifyScroll = record
  6184.     hWndCnr:    HWnd;
  6185.     lScrollInc: Long;
  6186.     fScroll:    ULong;
  6187.   end;
  6188.  
  6189. { Data record for cn_ReallocPsz }
  6190.  
  6191.   PPChar = ^PChar;
  6192.   PCnrEditData = ^CnrEditData;
  6193.   CnrEditData = record
  6194.     cb:         ULong;
  6195.     hWndCnr:    HWnd;
  6196.     pRecord:    PRecordCore;
  6197.     PFieldInfo: PFieldInfo;
  6198.     ppszText:   PPChar;               { address of PChar      }
  6199.     cbText:     ULong;                { size of the new text  }
  6200.     id:         ULong;
  6201.   end;
  6202.  
  6203. { Data record for cm_PaintBackground }
  6204.  
  6205.   POwnerBackground = ^OwnerBackground;
  6206.   OwnerBackground = record
  6207.     hWnd:          HWnd;
  6208.     Hps:           Hps;
  6209.     rclBackground: RectL;
  6210.     idWindow:      Long;
  6211.   end;
  6212.  
  6213. { Data record used as part of wm_DragItem }
  6214.  
  6215.   PCnrDrawItemInfo = ^CnrDrawItemInfo;
  6216.   CnrDrawItemInfo = record
  6217.     pRecord:    PRecordCore;
  6218.     PFieldInfo: PFieldInfo;
  6219.   end;
  6220.  
  6221. { Message parameter flags }
  6222. const
  6223.   cma_Top                       = $0001;      { Place at top of zorder   }
  6224.   cma_Bottom                    = $0002;      { Place at bottom of zorder}
  6225.   cma_Left                      = $0004;
  6226.   cma_Right                     = $0008;
  6227.  
  6228.   cma_First                     = $0010;      { Add record as first      }
  6229.   cma_Last                      = $0020;
  6230.   cma_End                       = $0040;      { Add record to end of list}
  6231.   cma_Prev                      = $0080;
  6232.   cma_Next                      = $0100;
  6233.  
  6234.   cma_Horizontal                = $0200;
  6235.   cma_Vertical                  = $0400;
  6236.   cma_Icon                      = $0800;
  6237.   cma_Text                      = $1000;
  6238.   cma_Partial                   = $2000;
  6239.   cma_Complete                  = $4000;
  6240.  
  6241.   cma_Parent                    = $0001;
  6242.   cma_FirstChild                = $0002;
  6243.   cma_LastChild                 = $0004;
  6244.  
  6245.   cma_CnrTitle                  = $0001;      { Container title          }
  6246.   cma_Delta                     = $0002;      { Application defined      }
  6247.   cma_FlWindowAttr              = $0004;      { Container attributes     }
  6248.   cma_LineSpacing               = $0008;
  6249.   cma_PFieldInfoLast            = $0010;      { Ptr to last column in    }
  6250.  
  6251.   cma_PSortRecord               = $0020;      { Pointer to sort function }
  6252.   cma_PtlOrigin                 = $0040;      { Lower left origin        }
  6253.   cma_SlBitmapOrIcon            = $0080;      { Size  of bitmap          }
  6254.   cma_XVertSplitBar             = $0100;      { Splitbar position        }
  6255.   cma_PFieldInfoObject          = $0200;      { Pointer to IN-USE        }
  6256.                                               {   emphasis column.       }
  6257.  
  6258.   cma_TreeIcon                  = $0400;      { Icon for tree node       }
  6259.   cma_TreeBitmap                = $0800;      { bitmap for tree node     }
  6260.   cma_CxTreeIndent              = $1000;      { indent for children      }
  6261.   cma_CxTreeLine                = $2000;      { thickness of tree line   }
  6262.   cma_SlTreeBitmapOrIcon        = $4000;      { size of icon of tree node}
  6263.  
  6264.   cma_ItemOrder                 = $0001;      { QueryRecord search flags }
  6265.   cma_Window                    = $0002;
  6266.   cma_Workspace                 = $0004;
  6267.   cma_ZOrder                    = $0008;
  6268.  
  6269.   cma_DeltaTop                  = $0001;      { Industrial - top delta   }
  6270.   cma_DeltaBot                  = $0002;      { Industrial - bottom delta}
  6271.   cma_DeltaHome                 = $0004;      { Industrial - top of list }
  6272.   cma_DeltaEnd                  = $0008;      { Industrial - end of list }
  6273.  
  6274.   cma_NoReposition              = $0001;      { InvalidateRecord flags   }
  6275.   cma_Reposition                = $0002;
  6276.   cma_TextChanged               = $0004;
  6277.   cma_Erase                     = $0008;
  6278.  
  6279.   cma_Free                      = $0001;
  6280.   cma_Invalidate                = $0002;
  6281.  
  6282. {---------------[ S L I D E R ]---------------------------}
  6283.  
  6284. { Define messages for the slider control }
  6285.   slm_AddDetent                 = $0369;    { Add detent niche          }
  6286.   slm_QueryDetentPos            = $036A;    { Query position of detent  }
  6287.   slm_QueryScaleText            = $036B;    { Query text at tick number }
  6288.   slm_QuerySliderInfo           = $036C;    { Query slider information  }
  6289.   slm_QueryTickPos              = $036D;    { Query position of tick    }
  6290.   slm_QueryTickSize             = $036E;    { Query size of tick        }
  6291.   slm_RemoveDetent              = $036F;    { Remove detent niche       }
  6292.   slm_SetScaleText              = $0370;    { Set text above tick       }
  6293.   slm_SetSliderInfo             = $0371;    { Set slider parameters     }
  6294.   slm_SetTickSize               = $0372;    { Set size of tick          }
  6295.   sln_Change                    = 1;        { Slider position changed   }
  6296.   sln_SliderTrack               = 2;        { Slider dragged by user    }
  6297.   sln_SetFocus                  = 3;        { Slider gaining focus      }
  6298.   sln_KillFocus                 = 4;        { Slider losing focus       }
  6299.  
  6300. { Slider control data record }
  6301. type
  6302.   PSldCData = ^SldCData;
  6303.   SldCData = record
  6304.     cbSize:             ULong;     { Size of control block             }
  6305.     usScale1Increments: Word;      { # of divisions on scale           }
  6306.     usScale1Spacing:    Word;      { Space in pels between increments  }
  6307.     usScale2Increments: Word;      { # of divisions on scale           }
  6308.     usScale2Spacing:    Word;      { Space in pels between increments  }
  6309.   end;
  6310.  
  6311. { Slider control style flag definition }
  6312. const
  6313.   sls_Horizontal                = $00000000; { Orient slider horizontally}
  6314.   sls_Vertical                  = $00000001; { Orient slider vertically  }
  6315.   sls_Center                    = $00000000; { Center shaft in window    }
  6316.   sls_Bottom                    = $00000002; { Offset shaft to bottom (H)}
  6317.   sls_Top                       = $00000004; { Offset shaft to top (H)   }
  6318.   sls_Left                      = $00000002; { Offset shaft to left (V)  }
  6319.   sls_Right                     = $00000004; { Offset shaft to right (V) }
  6320.   sls_SnapToIncrement           = $00000008; { Snap to nearest increment }
  6321.   sls_ButtonsBottom             = $00000010; { Add buttons at shaft bot. }
  6322.   sls_ButtonStop                = $00000020; { Add buttons at shaft top  }
  6323.   sls_ButtonsLeft               = $00000010; { Add buttons left of shaft }
  6324.   sls_ButtonsRight              = $00000020; { Add buttons right of shaft}
  6325.   sls_OwnerDraw                 = $00000040; { Owner draw some fields    }
  6326.   sls_ReadOnly                  = $00000080; { Provide a read only slider}
  6327.   sls_RibbonStrip               = $00000100; { Provide a ribbon strip    }
  6328.   sls_HomeBottom                = $00000000; { Set home position at bot. }
  6329.   sls_HomeTop                   = $00000200; { Set home position at top  }
  6330.   sls_HomeLeft                  = $00000000; { Set home position at left }
  6331.   sls_HomeRight                 = $00000200; { Set home position at right}
  6332.   sls_PrimaryScale1             = $00000000; { Scale 1 is primary scale  }
  6333.   sls_PrimaryScale2             = $00000400; { Scale 2 is primary scale  }
  6334.  
  6335. { Message attributes for setting and querying slider components }
  6336.   sma_Scale1                    = $0001;
  6337.   sma_Scale2                    = $0002;
  6338.   sma_ShaftDimensions           = $0000;
  6339.   sma_ShaftPosition             = $0001;
  6340.   sma_SliderArmDimensions       = $0002;
  6341.   sma_SliderArmPosition         = $0003;
  6342.   sma_RangeValue                = $0000;
  6343.   sma_IncrementValue            = $0001;
  6344.   sma_SetAllTicks               = $FFFF;
  6345.  
  6346. { Ownerdraw flag definitions }
  6347.   sda_RibbonStrip               = $0001;
  6348.   sda_SliderShaft               = $0002;
  6349.   sda_Background                = $0003;
  6350.   sda_SliderArm                 = $0004;
  6351.  
  6352. { Error return codes }
  6353.   pmerr_Update_In_Progress      = $1F06;
  6354.   slderr_Invalid_Parameters     = -1;
  6355.  
  6356. {---------------[ V A L U E   S E T ]---------------------}
  6357.  
  6358. { Define messages for the value set control }
  6359.   vm_QueryItem                  = $0375;    { Query item at location    }
  6360.   vm_QueryItemAttr              = $0376;    { Query item attributes     }
  6361.   vm_QueryMetrics               = $0377;    { Query metrics of control  }
  6362.   vm_QuerySelectEdItem          = $0378;    { Query selected item       }
  6363.   vm_SelectItem                 = $0379;    { Set selected item         }
  6364.   vm_SetItem                    = $037A;    { Set item at location      }
  6365.   vm_SetItemAttr                = $037B;    { Set item attributes       }
  6366.   vm_SetMetrics                 = $037C;    { Set metrics of control    }
  6367.  
  6368.   vn_Select                     = 120;      { Item selected by user     }
  6369.   vn_Enter                      = 121;      { Item entered by user      }
  6370.   vn_DragLeave                  = 122;      { Drag left control         }
  6371.   vn_DragOver                   = 123;      { Drag is over item         }
  6372.   vn_Drop                       = 124;      { Drop occurred on item     }
  6373.   vn_DropHelp                   = 125;      { Request help for drop     }
  6374.   vn_InitDrag                   = 126;      { Drag initiated on item    }
  6375.   vn_SetFocus                   = 127;      { Value set gaining focus   }
  6376.   vn_KillFocus                  = 128;      { Value set losing focus    }
  6377.   vn_Help                       = 129;      { Help requested by user    }
  6378.  
  6379. { Value set control data record }
  6380. type
  6381.   PVSCData = ^VSCData;
  6382.   VSCData = record
  6383.     cbSize:        ULong;          { Size of control block             }
  6384.     usRowCount:    Word;           { Number of rows in value set       }
  6385.     usColumnCount: Word;           { Number of columns in value set    }
  6386.   end;
  6387.  
  6388. { Value set drag initialization record }
  6389.  
  6390.   PVSDragInit = ^VSDragInit;
  6391.   VSDragInit = record
  6392.     hWnd:     HWnd;                { Window handle of value set control}
  6393.     x:        Long;                { X coordinate of pointer on desktop}
  6394.     y:        Long;                { Y coordinate of pointer on desktop}
  6395.     cx:       Long;                { X offset from pointer hot spot    }
  6396.     cy:       Long;                { Y offset from pointer hot spot    }
  6397.     usRow:    Word;                { Number of rows in value set       }
  6398.     usColumn: Word;                { Number of columns in value set    }
  6399.   end;
  6400.  
  6401. { Value set drag information record }
  6402.   PVSDragInfo = ^VSDragInfo;
  6403.   VSDragInfo = record
  6404.     PDragInfo: PDragInfo;          { Pointer to a drag info record     }
  6405.     usRow:     Word;               { Number of rows in value set       }
  6406.     usColumn:  Word;               { Number of columns in value set    }
  6407.   end;
  6408.  
  6409. { Value set query item text record }
  6410.  
  6411.   PVSText = ^VSText;
  6412.   VSText = record
  6413.     pszItemText: PChar;            { Pointer to string for item text      }
  6414.     ulBufLen:    ULong;            { Length of buffer to copy string into }
  6415.   end;
  6416.  
  6417. { Value set control style flag definition }
  6418. const
  6419.   vs_Bitmap                     = $0001;  { Default all items to bitmaps      }
  6420.   vs_Icon                       = $0002;  { Default all items to icons        }
  6421.   vs_Text                       = $0004;  { Default all items to text strings }
  6422.   vs_RGB                        = $0008;  { Default all items to color info   }
  6423.   vs_ColorIndex                 = $0010;  { Default all items to color indices}
  6424.   vs_Border                     = $0020;  { Add a border around the control   }
  6425.   vs_ItemBorder                 = $0040;  { Add a border around each item     }
  6426.   vs_ScaleBitmaps               = $0080;  { Scale bitmaps to cell size        }
  6427.   vs_RightToLeft                = $0100;  { Support right to left ordering    }
  6428.   vs_OwnerDraw                  = $0200;  { Owner draws value set background  }
  6429.  
  6430. { Value set item attribute definition }
  6431.   via_Bitmap                    = $0001; { If set, item contains a bitmap    }
  6432.   via_Icon                      = $0002; { If set, item contains an icon     }
  6433.   via_Text                      = $0004; { If set, item contains text string }
  6434.   via_RGB                       = $0008; { If set, item contains color value }
  6435.   via_ColorIndex                = $0010; { If set, item contains color index }
  6436.   via_OwnerDraw                 = $0020; { If set, item is ownerdraw         }
  6437.   via_Disabled                  = $0040; { If set, item is unselectable      }
  6438.   via_Draggable                 = $0080; { If set, item can be source of drag}
  6439.   via_Droponable                = $0100; { If set, item can be target of drop}
  6440.  
  6441. { Message parameter attributes for sizing and spacing of items }
  6442.   vma_ItemSize                  = $0001;
  6443.   vma_ItemSpacing               = $0002;
  6444.  
  6445. { Ownerdraw flag definitions }
  6446.   vda_Item                      = $0001;
  6447.   vda_ItemBackground            = $0002;
  6448.   vda_Surrounding               = $0003;
  6449.   vda_Background                = $0004;
  6450.  
  6451. { Error return codes }
  6452.   vserr_Invalid_Parameters      = -1;
  6453.  
  6454. {---------------[ N O T E B O O K ]-----------------------}
  6455.  
  6456. { Message ids }
  6457.   bkm_CalcPageRect              = $0353; { Calc book/page rectangle  }
  6458.   bkm_DeletePage                = $0354; { Delete page(s)            }
  6459.   bkm_InsertPage                = $0355; { Insert page               }
  6460.   bkm_InvalidateTabs            = $0356; { Invalidate tab area       }
  6461.   bkm_TurnToPage                = $0357; { Turn to page              }
  6462.   bkm_QueryPageCount            = $0358; { Query number of pages     }
  6463.   bkm_QueryPageId               = $0359; { Query page identifier     }
  6464.   bkm_QueryPageData             = $035A; { Query page user data      }
  6465.   bkm_QueryPageWindowHWnd       = $035B; { Query page window handle  }
  6466.   bkm_QueryTabBitmap            = $035C; { Query tab bitmap handle   }
  6467.   bkm_QueryTabText              = $035D; { Query tab text pointer    }
  6468.   bkm_SetDimensions             = $035E; { Set tab/dogear dimensions }
  6469.   bkm_SetPageData               = $035F; { Set page user data        }
  6470.   bkm_SetPageWindowHWnd         = $0360; { Set page window handle    }
  6471.   bkm_SetStatusLineText         = $0361; { Set status line text      }
  6472.   bkm_SetTabBitmap              = $0362; { Set tab bitmap            }
  6473.   bkm_SetTabText                = $0363; { Set tab text              }
  6474.   bkm_SetNotebookColors         = $0364; { Set Notebook colors       }
  6475.   bkm_QueryPageStyle            = $0365; { Query page style          }
  6476.   bkm_QueryStatusLineText       = $0366; { Query status line text    }
  6477.  
  6478.   bkn_PageSelected              = 130;   { New page selected by user }
  6479.   bkn_NewPageSize               = 131;   { App page size changed     }
  6480.   bkn_Help                      = 132;   { Help notification         }
  6481.   bkn_PageDeleted               = 133;   { Page deleted notification }
  6482.  
  6483. { Page deletion flags (usDeleteFlag) }
  6484.   bka_All                       = $0001; { all pages                 }
  6485.   bka_Single                    = $0002; { single page               }
  6486.   bka_Tab                       = $0004; { minor/major section       }
  6487.  
  6488. { Page insertion/query order (usPageOrder, usQueryOrder) }
  6489.   bka_Last                      = $0002; { Insert/Query last page    }
  6490.   bka_First                     = $0004; { Insert/Query first page   }
  6491.   bka_Next                      = $0008; { Insert/Query after page   }
  6492.   bka_Prev                      = $0010; { Insert/Query before page  }
  6493.   bka_Top                       = $0020; { Query topmost page        }
  6494.  
  6495. { Notebook region types (usBookRegion, usType) }
  6496.   bka_MajorTab                  = $0001; { Major Tab                 }
  6497.   bka_MinorTab                  = $0002; { Minor Tab                 }
  6498.   bka_PageButton                = $0100; { Page Turning Button       }
  6499.  
  6500. { Page insertion/query styles (usPageStyle,usQueryEnd) }
  6501.   bka_StatusTextOn              = $0001; { status area text          }
  6502.   bka_Major                     = $0040; { Major Tab                 }
  6503.   bka_Minor                     = $0080; { Minor Tab                 }
  6504.   bka_AutoPageSize              = $0100; { Page window position/size }
  6505.   bka_End                       = $0200; { Query to end of book      }
  6506.  
  6507. { Tab window contents (usTabDisplay) }
  6508.   bka_Text                      = $0400; { text data                 }
  6509.   bka_Bitmap                    = $0800; { bitmap                    }
  6510.  
  6511. { Notebook window styles (ulNotebookStyles) }
  6512.  
  6513.   bks_BackPageSbr               = $00000001; { Bottom right          }
  6514.   bks_BackPageSbl               = $00000002; { Bottom left           }
  6515.   bks_BackPageStr               = $00000004; { Top right             }
  6516.   bks_BackPageStl               = $00000008; { Top left              }
  6517.  
  6518. { Major Tab Side }
  6519.   bks_MajorTabRight             = $00000010; { Major tabs right      }
  6520.   bks_MajorTabLeft              = $00000020; { Major tabs left       }
  6521.   bks_MajorTabTop               = $00000040; { Major tabs top        }
  6522.   bks_MajorTabBottom            = $00000080; { Major tabs bottom     }
  6523.  
  6524. { Tab Type }
  6525.   bks_SquareTabs                = $00000000; { Square edged tabs     }
  6526.   bks_RoundedTabs               = $00000100; { Round edged tabs      }
  6527.   bks_PolygonTabs               = $00000200; { Polygon edged tabs    }
  6528.  
  6529. { Binding type }
  6530.   bks_SolidBind                 = $00000000; { Solid binding         }
  6531.   bks_SpiralBind                = $00000400; { Spiral binding        }
  6532.  
  6533. { Status line text justification }
  6534.   bks_StatusTextLeft            = $00000000; { Left justify text     }
  6535.   bks_StatusTextRight           = $00001000; { Right justify text    }
  6536.   bks_StatusTextCenter          = $00002000; { Center text           }
  6537.  
  6538. { Tab text justification }
  6539.   bks_TabTextLeft               = $00000000; { Left justify tab text }
  6540.   bks_TabTextRight              = $00004000; { Right justify tab text}
  6541.   bks_TabTextCenter             = $00008000; { Center tab text       }
  6542.  
  6543. { Notebook color presentation param attributes }
  6544.   bka_BackgroundPageColorIndex  = $0001; { Page Background       }
  6545.   bka_BackgroundPageColor       = $0002;
  6546.   bka_BackgroundMajorColorIndex = $0003; { Major Tab Background  }
  6547.   bka_BackgroundMajorColor      = $0004;
  6548.   bka_BackgroundMinorColorIndex = $0005; { Minor Tab Background  }
  6549.   bka_BackgroundMinorColor      = $0006;
  6550.   bka_ForegroundMajorColorIndex = $0007; { Major Tab Text        }
  6551.   bka_ForegroundMajorColor      = $0008;
  6552.   bka_ForegroundMinorColorIndex = $0009; { Minor Tab Text        }
  6553.   bka_ForegroundMinorColor      = $000A;
  6554.  
  6555. { Error message ids }
  6556.   bookerr_Invalid_Parameters    = -1;   { Invalid parameters     }
  6557.  
  6558. { bkm_QueryTabText and bkm_QueryStatusLineText message record }
  6559. type
  6560.   PBookText = ^BookText;
  6561.   BookText = record
  6562.     pString: PChar;                     { ptr to string buffer      }
  6563.     textLen: ULong;                     { length of string to query }
  6564.   end;
  6565.  
  6566. { bkn_PageDeleted notify message record }
  6567.  
  6568.   PDeleteNotify = ^DeleteNotify;
  6569.   DeleteNotify = record
  6570.     hWndBook:      HWnd;                { Notebook window handle    }
  6571.     hWndPage:      HWnd;                { App. page window handle   }
  6572.     ulAppPageData: ULong;               { App. page data            }
  6573.     hbmTab:        HBitMap;             { App. tab bitmap handle    }
  6574.   end;
  6575.  
  6576. { bkn_PageSelected notify message record }
  6577.  
  6578.   PPageSelectNotify = ^PageSelectNotify;
  6579.   PageSelectNotify = record
  6580.     hWndBook:    HWnd;                  { Notebook window handle    }
  6581.     ulPageIdCur: ULong;                 { Previous top page id      }
  6582.     ulPageIdNew: ULong;                 { New top Page id           }
  6583.   end;
  6584.  
  6585. {----[ PMERR ]----}
  6586.  
  6587. { Window Manager error codes }
  6588. const
  6589.   pmerr_Invalid_HWnd            = $1001;
  6590.   pmerr_Invalid_Hmq             = $1002;
  6591.   pmerr_Parameter_Out_Of_Range  = $1003;
  6592.   pmerr_Window_Lock_Underflow   = $1004;
  6593.   pmerr_Window_Lock_Overflow    = $1005;
  6594.   pmerr_Bad_Window_Lock_Count   = $1006;
  6595.   pmerr_Window_Not_Locked       = $1007;
  6596.   pmerr_Invalid_Selector        = $1008;
  6597.   pmerr_Call_From_Wrong_Thread  = $1009;
  6598.   pmerr_Resource_Not_Found      = $100A;
  6599.   pmerr_Invalid_String_Parm     = $100B;
  6600.   pmerr_Invalid_HHeap           = $100C;
  6601.   pmerr_Invalid_Heap_Pointer    = $100D;
  6602.   pmerr_Invalid_Heap_Size_Parm  = $100E;
  6603.   pmerr_Invalid_Heap_Size       = $100F;
  6604.   pmerr_Invalid_Heap_Size_Word  = $1010;
  6605.   pmerr_Heap_Out_Of_Memory      = $1011;
  6606.   pmerr_Heap_Max_Size_Reached   = $1012;
  6607.   pmerr_Invalid_HAtomTbl        = $1013;
  6608.   pmerr_Invalid_Atom            = $1014;
  6609.   pmerr_Invalid_Atom_Name       = $1015;
  6610.   pmerr_Invalid_Integer_Atom    = $1016;
  6611.   pmerr_Atom_Name_Not_Found     = $1017;
  6612.   pmerr_Queue_Too_Large         = $1018;
  6613.   pmerr_Invalid_Flag            = $1019;
  6614.   pmerr_Invalid_HAccel          = $101A;
  6615.   pmerr_Invalid_HPtr            = $101B;
  6616.   pmerr_Invalid_HEnum           = $101C;
  6617.   pmerr_Invalid_Src_CodePage    = $101D;
  6618.   pmerr_Invalid_Dst_CodePage    = $101E;
  6619.  
  6620. { These are not real error codes, but just used to access special  }
  6621. { error message strings used by WinGetErrorInfo to format an error }
  6622. { message.                                                         }
  6623.  
  6624.   pmerr_Unknown_Component_Id    = $101f;
  6625.   pmerr_Unknown_Error_Code      = $1020;
  6626.   pmerr_Severity_Levels         = $1021;
  6627.  
  6628. { $1022 - $1033, $1035, $104B - $104C used elsewhere }
  6629.   pmerr_Invalid_Resource_Format = $1034;
  6630.   pmerr_No_Msg_Queue            = $1036;
  6631.   pmerr_Win_Debugmsg            = $1037;
  6632.   pmerr_Queue_Full              = $1038;
  6633.  
  6634.   pmerr_Library_Load_Failed     = $1039;
  6635.   pmerr_Procedure_Load_Failed   = $103A;
  6636.   pmerr_Library_Delete_Failed   = $103B;
  6637.   pmerr_Procedure_Delete_Failed = $103C;
  6638.   pmerr_Array_Too_Large         = $103D;
  6639.   pmerr_Array_Too_Small         = $103E;
  6640.   pmerr_Datatype_Entry_Bad_Index = $103F;
  6641.   pmerr_Datatype_Entry_Ctl_Bad  = $1040;
  6642.   pmerr_Datatype_Entry_Ctl_Miss = $1041;
  6643.   pmerr_Datatype_Entry_Invalid  = $1042;
  6644.   pmerr_Datatype_Entry_Not_Num  = $1043;
  6645.   pmerr_Datatype_Entry_Not_Off  = $1044;
  6646.   pmerr_Datatype_Invalid        = $1045;
  6647.   pmerr_Datatype_Not_Unique     = $1046;
  6648.   pmerr_Datatype_Too_Long       = $1047;
  6649.   pmerr_Datatype_Too_Small      = $1048;
  6650.   pmerr_Direction_Invalid       = $1049;
  6651.   pmerr_Invalid_Hab             = $104A;
  6652.   pmerr_Invalid_Hstruct         = $104D;
  6653.   pmerr_Length_Too_Small        = $104E;
  6654.   pmerr_Msgid_Too_Small         = $104F;
  6655.   pmerr_No_Handle_Alloc         = $1050;
  6656.   pmerr_Not_In_A_Pm_Session     = $1051;
  6657.   pmerr_Msg_Queue_Already_Exists = $1052;
  6658.   pmerr_Old_Resource            = $1055;
  6659.  
  6660. { Window Manager error codes }
  6661.   pmerr_Invalid_Pib             = $1101;
  6662.   pmerr_Insuff_Space_To_Add     = $1102;
  6663.   pmerr_Invalid_Group_Handle    = $1103;
  6664.   pmerr_Duplicate_Title         = $1104;
  6665.   pmerr_Invalid_Title           = $1105;
  6666.   pmerr_Handle_Not_In_Group     = $1107;
  6667.   pmerr_Invalid_Target_Handle   = $1106;
  6668.   pmerr_Invalid_Path_Statement  = $1108;
  6669.   pmerr_No_Program_Found        = $1109;
  6670.   pmerr_Invalid_Buffer_Size     = $110A;
  6671.   pmerr_Buffer_Too_Small        = $110B;
  6672.   pmerr_Pl_Initialisation_Fail  = $110C;
  6673.   pmerr_Cant_Destroy_Sys_Group  = $110D;
  6674.   pmerr_Invalid_Type_Change     = $110E;
  6675.   pmerr_Invalid_Program_Handle  = $110F;
  6676.  
  6677.   pmerr_Not_Current_Pl_Version  = $1110;
  6678.   pmerr_Invalid_Circular_Ref    = $1111;
  6679.   pmerr_Memory_Allocation_Err   = $1112;
  6680.   pmerr_Memory_Deallocation_Err = $1113;
  6681.   pmerr_Task_Header_Too_Big     = $1114;
  6682.  
  6683.   pmerr_Invalid_Ini_File_Handle = $1115;
  6684.   pmerr_Memory_Share            = $1116;
  6685.   pmerr_Open_Queue              = $1117;
  6686.   pmerr_Create_Queue            = $1118;
  6687.   pmerr_Write_Queue             = $1119;
  6688.   pmerr_Read_Queue              = $111A;
  6689.   pmerr_Call_Not_Executed       = $111B;
  6690.   pmerr_Unknown_Apipkt          = $111C;
  6691.   pmerr_Inithread_Exists        = $111D;
  6692.   pmerr_Create_Thread           = $111E;
  6693.   pmerr_No_Hk_Profile_Installed = $111F;
  6694.   pmerr_Invalid_Directory       = $1120;
  6695.   pmerr_Wildcard_In_Filename    = $1121;
  6696.   pmerr_Filename_Buffer_Full    = $1122;
  6697.   pmerr_Filename_Too_Long       = $1123;
  6698.   pmerr_Ini_File_Is_Sys_Or_User = $1124;
  6699.   pmerr_Broadcast_Plmsg         = $1125;
  6700.   pmerr_190_Init_Done           = $1126;
  6701.   pmerr_Hmod_For_Pmshapi        = $1127;
  6702.   pmerr_Set_Hk_Profile          = $1128;
  6703.   pmerr_Api_Not_Allowed         = $1129;
  6704.   pmerr_Ini_Still_Open          = $112A;
  6705.  
  6706.   pmerr_Progdetails_Not_In_Ini  = $112B;
  6707.   pmerr_Pibstruct_Not_In_Ini    = $112C;
  6708.   pmerr_Invalid_Diskprogdetails = $112D;
  6709.   pmerr_Progdetails_Read_Failure  = $112E;
  6710.   pmerr_Progdetails_Write_Failure = $112F;
  6711.   pmerr_Progdetails_Qsize_Failure = $1130;
  6712.   pmerr_Invalid_Progdetails     = $1131;
  6713.   pmerr_Sheprofilehook_Not_Found = $1132;
  6714.   pmerr_190plconverted          = $1133;
  6715.   pmerr_Failed_To_Convert_Ini_Pl = $1134;
  6716.   pmerr_Pmshapi_Not_Initialised = $1135;
  6717.   pmerr_Invalid_Shell_Api_Hook_Id = $1136;
  6718.  
  6719.   pmerr_Dos_Error               = $1200;
  6720.  
  6721.   pmerr_No_Space                = $1201;
  6722.   pmerr_Invalid_Switch_Handle   = $1202;
  6723.   pmerr_No_Handle               = $1203;
  6724.   pmerr_Invalid_Process_Id      = $1204;
  6725.   pmerr_Not_Shell               = $1205;
  6726.   pmerr_Invalid_Window          = $1206;
  6727.   pmerr_Invalid_Post_Msg        = $1207;
  6728.   pmerr_Invalid_Parameters      = $1208;
  6729.   pmerr_Invalid_Program_Type    = $1209;
  6730.   pmerr_Not_Extended_Focus      = $120A;
  6731.   pmerr_Invalid_Session_Id      = $120B;
  6732.   pmerr_Smg_Invalid_Icon_File   = $120C;
  6733.   pmerr_Smg_Icon_Not_Created    = $120D;
  6734.   pmerr_Shl_Debug               = $120E;
  6735.  
  6736.   pmerr_Opening_Ini_File        = $1301;
  6737.   pmerr_Ini_File_Corrupt        = $1302;
  6738.   pmerr_Invalid_Parm            = $1303;
  6739.   pmerr_Not_In_Idx              = $1304;
  6740.   pmerr_No_Entries_In_Group     = $1305;
  6741.  
  6742.   pmerr_Ini_Write_Fail          = $1306;
  6743.   pmerr_Idx_Full                = $1307;
  6744.   pmerr_Ini_Protected           = $1308;
  6745.   pmerr_Memory_Alloc            = $1309;
  6746.   pmerr_Ini_Init_Already_Done   = $130A;
  6747.   pmerr_Invalid_Integer         = $130B;
  6748.   pmerr_Invalid_Asciiz          = $130C;
  6749.   pmerr_Can_Not_Call_Spooler    = $130D;
  6750.   pmerr_Validation_Rejected     = pmerr_Can_Not_Call_Spooler;
  6751.  
  6752.   pmerr_Warning_Window_Not_Killed = $1401;
  6753.   pmerr_Error_Invalid_Window    = $1402;
  6754.   pmerr_Already_Initialized     = $1403;
  6755.   pmerr_Msg_Prog_No_Mou         = $1405;
  6756.   pmerr_Msg_Prog_Non_Recov      = $1406;
  6757.   pmerr_Winconv_Invalid_Path    = $1407;
  6758.   pmerr_Pi_Not_Initialised      = $1408;
  6759.   pmerr_Pl_Not_Initialised      = $1409;
  6760.   pmerr_No_Task_Manager         = $140A;
  6761.   pmerr_Save_Not_In_Progress    = $140B;
  6762.   pmerr_No_Stack_Space          = $140C;
  6763.   pmerr_Invalid_Colr_Field      = $140d;
  6764.   pmerr_Invalid_Colr_Value      = $140e;
  6765.   pmerr_Colr_Write              = $140f;
  6766.  
  6767.   pmerr_Target_File_Exists      = $1501;
  6768.   pmerr_Source_Same_As_Target   = $1502;
  6769.   pmerr_Source_File_Not_Found   = $1503;
  6770.   pmerr_Invalid_New_Path        = $1504;
  6771.   pmerr_Target_File_Not_Found   = $1505;
  6772.   pmerr_Invalid_Drive_Number    = $1506;
  6773.   pmerr_Name_Too_Long           = $1507;
  6774.   pmerr_Not_Enough_Room_On_Disk = $1508;
  6775.   pmerr_Not_Enough_Mem          = $1509;
  6776.  
  6777.   pmerr_Log_Drv_Does_Not_Exist  = $150B;
  6778.   pmerr_Invalid_Drive           = $150C;
  6779.   pmerr_Access_Denied           = $150D;
  6780.   pmerr_No_First_Slash          = $150E;
  6781.   pmerr_Read_Only_File          = $150F;
  6782.   pmerr_Group_Protected         = $151F;
  6783.   pmerr_Invalid_Program_Category = $152F;
  6784.   pmerr_Invalid_Appl            = $1530;
  6785.   pmerr_Cannot_Start            = $1531;
  6786.   pmerr_Started_In_Background   = $1532;
  6787.   pmerr_Invalid_Happ            = $1533;
  6788.   pmerr_Cannot_Stop             = $1534;
  6789.  
  6790. { Errors generated by Language Bindings layer    }
  6791. { (Range $1600 thru $16FF reserved for Bindings) }
  6792. { severity_Unrecoverable }
  6793.   pmerr_Internal_Error_1        = $1601;
  6794.   pmerr_Internal_Error_2        = $1602;
  6795.   pmerr_Internal_Error_3        = $1603;
  6796.   pmerr_Internal_Error_4        = $1604;
  6797.   pmerr_Internal_Error_5        = $1605;
  6798.   pmerr_Internal_Error_6        = $1606;
  6799.   pmerr_Internal_Error_7        = $1607;
  6800.   pmerr_Internal_Error_8        = $1608;
  6801.   pmerr_Internal_Error_9        = $1609;
  6802.   pmerr_Internal_Error_10       = $160A;
  6803.   pmerr_Internal_Error_11       = $160B;
  6804.   pmerr_Internal_Error_12       = $160C;
  6805.   pmerr_Internal_Error_13       = $160D;
  6806.   pmerr_Internal_Error_14       = $160E;
  6807.   pmerr_Internal_Error_15       = $160F;
  6808.   pmerr_Internal_Error_16       = $1610;
  6809.   pmerr_Internal_Error_17       = $1611;
  6810.   pmerr_Internal_Error_18       = $1612;
  6811.   pmerr_Internal_Error_19       = $1613;
  6812.   pmerr_Internal_Error_20       = $1614;
  6813.   pmerr_Internal_Error_21       = $1615;
  6814.   pmerr_Internal_Error_22       = $1616;
  6815.   pmerr_Internal_Error_23       = $1617;
  6816.   pmerr_Internal_Error_24       = $1618;
  6817.   pmerr_Internal_Error_25       = $1619;
  6818.   pmerr_Internal_Error_26       = $161A;
  6819.   pmerr_Internal_Error_27       = $161B;
  6820.   pmerr_Internal_Error_28       = $161C;
  6821.   pmerr_Internal_Error_29       = $161D;
  6822.  
  6823. { severity_Warning }
  6824.   pmerr_Invalid_Free_Message_Id = $1630;
  6825.  
  6826. { severity_Error }
  6827.  
  6828.   pmerr_Function_Not_Supported  = $1641;
  6829.   pmerr_Invalid_Array_Count     = $1642;
  6830.   pmerr_Invalid_Length          = $1643;
  6831.   pmerr_Invalid_Bundle_Type     = $1644;
  6832.   pmerr_Invalid_Parameter       = $1645;
  6833.   pmerr_Invalid_Number_Of_Parms = $1646;
  6834.   pmerr_Greater_Than_64k        = $1647;
  6835.   pmerr_Invalid_Parameter_Type  = $1648;
  6836.   pmerr_Negative_Strcond_Dim    = $1649;
  6837.   pmerr_Invalid_Number_Of_Types = $164A;
  6838.   pmerr_Incorrect_Hstruct       = $164B;
  6839.   pmerr_Invalid_Array_Size      = $164C;
  6840.   pmerr_Invalid_Control_Datatype = $164D;
  6841.   pmerr_Incomplete_Control_Sequ = $164E;
  6842.   pmerr_Invalid_Datatype        = $164F;
  6843.   pmerr_Incorrect_Datatype      = $1650;
  6844.   pmerr_Not_Self_Describing_Dtyp = $1651;
  6845.   pmerr_Invalid_Ctrl_Seq_Index  = $1652;
  6846.   pmerr_Invalid_Type_For_Length = $1653;
  6847.   pmerr_Invalid_Type_For_Offset = $1654;
  6848.   pmerr_Invalid_Type_For_Mparam = $1655;
  6849.   pmerr_Invalid_Message_Id      = $1656;
  6850.   pmerr_C_Length_Too_Small      = $1657;
  6851.   pmerr_Appl_Structure_Too_Small = $1658;
  6852.   pmerr_Invalid_Errorinfo_Handle = $1659;
  6853.   pmerr_Invalid_Character_Index = $165A;
  6854.  
  6855. { Workplace Shell error codes }
  6856.   wperr_Protected_Class         = $1700;
  6857.   wperr_Invalid_Class           = $1701;
  6858.   wperr_Invalid_Superclass      = $1702;
  6859.   wperr_No_Memory               = $1703;
  6860.   wperr_Semaphore_Error         = $1704;
  6861.   wperr_Buffer_Too_Small        = $1705;
  6862.   wperr_Clsloadmod_Failed       = $1706;
  6863.   wperr_Clsprocaddr_Failed      = $1707;
  6864.   wperr_Objword_Location        = $1708;
  6865.   wperr_Invalid_Object          = $1709;
  6866.   wperr_Memory_Cleanup          = $170A;
  6867.   wperr_Invalid_Module          = $170B;
  6868.   wperr_Invalid_Oldclass        = $170C;
  6869.   wperr_Invalid_Newclass        = $170D;
  6870.   wperr_Not_Immediate_Child     = $170E;
  6871.   wperr_Not_Workplace_Class     = $170F;
  6872.   wperr_Cant_Replace_Metacls    = $1710;
  6873.   wperr_Ini_File_Write          = $1711;
  6874.   wperr_Invalid_Folder          = $1712;
  6875.   wperr_Buffer_Overflow         = $1713;
  6876.   wperr_Object_Not_Found        = $1714;
  6877.   wperr_Invalid_Hfind           = $1715;
  6878.   wperr_Invalid_Count           = $1716;
  6879.   wperr_Invalid_Buffer          = $1717;
  6880.   wperr_Already_Exists          = $1718;
  6881.   wperr_Invalid_Flags           = $1719;
  6882.   wperr_Invalid_Objectid        = $1720;
  6883.  
  6884. { GPI error codes }
  6885.   pmerr_Ok                      = $0000;
  6886.   pmerr_Already_In_Area         = $2001;
  6887.   pmerr_Already_In_Element      = $2002;
  6888.   pmerr_Already_In_Path         = $2003;
  6889.   pmerr_Already_In_Seg          = $2004;
  6890.   pmerr_Area_Incomplete         = $2005;
  6891.   pmerr_Base_Error              = $2006;
  6892.   pmerr_Bitblt_Length_Exceeded  = $2007;
  6893.   pmerr_Bitmap_In_Use           = $2008;
  6894.   pmerr_Bitmap_Is_Selected      = $2009;
  6895.   pmerr_Bitmap_Not_Found        = $200A;
  6896.   pmerr_Bitmap_Not_Selected     = $200B;
  6897.   pmerr_Bounds_Overflow         = $200C;
  6898.   pmerr_Called_Seg_Is_Chained   = $200D;
  6899.   pmerr_Called_Seg_Is_Current   = $200E;
  6900.   pmerr_Called_Seg_Not_Found    = $200F;
  6901.   pmerr_Cannot_Delete_All_Data  = $2010;
  6902.   pmerr_Cannot_Replace_Element_0 = $2011;
  6903.   pmerr_Col_Table_Not_Realizable = $2012;
  6904.   pmerr_Col_Table_Not_Realized  = $2013;
  6905.   pmerr_Coordinate_Overflow     = $2014;
  6906.   pmerr_Corr_Format_Mismatch    = $2015;
  6907.   pmerr_Data_Too_Long           = $2016;
  6908.   pmerr_Dc_Is_Associated        = $2017;
  6909.   pmerr_Desc_String_Truncated   = $2018;
  6910.   pmerr_Device_Driver_Error_1   = $2019;
  6911.   pmerr_Device_Driver_Error_2   = $201A;
  6912.   pmerr_Device_Driver_Error_3   = $201B;
  6913.   pmerr_Device_Driver_Error_4   = $201C;
  6914.   pmerr_Device_Driver_Error_5   = $201D;
  6915.   pmerr_Device_Driver_Error_6   = $201E;
  6916.   pmerr_Device_Driver_Error_7   = $201F;
  6917.   pmerr_Device_Driver_Error_8   = $2020;
  6918.   pmerr_Device_Driver_Error_9   = $2021;
  6919.   pmerr_Device_Driver_Error_10  = $2022;
  6920.   pmerr_Dev_Func_Not_Installed  = $2023;
  6921.   pmerr_Dosopen_Failure         = $2024;
  6922.   pmerr_Dosread_Failure         = $2025;
  6923.   pmerr_Driver_Not_Found        = $2026;
  6924.   pmerr_Dup_Seg                 = $2027;
  6925.   pmerr_Dynamic_Seg_Seq_Error   = $2028;
  6926.   pmerr_Dynamic_Seg_Zero_Inv    = $2029;
  6927.   pmerr_Element_Incomplete      = $202A;
  6928.   pmerr_Esc_Code_Not_Supported  = $202B;
  6929.   pmerr_Exceeds_Max_Seg_Length  = $202C;
  6930.   pmerr_Font_And_Mode_Mismatch  = $202D;
  6931.   pmerr_Font_File_Not_Loaded    = $202E;
  6932.   pmerr_Font_Not_Loaded         = $202F;
  6933.   pmerr_Font_Too_Big            = $2030;
  6934.   pmerr_Hardware_Init_Failure   = $2031;
  6935.   pmerr_Hbitmap_Busy            = $2032;
  6936.   pmerr_Hdc_Busy                = $2033;
  6937.   pmerr_Hrgn_Busy               = $2034;
  6938.   pmerr_Huge_Fonts_Not_Supported = $2035;
  6939.   pmerr_Id_Has_No_Bitmap        = $2036;
  6940.   pmerr_Image_Incomplete        = $2037;
  6941.   pmerr_Incompat_Color_Format   = $2038;
  6942.   pmerr_Incompat_Color_Options  = $2039;
  6943.   pmerr_Incompatible_Bitmap     = $203A;
  6944.   pmerr_Incompatible_Metafile   = $203B;
  6945.   pmerr_Incorrect_Dc_Type       = $203C;
  6946.   pmerr_Insufficient_Disk_Space = $203D;
  6947.   pmerr_Insufficient_Memory     = $203E;
  6948.   pmerr_Inv_Angle_Parm          = $203F;
  6949.   pmerr_Inv_Arc_Control         = $2040;
  6950.   pmerr_Inv_Area_Control        = $2041;
  6951.   pmerr_Inv_Arc_Points          = $2042;
  6952.   pmerr_Inv_Attr_Mode           = $2043;
  6953.   pmerr_Inv_Background_Col_Attr = $2044;
  6954.   pmerr_Inv_Background_Mix_Attr = $2045;
  6955.   pmerr_Inv_Bitblt_Mix          = $2046;
  6956.   pmerr_Inv_Bitblt_Style        = $2047;
  6957.   pmerr_Inv_Bitmap_Dimension    = $2048;
  6958.   pmerr_Inv_Box_Control         = $2049;
  6959.   pmerr_Inv_Box_Rounding_Parm   = $204A;
  6960.   pmerr_Inv_Char_Angle_Attr     = $204B;
  6961.   pmerr_Inv_Char_Direction_Attr = $204C;
  6962.   pmerr_Inv_Char_Mode_Attr      = $204D;
  6963.   pmerr_Inv_Char_Pos_Options    = $204E;
  6964.   pmerr_Inv_Char_Set_Attr       = $204F;
  6965.   pmerr_Inv_Char_Shear_Attr     = $2050;
  6966.   pmerr_Inv_Clip_Path_Options   = $2051;
  6967.   pmerr_Inv_Codepage            = $2052;
  6968.   pmerr_Inv_Color_Attr          = $2053;
  6969.   pmerr_Inv_Color_Data          = $2054;
  6970.   pmerr_Inv_Color_Format        = $2055;
  6971.   pmerr_Inv_Color_Index         = $2056;
  6972.   pmerr_Inv_Color_Options       = $2057;
  6973.   pmerr_Inv_Color_Start_Index   = $2058;
  6974.   pmerr_Inv_Coord_Offset        = $2059;
  6975.   pmerr_Inv_Coord_Space         = $205A;
  6976.   pmerr_Inv_Coordinate          = $205B;
  6977.   pmerr_Inv_Correlate_Depth     = $205C;
  6978.   pmerr_Inv_Correlate_Type      = $205D;
  6979.   pmerr_Inv_Cursor_Bitmap       = $205E;
  6980.   pmerr_Inv_Dc_Data             = $205F;
  6981.   pmerr_Inv_Dc_Type             = $2060;
  6982.   pmerr_Inv_Device_Name         = $2061;
  6983.   pmerr_Inv_Dev_Modes_Options   = $2062;
  6984.   pmerr_Inv_Draw_Control        = $2063;
  6985.   pmerr_Inv_Draw_Value          = $2064;
  6986.   pmerr_Inv_Drawing_Mode        = $2065;
  6987.   pmerr_Inv_Driver_Data         = $2066;
  6988.   pmerr_Inv_Driver_Name         = $2067;
  6989.   pmerr_Inv_Draw_Border_Option  = $2068;
  6990.   pmerr_Inv_Edit_Mode           = $2069;
  6991.   pmerr_Inv_Element_Offset      = $206A;
  6992.   pmerr_Inv_Element_Pointer     = $206B;
  6993.   pmerr_Inv_End_Path_Options    = $206C;
  6994.   pmerr_Inv_Esc_Code            = $206D;
  6995.   pmerr_Inv_Escape_Data         = $206E;
  6996.   pmerr_Inv_Extended_Lcid       = $206F;
  6997.   pmerr_Inv_Fill_Path_Options   = $2070;
  6998.   pmerr_Inv_First_Char          = $2071;
  6999.   pmerr_Inv_Font_Attrs          = $2072;
  7000.   pmerr_Inv_Font_File_Data      = $2073;
  7001.   pmerr_Inv_For_This_Dc_Type    = $2074;
  7002.   pmerr_Inv_Format_Control      = $2075;
  7003.   pmerr_Inv_Forms_Code          = $2076;
  7004.   pmerr_Inv_Fontdef             = $2077;
  7005.   pmerr_Inv_Geom_Line_Width_Attr = $2078;
  7006.   pmerr_Inv_Getdata_Control     = $2079;
  7007.   pmerr_Inv_Graphics_Field      = $207A;
  7008.   pmerr_Inv_Hbitmap             = $207B;
  7009.   pmerr_Inv_Hdc                 = $207C;
  7010.   pmerr_Inv_Hjournal            = $207D;
  7011.   pmerr_Inv_Hmf                 = $207E;
  7012.   pmerr_Inv_Hps                 = $207F;
  7013.   pmerr_Inv_Hrgn                = $2080;
  7014.   pmerr_Inv_Id                  = $2081;
  7015.   pmerr_Inv_Image_Data_Length   = $2082;
  7016.   pmerr_Inv_Image_Dimension     = $2083;
  7017.   pmerr_Inv_Image_Format        = $2084;
  7018.   pmerr_Inv_In_Area             = $2085;
  7019.   pmerr_Inv_In_Called_Seg       = $2086;
  7020.   pmerr_Inv_In_Current_Edit_Mode = $2087;
  7021.   pmerr_Inv_In_Draw_Mode        = $2088;
  7022.   pmerr_Inv_In_Element          = $2089;
  7023.   pmerr_Inv_In_Image            = $208A;
  7024.   pmerr_Inv_In_Path             = $208B;
  7025.   pmerr_Inv_In_Retain_Mode      = $208C;
  7026.   pmerr_Inv_In_Seg              = $208D;
  7027.   pmerr_Inv_In_Vector_Symbol    = $208E;
  7028.   pmerr_Inv_Info_Table          = $208F;
  7029.   pmerr_Inv_Journal_Option      = $2090;
  7030.   pmerr_Inv_Kerning_Flags       = $2091;
  7031.   pmerr_Inv_Length_Or_Count     = $2092;
  7032.   pmerr_Inv_Line_End_Attr       = $2093;
  7033.   pmerr_Inv_Line_Join_Attr      = $2094;
  7034.   pmerr_Inv_Line_Type_Attr      = $2095;
  7035.   pmerr_Inv_Line_Width_Attr     = $2096;
  7036.   pmerr_Inv_Logical_Address     = $2097;
  7037.   pmerr_Inv_Marker_Box_Attr     = $2098;
  7038.   pmerr_Inv_Marker_Set_Attr     = $2099;
  7039.   pmerr_Inv_Marker_Symbol_Attr  = $209A;
  7040.   pmerr_Inv_Matrix_Element      = $209B;
  7041.   pmerr_Inv_Max_Hits            = $209C;
  7042.   pmerr_Inv_Metafile            = $209D;
  7043.   pmerr_Inv_Metafile_Length     = $209E;
  7044.   pmerr_Inv_Metafile_Offset     = $209F;
  7045.   pmerr_Inv_Microps_Draw_Control = $20A0;
  7046.   pmerr_Inv_Microps_Function    = $20A1;
  7047.   pmerr_Inv_Microps_Order       = $20A2;
  7048.   pmerr_Inv_Mix_Attr            = $20A3;
  7049.   pmerr_Inv_Mode_For_Open_Dyn   = $20A4;
  7050.   pmerr_Inv_Mode_For_Reopen_Seg = $20A5;
  7051.   pmerr_Inv_Modify_Path_Mode    = $20A6;
  7052.   pmerr_Inv_Multiplier          = $20A7;
  7053.   pmerr_Inv_Nested_Figures      = $20A8;
  7054.   pmerr_Inv_Or_Incompat_Options = $20A9;
  7055.   pmerr_Inv_Order_Length        = $20AA;
  7056.   pmerr_Inv_Ordering_Parm       = $20AB;
  7057.   pmerr_Inv_Outside_Draw_Mode   = $20AC;
  7058.   pmerr_Inv_Page_Viewport       = $20AD;
  7059.   pmerr_Inv_Path_Id             = $20AE;
  7060.   pmerr_Inv_Path_Mode           = $20AF;
  7061.   pmerr_Inv_Pattern_Attr        = $20B0;
  7062.   pmerr_Inv_Pattern_Ref_Pt_Attr = $20B1;
  7063.   pmerr_Inv_Pattern_Set_Attr    = $20B2;
  7064.   pmerr_Inv_Pattern_Set_Font    = $20B3;
  7065.   pmerr_Inv_Pick_Aperture_Option = $20B4;
  7066.   pmerr_Inv_Pick_Aperture_Posn  = $20B5;
  7067.   pmerr_Inv_Pick_Aperture_Size  = $20B6;
  7068.   pmerr_Inv_Pick_Number         = $20B7;
  7069.   pmerr_Inv_Play_Metafile_Option = $20B8;
  7070.   pmerr_Inv_Primitive_Type      = $20B9;
  7071.   pmerr_Inv_Ps_Size             = $20BA;
  7072.   pmerr_Inv_Putdata_Format      = $20BB;
  7073.   pmerr_Inv_Query_Element_No    = $20BC;
  7074.   pmerr_Inv_Rect                = $20BD;
  7075.   pmerr_Inv_Region_Control      = $20BE;
  7076.   pmerr_Inv_Region_Mix_Mode     = $20BF;
  7077.   pmerr_Inv_Replace_Mode_Func   = $20C0;
  7078.   pmerr_Inv_Reserved_Field      = $20C1;
  7079.   pmerr_Inv_Reset_Options       = $20C2;
  7080.   pmerr_Inv_Rgbcolor            = $20C3;
  7081.   pmerr_Inv_Scan_Start          = $20C4;
  7082.   pmerr_Inv_Seg_Attr            = $20C5;
  7083.   pmerr_Inv_Seg_Attr_Value      = $20C6;
  7084.   pmerr_Inv_Seg_Ch_Length       = $20C7;
  7085.   pmerr_Inv_Seg_Name            = $20C8;
  7086.   pmerr_Inv_Seg_Offset          = $20C9;
  7087.   pmerr_Inv_Setid               = $20CA;
  7088.   pmerr_Inv_Setid_Type          = $20CB;
  7089.   pmerr_Inv_Set_Viewport_Option = $20CC;
  7090.   pmerr_Inv_Sharpness_Parm      = $20CD;
  7091.   pmerr_Inv_Source_Offset       = $20CE;
  7092.   pmerr_Inv_Stop_Draw_Value     = $20CF;
  7093.   pmerr_Inv_Transform_Type      = $20D0;
  7094.   pmerr_Inv_Usage_Parm          = $20D1;
  7095.   pmerr_Inv_Viewing_Limits      = $20D2;
  7096.   pmerr_Jfile_Busy              = $20D3;
  7097.   pmerr_Jnl_Func_Data_Too_Long  = $20D4;
  7098.   pmerr_Kerning_Not_Supported   = $20D5;
  7099.   pmerr_Label_Not_Found         = $20D6;
  7100.   pmerr_Matrix_Overflow         = $20D7;
  7101.   pmerr_Metafile_Internal_Error = $20D8;
  7102.   pmerr_Metafile_In_Use         = $20D9;
  7103.   pmerr_Metafile_Limit_Exceeded = $20DA;
  7104.   pmerr_Name_Stack_Full         = $20DB;
  7105.   pmerr_Not_Created_By_Devopendc = $20DC;
  7106.   pmerr_Not_In_Area             = $20DD;
  7107.   pmerr_Not_In_Draw_Mode        = $20DE;
  7108.   pmerr_Not_In_Element          = $20DF;
  7109.   pmerr_Not_In_Image            = $20E0;
  7110.   pmerr_Not_In_Path             = $20E1;
  7111.   pmerr_Not_In_Retain_Mode      = $20E2;
  7112.   pmerr_Not_In_Seg              = $20E3;
  7113.   pmerr_No_Bitmap_Selected      = $20E4;
  7114.   pmerr_No_Current_Element      = $20E5;
  7115.   pmerr_No_Current_Seg          = $20E6;
  7116.   pmerr_No_Metafile_Record_Handle = $20E7;
  7117.   pmerr_Order_Too_Big           = $20E8;
  7118.   pmerr_Other_Set_Id_Refs       = $20E9;
  7119.   pmerr_Overran_Seg             = $20EA;
  7120.   pmerr_Own_Set_Id_Refs         = $20EB;
  7121.   pmerr_Path_Incomplete         = $20EC;
  7122.   pmerr_Path_Limit_Exceeded     = $20ED;
  7123.   pmerr_Path_Unknown            = $20EE;
  7124.   pmerr_Pel_Is_Clipped          = $20EF;
  7125.   pmerr_Pel_Not_Available       = $20F0;
  7126.   pmerr_Primitive_Stack_Empty   = $20F1;
  7127.   pmerr_Prolog_Error            = $20F2;
  7128.   pmerr_Prolog_Seg_Attr_Not_Set = $20F3;
  7129.   pmerr_Ps_Busy                 = $20F4;
  7130.   pmerr_Ps_Is_Associated        = $20F5;
  7131.   pmerr_Ram_Jnl_File_Too_Small  = $20F6;
  7132.   pmerr_Realize_Not_Supported   = $20F7;
  7133.   pmerr_Region_Is_Clip_Region   = $20F8;
  7134.   pmerr_Resource_Depletion      = $20F9;
  7135.   pmerr_Seg_And_Refseg_Are_Same = $20FA;
  7136.   pmerr_Seg_Call_Recursive      = $20FB;
  7137.   pmerr_Seg_Call_Stack_Empty    = $20FC;
  7138.   pmerr_Seg_Call_Stack_Full     = $20FD;
  7139.   pmerr_Seg_Is_Current          = $20FE;
  7140.   pmerr_Seg_Not_Chained         = $20FF;
  7141.   pmerr_Seg_Not_Found           = $2100;
  7142.   pmerr_Seg_Store_Limit_Exceeded = $2101;
  7143.   pmerr_Setid_In_Use            = $2102;
  7144.   pmerr_Setid_Not_Found         = $2103;
  7145.   pmerr_Startdoc_Not_Issued     = $2104;
  7146.   pmerr_Stop_Draw_Occurred      = $2105;
  7147.   pmerr_Too_Many_Metafiles_In_Use = $2106;
  7148.   pmerr_Truncated_Order         = $2107;
  7149.   pmerr_Unchained_Seg_Zero_Inv  = $2108;
  7150.   pmerr_Unsupported_Attr        = $2109;
  7151.   pmerr_Unsupported_Attr_Value  = $210A;
  7152.   pmerr_Enddoc_Not_Issued       = $210B;
  7153.   pmerr_Ps_Not_Associated       = $210C;
  7154.   pmerr_Inv_Flood_Fill_Options  = $210D;
  7155.   pmerr_Inv_Facename            = $210E;
  7156.   pmerr_Palette_Selected        = $210F;
  7157.   pmerr_No_Palette_Selected     = $2110;
  7158.   pmerr_Inv_Hpal                = $2111;
  7159.   pmerr_Palette_Busy            = $2112;
  7160.   pmerr_Start_Point_Clipped     = $2113;
  7161.   pmerr_No_Fill                 = $2114;
  7162.   pmerr_Inv_Facenamedesc        = $2115;
  7163.   pmerr_Inv_Bitmap_Data         = $2116;
  7164.   pmerr_Inv_Char_Align_Attr     = $2117;
  7165.   pmerr_Inv_Hfont               = $2118;
  7166.   pmerr_Hfont_Is_Selected       = $2119;
  7167.  
  7168. { Device Manager error codes }
  7169. { None yet }
  7170.  
  7171. { Spooler error codes }
  7172.   pmerr_Spl_Driver_Error        = $4001;
  7173.   pmerr_Spl_Device_Error        = $4002;
  7174.   pmerr_Spl_Device_Not_Installed = $4003;
  7175.   pmerr_Spl_Queue_Error         = $4004;
  7176.   pmerr_Spl_Inv_Hspl            = $4005;
  7177.   pmerr_Spl_No_Disk_Space       = $4006;
  7178.   pmerr_Spl_No_Memory           = $4007;
  7179.   pmerr_Spl_Print_Abort         = $4008;
  7180.   pmerr_Spl_Spooler_Not_Installed = $4009;
  7181.   pmerr_Spl_Inv_Forms_Code      = $400A;
  7182.   pmerr_Spl_Inv_Priority        = $400B;
  7183.   pmerr_Spl_No_Free_Job_Id      = $400C;
  7184.   pmerr_Spl_No_Data             = $400D;
  7185.   pmerr_Spl_Inv_Token           = $400E;
  7186.   pmerr_Spl_Inv_Datatype        = $400F;
  7187.   pmerr_Spl_Processor_Error     = $4010;
  7188.   pmerr_Spl_Inv_Job_Id          = $4011;
  7189.   pmerr_Spl_Job_Not_Printing    = $4012;
  7190.   pmerr_Spl_Job_Printing        = $4013;
  7191.   pmerr_Spl_Queue_Already_Exists = $4014;
  7192.   pmerr_Spl_Inv_Queue_Name      = $4015;
  7193.   pmerr_Spl_Queue_Not_Empty     = $4016;
  7194.   pmerr_Spl_Device_Already_Exists = $4017;
  7195.   pmerr_Spl_Device_Limit_Reached  = $4018;
  7196.   pmerr_Spl_Status_String_Trunc = $4019;
  7197.   pmerr_Spl_Inv_Length_Or_Count = $401A;
  7198.   pmerr_Spl_File_Not_Found      = $401B;
  7199.   pmerr_Spl_Cannot_Open_File    = $401C;
  7200.   pmerr_Spl_Driver_Not_Installed  = $401D;
  7201.   pmerr_Spl_Inv_Processor_Dattype = $401E;
  7202.   pmerr_Spl_Inv_Driver_Datatype = $401F;
  7203.   pmerr_Spl_Processor_Not_Inst  = $4020;
  7204.   pmerr_Spl_No_Such_Log_Address = $4021;
  7205.   pmerr_Spl_Printer_Not_Found   = $4022;
  7206.   pmerr_Spl_Dd_Not_Found        = $4023;
  7207.   pmerr_Spl_Queue_Not_Found     = $4024;
  7208.   pmerr_Spl_Many_Queues_Assoc   = $4025;
  7209.   pmerr_Spl_No_Queues_Associated = $4026;
  7210.   pmerr_Spl_Ini_File_Error      = $4027;
  7211.   pmerr_Spl_No_Default_Queue    = $4028;
  7212.   pmerr_Spl_No_Current_Forms_Code = $4029;
  7213.   pmerr_Spl_Not_Authorised      = $402A;
  7214.   pmerr_Spl_Temp_Network_Error  = $402B;
  7215.   pmerr_Spl_Hard_Network_Error  = $402C;
  7216.   pmerr_Del_Not_Allowed         = $402D;
  7217.   pmerr_Cannot_Del_Qp_Ref       = $402E;
  7218.   pmerr_Cannot_Del_Qname_Ref    = $402F;
  7219.   pmerr_Cannot_Del_Printer_Dd_Ref = $4030;
  7220.   pmerr_Cannot_Del_Prn_Name_Ref = $4031;
  7221.   pmerr_Cannot_Del_Prn_Addr_Ref = $4032;
  7222.   pmerr_Spooler_Qp_Not_Defined  = $4033;
  7223.   pmerr_Prn_Name_Not_Defined    = $4034;
  7224.   pmerr_Prn_Addr_Not_Defined    = $4035;
  7225.   pmerr_Printer_Dd_Not_Defined  = $4036;
  7226.   pmerr_Printer_Queue_Not_Defined = $4037;
  7227.   pmerr_Prn_Addr_In_Use         = $4038;
  7228.   pmerr_Spl_Too_Many_Open_Files = $4039;
  7229.   pmerr_Spl_Cp_Not_Reqd         = $403A;
  7230.   pmerr_Unable_To_Close_Device  = $4040;
  7231.  
  7232.   pmerr_Spl_Error_1             = splerr_Base + 4001;
  7233.   pmerr_Spl_Error_2             = splerr_Base + 4002;
  7234.   pmerr_Spl_Error_3             = splerr_Base + 4003;
  7235.   pmerr_Spl_Error_4             = splerr_Base + 4004;
  7236.   pmerr_Spl_Error_5             = splerr_Base + 4005;
  7237.   pmerr_Spl_Error_6             = splerr_Base + 4006;
  7238.   pmerr_Spl_Error_7             = splerr_Base + 4007;
  7239.   pmerr_Spl_Error_8             = splerr_Base + 4008;
  7240.   pmerr_Spl_Error_9             = splerr_Base + 4009;
  7241.   pmerr_Spl_Error_10            = splerr_Base + 4010;
  7242.   pmerr_Spl_Error_11            = splerr_Base + 4011;
  7243.   pmerr_Spl_Error_12            = splerr_Base + 4012;
  7244.   pmerr_Spl_Error_13            = splerr_Base + 4013;
  7245.   pmerr_Spl_Error_14            = splerr_Base + 4014;
  7246.   pmerr_Spl_Error_15            = splerr_Base + 4015;
  7247.   pmerr_Spl_Error_16            = splerr_Base + 4016;
  7248.   pmerr_Spl_Error_17            = splerr_Base + 4017;
  7249.   pmerr_Spl_Error_18            = splerr_Base + 4018;
  7250.   pmerr_Spl_Error_19            = splerr_Base + 4019;
  7251.   pmerr_Spl_Error_20            = splerr_Base + 4020;
  7252.   pmerr_Spl_Error_21            = splerr_Base + 4021;
  7253.   pmerr_Spl_Error_22            = splerr_Base + 4022;
  7254.   pmerr_Spl_Error_23            = splerr_Base + 4023;
  7255.   pmerr_Spl_Error_24            = splerr_Base + 4024;
  7256.   pmerr_Spl_Error_25            = splerr_Base + 4025;
  7257.   pmerr_Spl_Error_26            = splerr_Base + 4026;
  7258.   pmerr_Spl_Error_27            = splerr_Base + 4027;
  7259.   pmerr_Spl_Error_28            = splerr_Base + 4028;
  7260.   pmerr_Spl_Error_29            = splerr_Base + 4029;
  7261.   pmerr_Spl_Error_30            = splerr_Base + 4030;
  7262.   pmerr_Spl_Error_31            = splerr_Base + 4031;
  7263.   pmerr_Spl_Error_32            = splerr_Base + 4032;
  7264.   pmerr_Spl_Error_33            = splerr_Base + 4033;
  7265.   pmerr_Spl_Error_34            = splerr_Base + 4034;
  7266.   pmerr_Spl_Error_35            = splerr_Base + 4035;
  7267.   pmerr_Spl_Error_36            = splerr_Base + 4036;
  7268.   pmerr_Spl_Error_37            = splerr_Base + 4037;
  7269.   pmerr_Spl_Error_38            = splerr_Base + 4038;
  7270.   pmerr_Spl_Error_39            = splerr_Base + 4039;
  7271.   pmerr_Spl_Error_40            = splerr_Base + 4040;
  7272.  
  7273.   pmerr_SplMsgBox_Info_caption          = splerr_Base + 4041;
  7274.   pmerr_SplMsgBox_Warning_caption       = splerr_Base + 4042;
  7275.   pmerr_SplMsgBox_Error_caption         = splerr_Base + 4043;
  7276.   pmerr_SplMsgBox_Severe_caption        = splerr_Base + 4044;
  7277.  
  7278.   pmerr_SplMsgBox_Job_details           = splerr_Base + 4045;
  7279.  
  7280.   pmerr_SplMsgBox_Error_action          = splerr_Base + 4046;
  7281.   pmerr_SplMsgBox_Severe_action         = splerr_Base + 4047;
  7282.  
  7283.   pmerr_SplMsgBox_Bit_0_Text            = splerr_Base + 4048;
  7284.   pmerr_SplMsgBox_Bit_1_Text            = splerr_Base + 4049;
  7285.   pmerr_SplMsgBox_Bit_2_Text            = splerr_Base + 4050;
  7286.   pmerr_SplMsgBox_Bit_3_Text            = splerr_Base + 4051;
  7287.   pmerr_SplMsgBox_Bit_4_Text            = splerr_Base + 4052;
  7288.   pmerr_SplMsgBox_Bit_5_Text            = splerr_Base + 4053;
  7289.   pmerr_SplMsgBox_Bit_15_Text           = splerr_Base + 4054;
  7290.   pmerr_Spl_NoPathBuffer                = splerr_Base + 4055;
  7291.  
  7292.   pmerr_Spl_Already_Initialised         = splerr_Base + 4093;
  7293.   pmerr_Spl_Error                       = splerr_Base + 4095;
  7294.  
  7295. { Picture utilities error codes }
  7296.   pmerr_Inv_Type                = $5001;
  7297.   pmerr_Inv_Conv                = $5002;
  7298.   pmerr_Inv_SegLen              = $5003;
  7299.   pmerr_Dup_SegName             = $5004;
  7300.   pmerr_Inv_XForm               = $5005;
  7301.   pmerr_Inv_ViewLim             = $5006;
  7302.   pmerr_Inv_3dcoord             = $5007;
  7303.   pmerr_Smb_Ovflow              = $5008;
  7304.   pmerr_Seg_Ovflow              = $5009;
  7305.   pmerr_Pic_Dup_FileName        = $5010;
  7306.  
  7307. { Numbers from $5100 to $5FFF are reserved }
  7308.  
  7309. implementation
  7310.  
  7311. function DdfBeginList;                   external;
  7312. function DdfBitmap;                      external;
  7313. function DdfEndList;                     external;
  7314. function DdfHyperText;                   external;
  7315. function DdfInform;                      external;
  7316. function DdfInitialize;                  external;
  7317. function DdfListItem;                    external;
  7318. function DdfMetafile;                    external;
  7319. function DdfPara;                        external;
  7320. function DdfSetColor;                    external;
  7321. function DdfSetFont;                     external;
  7322. function DdfSetFontStyle;                external;
  7323. function DdfSetFormat;                   external;
  7324. function DdfSetTextAlign;                external;
  7325. function DdfText;                        external;
  7326. function DevCloseDC;                     external;
  7327. function DevEscape;                      external;
  7328. function DevOpenDC;                      external;
  7329. function DevPostDeviceModes;             external;
  7330. function DevQueryCaps;                   external;
  7331. function DevQueryDeviceNames;            external;
  7332. function DevQueryHardcopyCaps;           external;
  7333. function DrgAcceptDroppedFiles;          external;
  7334. function DrgAccessDraginfo;              external;
  7335. function DrgAddStrHandle;                external;
  7336. function DrgAllocDraginfo;               external;
  7337. function DrgAllocDragtransfer;           external;
  7338. function DrgDeleteDraginfoStrHandles;    external;
  7339. function DrgDeleteStrHandle;             external;
  7340. function DrgDrag;                        external;
  7341. function DrgDragFiles;                   external;
  7342. function DrgFreeDraginfo;                external;
  7343. function DrgFreeDragtransfer;            external;
  7344. function DrgGetPS;                       external;
  7345. function DrgPostTransferMsg;             external;
  7346. function DrgPushDraginfo;                external;
  7347. function DrgQueryDragitem;               external;
  7348. function DrgQueryDragitemCount;          external;
  7349. function DrgQueryDragitemPtr;            external;
  7350. function DrgQueryNativeRMF;              external;
  7351. function DrgQueryNativeRMFLen;           external;
  7352. function DrgQueryStrName;                external;
  7353. function DrgQueryStrNameLen;             external;
  7354. function DrgQueryTrueType;               external;
  7355. function DrgQueryTrueTypeLen;            external;
  7356. function DrgReleasePS;                   external;
  7357. function DrgSendTransferMsg;             external;
  7358. function DrgSetDragImage;                external;
  7359. function DrgSetDragPointer;              external;
  7360. function DrgSetDragitem;                 external;
  7361. function DrgVerifyNativeRMF;             external;
  7362. function DrgVerifyRMF;                   external;
  7363. function DrgVerifyTrueType;              external;
  7364. function DrgVerifyType;                  external;
  7365. function DrgVerifyTypeSet;               external;
  7366. function GpiAnimatePalette;              external;
  7367. function GpiAssociate;                   external;
  7368. function GpiBeginArea;                   external;
  7369. function GpiBeginElement;                external;
  7370. function GpiBeginPath;                   external;
  7371. function GpiBitBlt;                      external;
  7372. function GpiBox;                         external;
  7373. function GpiCallSegmentMatrix;           external;
  7374. function GpiCharString;                  external;
  7375. function GpiCharStringAt;                external;
  7376. function GpiCharStringPos;               external;
  7377. function GpiCharStringPosAt;             external;
  7378. function GpiCloseFigure;                 external;
  7379. function GpiCloseSegment;                external;
  7380. function GpiCombineRegion;               external;
  7381. function GpiComment;                     external;
  7382. function GpiConvert;                     external;
  7383. function GpiConvertWithMatrix;           external;
  7384. function GpiCopyMetaFile;                external;
  7385. function GpiCorrelateChain;              external;
  7386. function GpiCorrelateFrom;               external;
  7387. function GpiCorrelateSegment;            external;
  7388. function GpiCreateBitmap;                external;
  7389. function GpiCreateLogColorTable;         external;
  7390. function GpiCreateLogFont;               external;
  7391. function GpiCreatePS;                    external;
  7392. function GpiCreatePalette;               external;
  7393. function GpiCreateRegion;                external;
  7394. function GpiDeleteBitmap;                external;
  7395. function GpiDeleteElement;               external;
  7396. function GpiDeleteElementRange;          external;
  7397. function GpiDeleteElementsBetweenLabels; external;
  7398. function GpiDeleteMetaFile;              external;
  7399. function GpiDeletePalette;               external;
  7400. function GpiDeleteSegment;               external;
  7401. function GpiDeleteSegments;              external;
  7402. function GpiDeleteSetId;                 external;
  7403. function GpiDestroyPS;                   external;
  7404. function GpiDestroyRegion;               external;
  7405. function GpiDrawBits;                    external;
  7406. function GpiDrawChain;                   external;
  7407. function GpiDrawDynamics;                external;
  7408. function GpiDrawFrom;                    external;
  7409. function GpiDrawSegment;                 external;
  7410. function GpiElement;                     external;
  7411. function GpiEndArea;                     external;
  7412. function GpiEndElement;                  external;
  7413. function GpiEndPath;                     external;
  7414. function GpiEqualRegion;                 external;
  7415. function GpiErase;                       external;
  7416. function GpiErrorSegmentData;            external;
  7417. function GpiExcludeClipRectangle;        external;
  7418. function GpiFillPath;                    external;
  7419. function GpiFloodFill;                   external;
  7420. function GpiFrameRegion;                 external;
  7421. function GpiFullArc;                     external;
  7422. function GpiGetData;                     external;
  7423. function GpiImage;                       external;
  7424. function GpiIntersectClipRectangle;      external;
  7425. function GpiLabel;                       external;
  7426. function GpiLine;                        external;
  7427. function GpiLoadBitmap;                  external;
  7428. function GpiLoadFonts;                   external;
  7429. function GpiLoadMetaFile;                external;
  7430. function GpiLoadPublicFonts;             external;
  7431. function GpiMarker;                      external;
  7432. function GpiModifyPath;                  external;
  7433. function GpiMove;                        external;
  7434. function GpiOffsetClipRegion;            external;
  7435. function GpiOffsetElementPointer;        external;
  7436. function GpiOffsetRegion;                external;
  7437. function GpiOpenSegment;                 external;
  7438. function GpiOutlinePath;                 external;
  7439. function GpiPaintRegion;                 external;
  7440. function GpiPartialArc;                  external;
  7441. function GpiPathToRegion;                external;
  7442. function GpiPlayMetaFile;                external;
  7443. function GpiPointArc;                    external;
  7444. function GpiPolyFillet;                  external;
  7445. function GpiPolyFilletSharp;             external;
  7446. function GpiPolyLine;                    external;
  7447. function GpiPolyLineDisjoint;            external;
  7448. function GpiPolyMarker;                  external;
  7449. function GpiPolySpline;                  external;
  7450. function GpiPolygons;                    external;
  7451. function GpiPop;                         external;
  7452. function GpiPtInRegion;                  external;
  7453. function GpiPtVisible;                   external;
  7454. function GpiPutData;                     external;
  7455. function GpiQueryArcParams;              external;
  7456. function GpiQueryAttrMode;               external;
  7457. function GpiQueryAttrs;                  external;
  7458. function GpiQueryBackColor;              external;
  7459. function GpiQueryBackMix;                external;
  7460. function GpiQueryBitmapBits;             external;
  7461. function GpiQueryBitmapDimension;        external;
  7462. function GpiQueryBitmapHandle;           external;
  7463. function GpiQueryBitmapInfoHeader;       external;
  7464. function GpiQueryBitmapParameters;       external;
  7465. function GpiQueryBoundaryData;           external;
  7466. function GpiQueryCharAngle;              external;
  7467. function GpiQueryCharBox;                external;
  7468. function GpiQueryCharBreakExtra;         external;
  7469. function GpiQueryCharDirection;          external;
  7470. function GpiQueryCharExtra;              external;
  7471. function GpiQueryCharMode;               external;
  7472. function GpiQueryCharSet;                external;
  7473. function GpiQueryCharShear;              external;
  7474. function GpiQueryCharStringPos;          external;
  7475. function GpiQueryCharStringPosAt;        external;
  7476. function GpiQueryClipBox;                external;
  7477. function GpiQueryClipRegion;             external;
  7478. function GpiQueryColor;                  external;
  7479. function GpiQueryColorData;              external;
  7480. function GpiQueryColorIndex;             external;
  7481. function GpiQueryCp;                     external;
  7482. function GpiQueryCurrentPosition;        external;
  7483. function GpiQueryDefArcParams;           external;
  7484. function GpiQueryDefAttrs;               external;
  7485. function GpiQueryDefCharBox;             external;
  7486. function GpiQueryDefTag;                 external;
  7487. function GpiQueryDefViewingLimits;       external;
  7488. function GpiQueryDefaultViewMatrix;      external;
  7489. function GpiQueryDevice;                 external;
  7490. function GpiQueryDeviceBitmapFormats;    external;
  7491. function GpiQueryDrawControl;            external;
  7492. function GpiQueryDrawingMode;            external;
  7493. function GpiQueryEditMode;               external;
  7494. function GpiQueryElement;                external;
  7495. function GpiQueryElementPointer;         external;
  7496. function GpiQueryElementType;            external;
  7497. function GpiQueryFaceString;             external;
  7498. function GpiQueryFontAction;             external;
  7499. function GpiQueryFontFileDescriptions;   external;
  7500. function GpiQueryFontMetrics;            external;
  7501. function GpiQueryFonts;                  external;
  7502. function GpiQueryFullFontFileDescs;      external;
  7503. function GpiQueryGraphicsField;          external;
  7504. function GpiQueryInitialSegmentAttrs;    external;
  7505. function GpiQueryKerningPairs;           external;
  7506. function GpiQueryLineEnd;                external;
  7507. function GpiQueryLineJoin;               external;
  7508. function GpiQueryLineType;               external;
  7509. function GpiQueryLineWidth;              external;
  7510. function GpiQueryLineWidthGeom;          external;
  7511. function GpiQueryLogColorTable;          external;
  7512. function GpiQueryLogicalFont;            external;
  7513. function GpiQueryMarker;                 external;
  7514. function GpiQueryMarkerBox;              external;
  7515. function GpiQueryMarkerSet;              external;
  7516. function GpiQueryMetaFileBits;           external;
  7517. function GpiQueryMetaFileLength;         external;
  7518. function GpiQueryMix;                    external;
  7519. function GpiQueryModelTransformMatrix;   external;
  7520. function GpiQueryNearestColor;           external;
  7521. function GpiQueryNumberSetIds;           external;
  7522. function GpiQueryPS;                     external;
  7523. function GpiQueryPageViewport;           external;
  7524. function GpiQueryPalette;                external;
  7525. function GpiQueryPaletteInfo;            external;
  7526. function GpiQueryPattern;                external;
  7527. function GpiQueryPatternRefPoint;        external;
  7528. function GpiQueryPatternSet;             external;
  7529. function GpiQueryPel;                    external;
  7530. function GpiQueryPickAperturePosition;   external;
  7531. function GpiQueryPickApertureSize;       external;
  7532. function GpiQueryRGBColor;               external;
  7533. function GpiQueryRealColors;             external;
  7534. function GpiQueryRegionBox;              external;
  7535. function GpiQueryRegionRects;            external;
  7536. function GpiQuerySegmentAttrs;           external;
  7537. function GpiQuerySegmentNames;           external;
  7538. function GpiQuerySegmentPriority;        external;
  7539. function GpiQuerySegmentTransformMatrix; external;
  7540. function GpiQuerySetIds;                 external;
  7541. function GpiQueryStopDraw;               external;
  7542. function GpiQueryTag;                    external;
  7543. function GpiQueryTextAlignment;          external;
  7544. function GpiQueryTextBox;                external;
  7545. function GpiQueryViewingLimits;          external;
  7546. function GpiQueryViewingTransformMatrix; external;
  7547. function GpiQueryWidthTable;             external;
  7548. function GpiRectInRegion;                external;
  7549. function GpiRectVisible;                 external;
  7550. function GpiRemoveDynamics;              external;
  7551. function GpiResetBoundaryData;           external;
  7552. function GpiResetPS;                     external;
  7553. function GpiRestorePS;                   external;
  7554. function GpiRotate;                      external;
  7555. function GpiSaveMetaFile;                external;
  7556. function GpiSavePS;                      external;
  7557. function GpiScale;                       external;
  7558. function GpiSelectPalette;               external;
  7559. function GpiSetArcParams;                external;
  7560. function GpiSetAttrMode;                 external;
  7561. function GpiSetAttrs;                    external;
  7562. function GpiSetBackColor;                external;
  7563. function GpiSetBackMix;                  external;
  7564. function GpiSetBitmap;                   external;
  7565. function GpiSetBitmapBits;               external;
  7566. function GpiSetBitmapDimension;          external;
  7567. function GpiSetBitmapId;                 external;
  7568. function GpiSetCharAngle;                external;
  7569. function GpiSetCharBox;                  external;
  7570. function GpiSetCharBreakExtra;           external;
  7571. function GpiSetCharDirection;            external;
  7572. function GpiSetCharExtra;                external;
  7573. function GpiSetCharMode;                 external;
  7574. function GpiSetCharSet;                  external;
  7575. function GpiSetCharShear;                external;
  7576. function GpiSetClipPath;                 external;
  7577. function GpiSetClipRegion;               external;
  7578. function GpiSetColor;                    external;
  7579. function GpiSetCp;                       external;
  7580. function GpiSetCurrentPosition;          external;
  7581. function GpiSetDefArcParams;             external;
  7582. function GpiSetDefAttrs;                 external;
  7583. function GpiSetDefTag;                   external;
  7584. function GpiSetDefViewingLimits;         external;
  7585. function GpiSetDefaultViewMatrix;        external;
  7586. function GpiSetDrawControl;              external;
  7587. function GpiSetDrawingMode;              external;
  7588. function GpiSetEditMode;                 external;
  7589. function GpiSetElementPointer;           external;
  7590. function GpiSetElementPointerAtLabel;    external;
  7591. function GpiSetGraphicsField;            external;
  7592. function GpiSetInitialSegmentAttrs;      external;
  7593. function GpiSetLineEnd;                  external;
  7594. function GpiSetLineJoin;                 external;
  7595. function GpiSetLineType;                 external;
  7596. function GpiSetLineWidth;                external;
  7597. function GpiSetLineWidthGeom;            external;
  7598. function GpiSetMarker;                   external;
  7599. function GpiSetMarkerBox;                external;
  7600. function GpiSetMarkerSet;                external;
  7601. function GpiSetMetaFileBits;             external;
  7602. function GpiSetMix;                      external;
  7603. function GpiSetModelTransformMatrix;     external;
  7604. function GpiSetPS;                       external;
  7605. function GpiSetPageViewport;             external;
  7606. function GpiSetPaletteEntries;           external;
  7607. function GpiSetPattern;                  external;
  7608. function GpiSetPatternRefPoint;          external;
  7609. function GpiSetPatternSet;               external;
  7610. function GpiSetPel;                      external;
  7611. function GpiSetPickAperturePosition;     external;
  7612. function GpiSetPickApertureSize;         external;
  7613. function GpiSetRegion;                   external;
  7614. function GpiSetSegmentAttrs;             external;
  7615. function GpiSetSegmentPriority;          external;
  7616. function GpiSetSegmentTransformMatrix;   external;
  7617. function GpiSetStopDraw;                 external;
  7618. function GpiSetTag;                      external;
  7619. function GpiSetTextAlignment;            external;
  7620. function GpiSetViewingLimits;            external;
  7621. function GpiSetViewingTransformMatrix;   external;
  7622. function GpiStrokePath;                  external;
  7623. function GpiTranslate;                   external;
  7624. function GpiUnloadFonts;                 external;
  7625. function GpiUnloadPublicFonts;           external;
  7626. function GpiWCBitBlt;                    external;
  7627. function PrfAddProgram;                  external;
  7628. function PrfChangeProgram;               external;
  7629. function PrfCloseProfile;                external;
  7630. function PrfCreateGroup;                 external;
  7631. function PrfDestroyGroup;                external;
  7632. function PrfOpenProfile;                 external;
  7633. function PrfQueryDefinition;             external;
  7634. function PrfQueryProfile;                external;
  7635. function PrfQueryProfileData;            external;
  7636. function PrfQueryProfileInt;             external;
  7637. function PrfQueryProfileSize;            external;
  7638. function PrfQueryProfileString;          external;
  7639. function PrfQueryProgramCategory;        external;
  7640. function PrfQueryProgramHandle;          external;
  7641. function PrfQueryProgramTitles;          external;
  7642. function PrfRemoveProgram;               external;
  7643. function PrfReset;                       external;
  7644. function PrfWriteProfileData;            external;
  7645. function PrfWriteProfileString;          external;
  7646. function WinAddAtom;                     external;
  7647. function WinAddSwitchEntry;              external;
  7648. function WinAlarm;                       external;
  7649. function WinAssociateHelpInstance;       external;
  7650. function WinBeginEnumWindows;            external;
  7651. function WinBeginPaint;                  external;
  7652. function WinBroadcastMsg;                external;
  7653. function WinCalcFrameRect;               external;
  7654. function WinCallMsgFilter;               external;
  7655. function WinCancelShutdown;              external;
  7656. function WinChangeSwitchEntry;           external;
  7657. function WinCloseClipbrd;                external;
  7658. function WinCompareStrings;              external;
  7659. function WinCopyAccelTable;              external;
  7660. function WinCopyRect;                    external;
  7661. function WinCpTranslateChar;             external;
  7662. function WinCpTranslateString;           external;
  7663. function WinCreateAccelTable;            external;
  7664. function WinCreateAtomTable;             external;
  7665. function WinCreateCursor;                external;
  7666. function WinCreateDlg;                   external;
  7667. function WinCreateFrameControls;         external;
  7668. function WinCreateHelpInstance;          external;
  7669. function WinCreateHelpTable;             external;
  7670. function WinCreateMenu;                  external;
  7671. function WinCreateMsgQueue;              external;
  7672. function WinCreatePointer;               external;
  7673. function WinCreatePointerIndirect;       external;
  7674. function WinCreateStdWindow;             external;
  7675. function WinCreateSwitchEntry;           external;
  7676. function WinCreateWindow;                external;
  7677. function WinDdeInitiate;                 external;
  7678. function WinDdePostMsg;                  external;
  7679. function WinDdeRespond;                  external;
  7680. function WinDefDlgProc;                  external;
  7681. function WinDefFileDlgProc;              external;
  7682. function WinDefFontDlgProc;              external;
  7683. function WinDefWindowProc;               external;
  7684. function WinDeleteAtom;                  external;
  7685. function WinDeleteLibrary;               external;
  7686. function WinDeleteProcedure;             external;
  7687. function WinDestroyAccelTable;           external;
  7688. function WinDestroyAtomTable;            external;
  7689. function WinDestroyCursor;               external;
  7690. function WinDestroyHelpInstance;         external;
  7691. function WinDestroyMsgQueue;             external;
  7692. function WinDestroyPointer;              external;
  7693. function WinDestroyWindow;               external;
  7694. function WinDismissDlg;                  external;
  7695. function WinDispatchMsg;                 external;
  7696. function WinDlgBox;                      external;
  7697. function WinDrawBitmap;                  external;
  7698. function WinDrawBorder;                  external;
  7699. function WinDrawPointer;                 external;
  7700. function WinDrawText;                    external;
  7701. function WinEmptyClipbrd;                external;
  7702. function WinEnablePhysInput;             external;
  7703. function WinEnableWindow;                external;
  7704. function WinEnableWindowUpdate;          external;
  7705. function WinEndEnumWindows;              external;
  7706. function WinEndPaint;                    external;
  7707. function WinEnumClipbrdFmts;             external;
  7708. function WinEnumDlgItem;                 external;
  7709. function WinEqualRect;                   external;
  7710. function WinExcludeUpdateRegion;         external;
  7711. function WinFileDlg;                     external;
  7712. function WinFillRect;                    external;
  7713. function WinFindAtom;                    external;
  7714. function WinFlashWindow;                 external;
  7715. function WinFocusChange;                 external;
  7716. function WinFontDlg;                     external;
  7717. function WinFreeErrorInfo;               external;
  7718. function WinFreeFileDlgList;             external;
  7719. function WinGetClipPS;                   external;
  7720. function WinGetCurrentTime;              external;
  7721. function WinGetDlgMsg;                   external;
  7722. function WinGetErrorInfo;                external;
  7723. function WinGetKeyState;                 external;
  7724. function WinGetLastError;                external;
  7725. function WinGetMaxPosition;              external;
  7726. function WinGetMinPosition;              external;
  7727. function WinGetMsg;                      external;
  7728. function WinGetNextWindow;               external;
  7729. function WinGetPS;                       external;
  7730. function WinGetPhysKeyState;             external;
  7731. function WinGetScreenPS;                 external;
  7732. function WinGetSysBitmap;                external;
  7733. function WinInSendMsg;                   external;
  7734. function WinInflateRect;                 external;
  7735. function WinInitialize;                  external;
  7736. function WinIntersectRect;               external;
  7737. function WinInvalidateRect;              external;
  7738. function WinInvalidateRegion;            external;
  7739. function WinInvertRect;                  external;
  7740. function WinIsChild;                     external;
  7741. function WinIsPhysInputEnabled;          external;
  7742. function WinIsRectEmpty;                 external;
  7743. function WinIsThreadActive;              external;
  7744. function WinIsWindow;                    external;
  7745. function WinIsWindowEnabled;             external;
  7746. function WinIsWindowShowing;             external;
  7747. function WinIsWindowVisible;             external;
  7748. function WinLoadAccelTable;              external;
  7749. function WinLoadDlg;                     external;
  7750. function WinLoadHelpTable;               external;
  7751. function WinLoadLibrary;                 external;
  7752. function WinLoadMenu;                    external;
  7753. function WinLoadMessage;                 external;
  7754. function WinLoadPointer;                 external;
  7755. function WinLoadProcedure;               external;
  7756. function WinLoadString;                  external;
  7757. function WinLockVisRegions;              external;
  7758. function WinLockWindowUpdate;            external;
  7759. function WinMakePoints;                  external;
  7760. function WinMakeRect;                    external;
  7761. function WinMapDlgPoints;                external;
  7762. function WinMapWindowPoints;             external;
  7763. function WinMessageBox;                  external;
  7764. function WinMultWindowFromIDs;           external;
  7765. function WinNextChar;                    external;
  7766. function WinOffsetRect;                  external;
  7767. function WinOpenClipbrd;                 external;
  7768. function WinOpenWindowDC;                external;
  7769. function WinPeekMsg;                     external;
  7770. function WinPopupMenu;                   external;
  7771. function WinPostMsg;                     external;
  7772. function WinPostQueueMsg;                external;
  7773. function WinPrevChar;                    external;
  7774. function WinProcessDlg;                  external;
  7775. function WinPtInRect;                    external;
  7776. function WinQueryAccelTable;             external;
  7777. function WinQueryActiveWindow;           external;
  7778. function WinQueryAnchorBlock;            external;
  7779. function WinQueryAtomLength;             external;
  7780. function WinQueryAtomName;               external;
  7781. function WinQueryAtomUsage;              external;
  7782. function WinQueryCapture;                external;
  7783. function WinQueryClassInfo;              external;
  7784. function WinQueryClassName;              external;
  7785. function WinQueryClassThunkProc;         external;
  7786. function WinQueryClipbrdData;            external;
  7787. function WinQueryClipbrdFmtInfo;         external;
  7788. function WinQueryClipbrdOwner;           external;
  7789. function WinQueryClipbrdViewer;          external;
  7790. function WinQueryCp;                     external;
  7791. function WinQueryCpList;                 external;
  7792. function WinQueryCursorInfo;             external;
  7793. function WinQueryDesktopBkgnd;           external;
  7794. function WinQueryDesktopWindow;          external;
  7795. function WinQueryDlgItemShort;           external;
  7796. function WinQueryDlgItemText;            external;
  7797. function WinQueryDlgItemTextLength;      external;
  7798. function WinQueryFocus;                  external;
  7799. function WinQueryHelpInstance;           external;
  7800. function WinQueryMsgPos;                 external;
  7801. function WinQueryMsgTime;                external;
  7802. function WinQueryObjectWindow;           external;
  7803. function WinQueryPointer;                external;
  7804. function WinQueryPointerInfo;            external;
  7805. function WinQueryPointerPos;             external;
  7806. function WinQueryPresParam;              external;
  7807. function WinQueryQueueInfo;              external;
  7808. function WinQueryQueueStatus;            external;
  7809. function WinQuerySessionTitle;           external;
  7810. function WinQuerySwitchEntry;            external;
  7811. function WinQuerySwitchHandle;           external;
  7812. function WinQuerySwitchList;             external;
  7813. function WinQuerySysColor;               external;
  7814. function WinQuerySysModalWindow;         external;
  7815. function WinQuerySysPointer;             external;
  7816. function WinQuerySysValue;               external;
  7817. function WinQuerySystemAtomTable;        external;
  7818. function WinQueryTaskSizePos;            external;
  7819. function WinQueryTaskTitle;              external;
  7820. function WinQueryUpdateRect;             external;
  7821. function WinQueryUpdateRegion;           external;
  7822. function WinQueryVersion;                external;
  7823. function WinQueryWindow;                 external;
  7824. function WinQueryWindowDC;               external;
  7825. function WinQueryWindowModel;            external;
  7826. function WinQueryWindowPos;              external;
  7827. function WinQueryWindowProcess;          external;
  7828. function WinQueryWindowPtr;              external;
  7829. function WinQueryWindowRect;             external;
  7830. function WinQueryWindowText;             external;
  7831. function WinQueryWindowTextLength;       external;
  7832. function WinQueryWindowThunkProc;        external;
  7833. function WinQueryWindowULong;            external;
  7834. function WinQueryWindowUShort;           external;
  7835. function WinRealizePalette;              external;
  7836. function WinRegisterClass;               external;
  7837. function WinRegisterUserDataType;        external;
  7838. function WinRegisterUserMsg;             external;
  7839. function WinReleaseHook;                 external;
  7840. function WinReleasePS;                   external;
  7841. function WinRemovePresParam;             external;
  7842. function WinRemoveSwitchEntry;           external;
  7843. function WinRequestMutexSem;             external;
  7844. function WinSaveWindowPos;               external;
  7845. function WinScrollWindow;                external;
  7846. function WinSendDlgItemMsg;              external;
  7847. function WinSendMsg;                     external;
  7848. function WinSetAccelTable;               external;
  7849. function WinSetActiveWindow;             external;
  7850. function WinSetCapture;                  external;
  7851. function WinSetClassMsgInterest;         external;
  7852. function WinSetClassThunkProc;           external;
  7853. function WinSetClipbrdData;              external;
  7854. function WinSetClipbrdOwner;             external;
  7855. function WinSetClipbrdViewer;            external;
  7856. function WinSetCp;                       external;
  7857. function WinSetDesktopBkgnd;             external;
  7858. function WinSetDlgItemShort;             external;
  7859. function WinSetDlgItemText;              external;
  7860. function WinSetErrorInfo;                external;
  7861. function WinSetFocus;                    external;
  7862. function WinSetHook;                     external;
  7863. function WinSetKeyboardStateTable;       external;
  7864. function WinSetMsgInterest;              external;
  7865. function WinSetMsgMode;                  external;
  7866. function WinSetMultWindowPos;            external;
  7867. function WinSetOwner;                    external;
  7868. function WinSetParent;                   external;
  7869. function WinSetPointer;                  external;
  7870. function WinSetPointerOwner;             external;
  7871. function WinSetPointerPos;               external;
  7872. function WinSetPresParam;                external;
  7873. function WinSetRect;                     external;
  7874. function WinSetRectEmpty;                external;
  7875. function WinSetSynchroMode;              external;
  7876. function WinSetSysColors;                external;
  7877. function WinSetSysModalWindow;           external;
  7878. function WinSetSysValue;                 external;
  7879. function WinSetWindowBits;               external;
  7880. function WinSetWindowPos;                external;
  7881. function WinSetWindowPtr;                external;
  7882. function WinSetWindowText;               external;
  7883. function WinSetWindowThunkProc;          external;
  7884. function WinSetWindowULong;              external;
  7885. function WinSetWindowUShort;             external;
  7886. function WinShowCursor;                  external;
  7887. function WinShowPointer;                 external;
  7888. function WinShowTrackRect;               external;
  7889. function WinShowWindow;                  external;
  7890. function WinStartApp;                    external;
  7891. function WinStartTimer;                  external;
  7892. function WinStopTimer;                   external;
  7893. function WinSubclassWindow;              external;
  7894. function WinSubstituteStrings;           external;
  7895. function WinSubtractRect;                external;
  7896. function WinSwitchToProgram;             external;
  7897. function WinTerminate;                   external;
  7898. function WinTerminateApp;                external;
  7899. function WinTrackRect;                   external;
  7900. function WinTranslateAccel;              external;
  7901. function WinUnionRect;                   external;
  7902. function WinUpdateWindow;                external;
  7903. function WinUpper;                       external;
  7904. function WinUpperChar;                   external;
  7905. function WinValidateRect;                external;
  7906. function WinValidateRegion;              external;
  7907. function WinWaitEventSem;                external;
  7908. function WinWaitMsg;                     external;
  7909. function WinWaitMuxWaitSem;              external;
  7910. function WinWindowFromDC;                external;
  7911. function WinWindowFromID;                external;
  7912. function WinWindowFromPoint;             external;
  7913.  
  7914. (*
  7915.   By default Virtual Pascal outputs run-time error message to
  7916.   Standard Output. Everything is fine unless your program is written
  7917.   for Presentation Manager. In this case you won't see run-time error
  7918.   message at all. Run-time error message display support for
  7919.   Presentation Manager IS NOT embedded into SYSTEM unit because in
  7920.   this case SYSTEM unit should use windowing API which may not be
  7921.   available. This unit is always used by the program written for PM,
  7922.   so exit procedure is installed to displays run-time error
  7923.   message in Presentation Manager window.
  7924. *)
  7925.  
  7926. type
  7927.   NumStr = String[10];
  7928.  
  7929. var
  7930.   SaveExitProc: Pointer;
  7931.  
  7932. { Converts Longint to String (hexadecimal) }
  7933.  
  7934. function Hex2Str(Value: Longint): NumStr;
  7935. var
  7936.   I: Longint;
  7937.   S: NumStr;
  7938. const
  7939.   HexDigits: array[0..15] of Char = '0123456789ABCDEF';
  7940. begin
  7941.   S[0] := Chr(8);
  7942.   for I := 0 to 7 do
  7943.   begin
  7944.     S[8-I] := HexDigits[Value and $0F];
  7945.     Value := Value shr 4;
  7946.   end;
  7947.   Hex2Str := S;
  7948. end;
  7949.  
  7950. { Converts Longint to String (decimal) }
  7951.  
  7952. function Dec2Str(Value: Longint): NumStr;
  7953. var
  7954.   S: NumStr;
  7955. begin
  7956.   Str(Value,S);
  7957.   Dec2Str := S;
  7958. end;
  7959.  
  7960. { Exit procedure that displays run-time error (if any) }
  7961.  
  7962. procedure PM_RunTimeError;
  7963. var
  7964.   S: String;
  7965. begin
  7966.   if ErrorAddr <> nil then
  7967.   begin
  7968.     S := 'Runtime error ' + Dec2Str(ExitCode) + ' at ' + Hex2Str(Longint(ErrorAddr));
  7969.     if ExceptionNo <> 0 then S := S + ' (Exception ' + Hex2Str(ExceptionNo) + ')';
  7970.     S := S + '.'#0;
  7971.     WinMessageBox(hwnd_Desktop,hwnd_Desktop,@S[1],'Virtual Pascal RTL',0,mb_Error+mb_Moveable);
  7972.   end;
  7973.   ExitProc := SaveExitProc;
  7974. end;
  7975.  
  7976. begin
  7977.   SaveExitProc := ExitProc;
  7978.   ExitProc := @PM_RunTimeError;
  7979. end.
  7980.