home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 48 / SENT14D.ISO / tech / delphi / disk14 / doc.pak / WINPROCS.INT < prev    next >
Encoding:
Text File  |  1995-08-24  |  45.6 KB  |  949 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Runtime Library                          }
  5. {       Windows API Interface Unit                      }
  6. {                                                       }
  7. {       Copyright (c) 1991,95 Borland International     }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit WinProcs;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. { function changed from Windows 3.0 to Windows 3.1 }
  18. procedure AnsiToOem(AnsiStr, OemStr: PChar);
  19. procedure AnsiToOemBuff(AnsiStr, OemStr: PChar; Length: Word);
  20. function BringWindowToTop(Wnd: HWnd): Bool;
  21. function EndDeferWindowPos(WinPosInfo: THandle): Bool;
  22. function Escape(DC: HDC; Escape, Count: Integer; InData: PChar;
  23.   OutData: Pointer): Integer;
  24. function GetMenuItemCount(Menu: HMenu): Integer;
  25. function GetInstanceData(Instance: THandle; Data: PByte;
  26.   Count: Integer): Integer;
  27. procedure GlobalUnfix(Mem: THandle);
  28. procedure OemToAnsi(OemStr, AnsiStr: PChar);
  29. procedure OemToAnsiBuff(OemStr, AnsiStr: PChar; Length: Word);
  30. function SetResourceHandler(Instance: THandle; ResType: PChar;
  31.   LoadFunc: TFarProc): TFarProc;
  32. procedure UnlockSegment(Segment: Word);
  33. function CreateBitmap(Width, Height: Integer; Planes, BitCount: Word;
  34.   Bits: Pointer): HBitmap;
  35.  
  36. { functions new to Windows 3.1 }
  37. function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer;
  38.   var Size: TSize): Bool;
  39. function GetSystemDebugState: Longint;
  40. function LockInput(h1: THandle; hwndInput: HWnd; fLock: Bool): Bool;
  41. function QuerySendMessage(h1, h2, h3: THandle; lpmsg: PMsg): Bool;
  42. function EnumFonts(DC: HDC; lpszFace: PChar; fntenmprc: TOldFontEnumProc;
  43.   lpszData: PChar): Integer;
  44. function GetWinDebugInfo(DebugInfo: PWinDebugInfo; Flags: Word): Bool;
  45. function SetWinDebugInfo(DebugInfo: PWinDebugInfo): Bool;
  46. function IsBadReadPtr(lp: Pointer; cb: Word): Bool;
  47. function IsBadWritePtr(lp: Pointer; cb: Word): Bool;
  48. function IsBadHugeReadPtr(lp: Pointer; cb: Longint): Bool;
  49. function IsBadHugeWritePtr(lp: Pointer; cb: Longint): Bool;
  50. function IsBadCodePtr(lpfn: TFarProc): Bool;
  51. function IsBadStringPtr(lpsz: PChar; cchMax: Word): Bool;
  52. procedure DirectedYield(Task: TTask);
  53. function PrestoChangoSelector(SourceSel, DestSel: Word): Word;
  54. function GetSelectorBase(Selector: Word): Longint;
  55. function SetSelectorBase(Selector: Word; Base: Longint): Word;
  56. function GetSelectorLimit(Selector: Word): Longint;
  57. function SetSelectorLimit(Selector: Word; Base: Longint): Word;
  58.  
  59. function GetDriverInfo(hDriver: THandle; lpdis: PDriverInfoStruct): Bool;
  60. function GetWindowPlacement(Wnd: HWnd; Placement: PWindowPlacement): Bool;
  61. function SetWindowPlacement(Wnd: HWnd; Placement: PWindowPlacement): Bool;
  62. function DlgDirSelectEx(Dlg: HWnd; Path: PChar; cbPath: Integer;
  63.   ListBox: Integer): Bool;
  64. function DlgDirSelectComboBoxEx(Dlg: HWnd; Path: PChar; cbPath: Integer;
  65.   ComboBox: Integer): Bool;
  66. function GetTimerResolution: Longint;
  67. function ExitWindowsExec(Exe: PChar; Params: PChar): Bool;
  68.  
  69. function SpoolFile(Printer, Port, Job, F: PChar): THandle;
  70. function QueryAbort(DC: HDC; Reserved: Integer): Bool;
  71. function SetWindowOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  72. function GetWindowOrgEx(DC: HDC; Point: PPoint): Bool;
  73. function SetWindowExtEx(DC: HDC; nX, nY: Integer; Size: PSize): Bool;
  74. function GetWindowExtEx(DC: HDC; Size: PSize): Bool;
  75. function OffsetWindowOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  76. function ScaleWindowExtEx(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer;
  77.   Size: PSize): Bool;
  78. function SetViewportExtEx(DC: HDC; nX, nY: Integer; Size: PSize): Bool;
  79. function GetViewportExtEx(DC: HDC; Size: PSize): Bool;
  80. function SetViewportOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  81. function GetViewportOrgEx(DC: HDC; Point: PPoint): Bool;
  82. function OffsetViewportOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  83. function ScaleViewportExtEx(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer;
  84.   Size: PSize): Bool;
  85. function GetBrushOrgEx(DC: HDC; Point: PPoint): Bool;
  86. function MoveToEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  87. function GetCurrentPositionEx(DC: HDC; Point: PPoint): Bool;
  88. function GetAspectRatioFilterEx(DC: HDC; Size: PSize): Bool;
  89. function EnumFontFamilies(DC: HDC; Family: PChar;
  90.   EnumProc: TFontEnumProc; Data: PChar): Integer;
  91. function GetKerningPairs(DC: HDC; i: Integer; Pair: PKerningPair): Integer;
  92. function SetBitmapDimensionEx(BM: HBitmap; nX, nY: Integer; Size: PSize): Bool;
  93. function GetBitmapDimensionEx(BM: HBitmap; Size: PSize): Bool;
  94. function SetMetaFileBitsBetter(mf: THandle): THandle;
  95. function StartDoc(DC: HDC; var di: TDocInfo): Integer;
  96. function StartPage(DC: HDC): Integer;
  97. function EndPage(DC: HDC): Integer;
  98. function EndDoc(DC: HDC): Integer;
  99. function AbortDoc(DC: HDC): Integer;
  100. function SetAbortProc(DC: HDC; AbortProc: TAbortProc): Integer;
  101.  
  102. function IsTask(Task: THandle): Bool;
  103. function GetFreeSystemResources(SysResource: Word): Word;
  104. function GlobalPtrHandle(P: Pointer): THandle;
  105. function GlobalAllocPtr(Flags: Word; Bytes: Longint): Pointer;
  106. function GlobalReAllocPtr(P: Pointer; Bytes: Longint; Flags: Word): Pointer;
  107. function GlobalFreePtr(P: Pointer): THandle;
  108. function GlobalLockPtr(P: Pointer): Pointer;
  109. function GlobalUnlockPtr(P: Pointer): Bool;
  110. function GetInstanceModule(Instance: THandle): THandle;
  111. procedure LogError(Err: Word; Info: Pointer);
  112. procedure LogParamError(Err: Word; fn: TFarProc; Param: Pointer);
  113. function IsDBCSLeadByte(Ch: Byte): Bool;
  114. function GetDCEx(Wnd: HWnd; Clip: HRgn; Flags: Longint): HDC;
  115. function IsGDIObject(Obj: THandle): Bool;
  116. function SetBoundsRect(DC: HDC; var Bounds: TRect; Flags: Word): Word;
  117. function GetBoundsRect(DC: HDC; var Bounds: TRect; Flags: Word): Word;
  118. function ConvertOutlineFontFile(A, B, C: PChar): Longint;
  119. function GetFontData(hdc: HDC; dwTable, dwOffset: Longint; lpvBuffer: PChar;
  120.   cbData: Longint): Longint;
  121. function GetGlyphOutline(hdc: HDC; uChar, fuFormat: Word;
  122.   var lpgm: TGlyphMetrics; cbBuffer: Longint; lpBuffer: PChar;
  123.   var lpMat2: TMat2): Longint;
  124. function CreateScalableFontResource(fHidden: Word; lpszResourceFile,
  125.   lpszFontFile, lpszCurrentPath: PChar): Bool;
  126. function GetCharABCWidths(hdc: HDC; uFirstChar, uLastChar: Word;
  127.   var lpabc: TABC): Bool;
  128. function GetRasterizerCaps(var lpRastStat: TRasterizer_Status;
  129.   cbNumBytes: Integer): Bool;
  130. function GetOutlineTextMetrics(hdc: HDC; cbData: Word;
  131.   lpotm: POutlineTextMetric): Word;
  132. function GetMessageExtraInfo: Longint;
  133. function GetOpenClipboardWindow: HWnd;
  134. function GetQueueStatus(Flags: Word): Longint;
  135. function IsMenu(Menu: HMenu): Bool;
  136. function RedrawWindow(Wnd: HWnd; UpdateRect: PRect; UpdateRgn: HRgn;
  137.   Flags: Word): Bool;
  138. function LockWindowUpdate(Wnd: HWnd): Bool;
  139. function ScrollWindowEx(Wnd: HWnd; dx, dy: Integer; Scroll, Clip: PRect; UpdateRgn: HRgn;
  140.   UpdateRect: PRect; Flags: Word): Integer;
  141. function EnableScrollBar(hwnd: HWnd; fnSBFlags: Integer;
  142.   fuArrowFlags: Word): Bool;
  143. function CopyCursor(hInst: THandle; hCur: HCursor): HCursor;
  144. function GetCursor: HCursor;
  145. procedure GetClipCursor(var Rect: TRect);
  146. function CopyIcon(hInst: THandle; Icon: HIcon): HIcon;
  147. procedure MapWindowPoints(FromWnd, ToWnd: HWnd; var Point; Count: Word);
  148. procedure MapWindowRect(FromWnd, ToWnd: HWnd; var Rect: TRect);
  149. function SubtractRect(var Dest, Source1, Source2: TRect): Bool;
  150. function SetWindowsHookEx(HookId: Integer; Hook: THookProc; Module, Task: THandle): HHook;
  151. function UnhookWindowsHookEx(Hook: HHook): Bool;
  152. function CallNextHookEx(Hook: HHook; Code: Integer; wParam: Word; lParam: Longint): Longint;
  153. function EnableCommNotification(idComDev: Integer; hwnd: HWnd;
  154.   cbWriteNotify, cbOutQueue: Integer): Bool;
  155. function OpenDriver(DriverName, SectionName: PChar; lParam2: Longint): THandle;
  156. function CloseDriver(Driver: THandle; lParam1, lParam2: Longint): Longint;
  157. function GetDriverModuleHandle(Driver: THandle): THandle;
  158. function SendDriverMessage(Driver: THandle; message: Word; lParam1,
  159.   lParam2: Longint): Longint;
  160. function GetNextDriver(Driver: THandle; lParam: Longint): THandle;
  161.  
  162. function lstrcpyn(String1, String2: PChar; i: Integer): PChar;
  163. procedure hmemcpy(p1, p2: Pointer; L: Longint);
  164.  
  165. function DefDriverProc(DriverIdentifier: Longint; DriverId: THandle; Message: Word; lParam1, lParam2: Longint): Longint;
  166. function SystemParametersInfo(Action, wParam: Word; lParam: Pointer;
  167.   UpdateWinIni: Word): Bool;
  168.  
  169. { Network support }
  170.  
  171. function WNetAddConnection(lpszNetPath, lpszPassword,
  172.   lpszLocalName: PChar): Word;
  173. function WNetGetConnection(lpszLocalName, lpszRemoteName: PChar;
  174.   cbBufferSize: PWord): Word;
  175. function WNetCancelConnection(lpszName: PChar; tForce: Bool): Word;
  176.  
  177. { Provided for compatiblity only.  Should use the Pascal RTL functions
  178.   Ptr, Off, and Seg instead. }
  179.  
  180. function MakeLP(Sel, Off: Word): Pointer;
  181. inline(
  182.   $5A/    { POP DX }
  183.   $58);   { POP AX }
  184.  
  185. function SelectorOf(lp: Pointer): THandle;
  186. inline(
  187.   $5A/    { POP DX }
  188.   $58);   { POP AX }
  189.  
  190. function OffsetOf(lp: Pointer): Word;
  191. inline(
  192.   $58/    { POP AX }
  193.   $5A);   { POP DX }
  194.  
  195. { functions introduced in Windows 3.0 or earlier }
  196. function AccessResource(Instance, ResInfo: THandle): Integer;
  197. function AddAtom(Str: PChar): TAtom;
  198. function AddFontResource(Filename: PChar): Integer;
  199. procedure AdjustWindowRect(var Rect: TRect; Style: LongInt; Menu: Bool);
  200. procedure AdjustWindowRectEx(var Rect: TRect; Style: LongInt; Menu: Bool;
  201.   ExtStyle: LongInt);
  202. function AllocCStoDSAlias(Selector: Word): Word;
  203. function AllocDStoCSAlias(Selector: Word): Word;
  204. function AllocResource(Instance: THandle; ResInfo: THandle;
  205.   Size: LongInt): THandle;
  206. function AllocSelector(Selector: Word): Word;
  207. procedure AnimatePalette(Palette: HPalette; StartIndex,    NumEntires: Word; 
  208.   var PaletteColors);
  209. function AnsiLower(Str: PChar): PChar;
  210. function AnsiLowerBuff(Str: PChar; Length: Word): Word;
  211. function AnsiNext(CurrentChar: PChar): PChar;
  212. function AnsiPrev(Start, CurrentChar: PChar): PChar;
  213. function AnsiUpper(Str: PChar): PChar;
  214. function AnsiUpperBuff(Str: PChar; Length: Word): Word;
  215. function AnyPopup: Bool;
  216. function AppendMenu(Menu: HMenu; Flags, IDNewItem: Word;
  217.   NewItem: PChar): Bool;
  218. function Arc(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): Bool;
  219. function ArrangeIconicWindows(Wnd: HWnd): Word;
  220. function BeginDeferWindowPos(NumWindows: Integer): THandle;
  221. function BeginPaint(Wnd: HWnd; var Paint: TPaintStruct): HDC;
  222. function BitBlt(DestDC: HDC; X, Y, nWidth, Height: Integer; SrcDC: HDC; 
  223.   XSrc, YSrc: Integer; Rop: LongInt): Bool;
  224. function BuildCommDCB(Def: PChar; var DCB: TDCB): Integer;
  225. function CallMsgFilter(var Msg: TMsg; Code: Integer): Bool;
  226. function CallWindowProc(PrevWndFunc: TFarProc; Wnd: HWnd; Msg, wParam: Word;
  227.   lParam: LongInt): LongInt;
  228. function Catch(var CatchBuf: TCatchBuf): Integer;
  229. function ChangeClipboardChain(Wnd, WndNext: HWnd): Bool;
  230. function ChangeMenu(A: HMenu; B: Word; C: PChar; D: Word; E: Word): Bool;
  231. function ChangeSelector(DestSelector, SourceSelector: Word): Word;
  232. procedure CheckDlgButton(Dlg: HWnd; IDButton: Integer; Check: Word);
  233. function CheckMenuItem(Menu: HMenu; IDCheckItem, Check: Word): Bool;
  234. procedure CheckRadioButton(Dlg: HWnd; IDFirstButton, IDLastButton,
  235.   IDCheckButton: Integer);
  236. function ChildWindowFromPoint(Wnd: HWnd; Point: TPoint): HWnd;
  237. function Chord(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): Bool;
  238. function ClearCommBreak(Cid: Integer): Integer;
  239. procedure ClientToScreen(Wnd: HWnd; var Point: TPoint);
  240. procedure ClipCursor(Rect: PRect);
  241. function CloseClipboard: Bool;
  242. function CloseComm(Cid: Integer): Integer;
  243. function CloseMetaFile(DC: THandle): THandle;
  244. procedure CloseSound;
  245. procedure CloseWindow(Wnd: HWnd);
  246. function CombineRgn(DestRgn, SrcRgn1, SrcRgn2: HRgn;
  247.   CombineMode: Integer): Integer;
  248. function CopyMetaFile(SrcMetaFile: THandle; FileName: PChar): THandle;
  249. procedure CopyRect(var DestRect: TRect; const SourceRect: TRect);
  250. function CountClipboardFormats: Integer;
  251. function CountVoiceNotes(Voice: Integer): Integer;
  252. function CreateBitmapIndirect(var Bitmap: TBitmap): HBitmap;
  253. function CreateBrushIndirect(var LogBrush: TLogBrush): HBrush;
  254. procedure CreateCaret(Wnd: HWnd; Bitmap: HBitmap;
  255.   Width, Height: Integer);
  256. function CreateCompatibleBitmap(DC: HDC; Width, Height: Integer): HBitmap;
  257. function CreateCompatibleDC(DC: HDC): HDC;
  258. function CreateCursor(Instance: THandle; Xhotspot, Yhotspot: Integer;
  259.   Width, Height: Integer; ANDbitPlane, XORbitPlane: Pointer): HCursor;
  260. function CreateDC(DriverName, DeviceName, OutPut: PChar;
  261.   InitData: Pointer): HDC;
  262. function CreateDialog(Instance: THandle; TemplateName: PChar;
  263.   WndParent: HWnd; DialogFunc: TFarProc): HWnd;
  264. function CreateDialogIndirect(Instance: THandle; DialogTemplate: Pointer;
  265.   WndParent: HWnd; DialogFunc: TFarProc): HWnd;
  266. function CreateDialogIndirectParam(Instance: THandle;
  267.   DialogTemplate: Pointer; WndParent: HWnd; DialogFunc: TFarProc;
  268.   InitParam: LongInt): HWnd;
  269. function CreateDialogParam(Instance: THandle; TemplateName: PChar;
  270.   WndParent: HWnd; DialogFunc: TFarProc; InitParam: LongInt): HWnd;
  271. function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader;
  272.   dwUsage: LongInt; InitBits: PChar; var InitInfo: TBitmapInfo;
  273.   wUsage: Word): HBitmap;
  274. function CreateDIBPatternBrush(PackedDIB: THandle; Usage: Word): HBrush;
  275. function CreateDiscardableBitmap(DC: HDC; Width, Height: Integer): HBitmap;
  276. function CreateEllipticRgn(X1, Y1, X2, Y2: Integer): HRgn;
  277. function CreateEllipticRgnIndirect(const Rect: TRect): HRgn;
  278. function CreateFont(Height, Width, Escapement, Orientation,
  279.   Weight: Integer; Italic, Underline, StrikeOut, CharSet, OutputPrecision, 
  280.   ClipPrecision, Quality, PitchAndFamily: Byte;    Facename: PChar): HFont;
  281. function CreateFontIndirect(var LogFont: TLogFont): HFont;
  282. function CreateHatchBrush(Index: Integer; Color: TColorRef): HBrush;
  283. function CreateIC(DriverName, DeviceName, Output: PChar;
  284.   InitData: Pointer): HDC;
  285. function CreateIcon(Instance: THandle; Width, Height: Integer;
  286.   Planes, BitsPixel: Byte; ANDbits, XORbits: Pointer): HIcon;
  287. function CreateMenu: HMenu;
  288. function CreateMetaFile(Filename: PChar): THandle;
  289. function CreatePalette(var LogPalette: TLogPalette): HPalette;
  290. function CreatePatternBrush(Bitmap: HBitmap): HBrush;
  291. function CreatePen(PenStyle, Width: Integer; Color: TColorRef): HPen;
  292. function CreatePenIndirect(var LogPen: TLogPen): HPen;
  293. function CreatePolygonRgn(var Points; Count, PolyFillMode: Integer): HRgn;
  294. function CreatePolyPolygonRgn(var Points; var PolyCounts; Count,
  295.   PolyFillMode: Integer): HRgn;
  296. function CreatePopupMenu: HMenu;
  297. function CreateRectRgn(X1, Y1, X2, Y2: Integer): HRgn;
  298. function CreateRectRgnIndirect(const Rect: TRect): HRgn;
  299. function CreateRoundRectRgn(X1, Y1, X2, Y2, X3, Y3: Integer): HRgn;
  300. function CreateSolidBrush(Color: TColorRef): HBrush;
  301. function CreateWindow(ClassName, WindowName: PChar; Style: LongInt;
  302.   X, Y, Width, Height: Integer; WndParent: HWnd; Menu: HMenu;
  303.   Instance: THandle; Param: Pointer): HWnd;
  304. function CreateWindowEx(ExStyle: LongInt; ClassName, WindowName: PChar;
  305.   Style: LongInt; X, Y, Width, Height: Integer; WndParent: HWnd;
  306.   Menu: HMenu; Instance: THandle; Param: Pointer): HWnd;
  307. procedure DebugBreak;
  308. function DefDlgProc(Dlg: HWnd; Msg, wParam: Word; lParam: LongInt): LongInt;
  309. function DeferWindowPos(WinPosInfo: THandle; Wnd, WndInsertAfter: HWnd;
  310.   x, y, cx, cy: Integer; Flags: Word): THandle;
  311. function DefFrameProc(Wnd, WndMDIClient: HWnd; Msg, wParam: Word; 
  312.   lParam: LongInt): LongInt;
  313. function DefHookProc(Code: Integer; wParam: Word; lParam: LongInt;
  314.   lpfnNextHook: TFarProc): LongInt;
  315. function DefineHandleTable(Offset: Word): Bool;
  316. function DefMDIChildProc(Wnd: HWnd; Msg, wParam: Word;
  317.   lParam: LongInt): LongInt;
  318. function DefWindowProc(Wnd: HWnd; Msg, wParam: Word; 
  319.   lParam: LongInt): LongInt;
  320. function DeleteAtom(AnAtom: TAtom): TAtom;
  321. function DeleteDC(DC: HDC): Bool;
  322. function DeleteMenu(Menu: HMenu; Position, Flags: Word): Bool;
  323. function DeleteMetaFile(MF: THandle): Bool;
  324. function DeleteObject(Handle: THandle): Bool;
  325. procedure DestroyCaret;
  326. function DestroyCursor(Cursor: HCursor): Bool;
  327. function DestroyIcon(Icon: HIcon): Bool;
  328. function DestroyMenu(Menu: HMenu): Bool;
  329. function DestroyWindow(Wnd: HWnd): Bool;
  330. function DialogBox(Instance: THandle; Templatename: PChar;
  331.   WndParent: HWnd; DialogFunc: TFarProc): Integer;
  332. function DialogBoxIndirect(Instance, DialogTemplate: THandle; WndParent: HWnd; 
  333.   DialogFunc: TFarProc): Integer;
  334. function DialogBoxIndirectParam(Instance, DialogTemplate: THandle;
  335.   WndParent: HWnd; DialogFunc: TFarProc; InitParam: LongInt): Integer;
  336. function DialogBoxParam(Instance: THandle; TemplateName: PChar;
  337.   WndParent: HWnd; DialogFunc: TFarProc; InitParam: LongInt): Integer;
  338. function DispatchMessage(var Msg: TMsg): LongInt;
  339. function DlgDirList(Dlg: HWnd; PathSpec: PChar; IDListBox,
  340.   IDStaticPath: Integer; Filetype: Word): Integer;
  341. function DlgDirListComboBox(Dlg: HWnd; PathSpec: PChar; IDComboBox,
  342.  IDStaticText: Integer; Filetype: Word): Integer;
  343. function DlgDirSelect(Dlg: HWnd; Str: PChar; IDListBox: Integer): Bool;
  344. function DlgDirSelectComboBox(Dlg: HWnd; Str: PChar;
  345.   IDComboBox: Integer): Bool;
  346. procedure DOS3Call;
  347. function DPtoLP(DC: HDC; var Points; Count: Integer): Bool;
  348. procedure DrawFocusRect(DC: HDC; const Rect: TRect);
  349. function DrawIcon(DC: HDC; X, Y: Integer; Icon: HIcon): Bool;
  350. procedure DrawMenuBar(Wnd: HWnd);
  351. function DrawText(DC: HDC; Str: PChar; Count: Integer; const Rect: TRect;
  352.   Format: Word): Integer;
  353. function Ellipse(DC: HDC; X1, Y1, X2, Y2: Integer): Bool;
  354. function EmptyClipboard: Bool;
  355. function EnableHardwareInput(EnableInput: Bool): Bool;
  356. function EnableMenuItem(Menu: HMenu; IDEnableItem: Word;
  357.   Enable: Word): Bool;
  358. function EnableWindow(Wnd: HWnd; Enable: Bool): Bool;
  359. procedure EndDialog(Dlg: HWnd; Result: Integer);
  360. procedure EndPaint(Wnd: HWnd; var Paint: TPaintStruct);
  361. function EnumChildWindows(WndParent: HWnd; EnumFunc: TFarProc;
  362.   lParam: LongInt): Bool;
  363. function EnumClipboardFormats(Format: Word): Word;
  364. function EnumMetaFile(DC: HDC; MF: THandle; CallbackFunc: TFarProc;
  365.   ClientData: Pointer): Bool;
  366. function EnumObjects(DC: HDC; ObjectType: Integer; ObjectFunc: TFarProc;
  367.   Data: Pointer): Integer;
  368. function EnumProps(Wnd: HWnd; EnumFunc: TFarProc): Integer;
  369. function EnumTaskWindows(Task: THandle; EnumFunc: TFarProc;
  370.   lParam: LongInt): Bool;
  371. function EnumWindows(EnumFunc: TFarProc; lParam: LongInt): Bool;
  372. function EqualRect(const Rect1, Rect2: TRect): Bool;
  373. function EqualRgn(SrcRgn1, SrcRgn2: HRgn): Bool;
  374. function EscapeCommFunction(Cid: Integer; Func: Integer): LongInt;
  375. function ExcludeClipRect(DC: HDC; X1, Y1, X2, Y2: Integer): Integer;
  376. function ExcludeUpdateRgn(DC: HDC; Wnd: HWnd): Integer;
  377. function ExitWindows(ReturnCode: LongInt; Reserved: Word): Bool;
  378. function ExtFloodFill(DC: HDC; X, Y: Integer; Color: TColorRef;
  379.   FillType: Word): Bool;
  380. function ExtTextOut(DC: HDC; X, Y: Integer; Options: Word;
  381.   Rect: PRect; Str: PChar; Count: Word; Dx: PInteger): Bool;
  382. procedure FatalAppExit(Action: Word; MessageText: PChar);
  383. procedure FatalExit(Code: Integer);
  384. function FillRect(DC: HDC; const Rect: TRect; Brush: HBrush): Integer;
  385. function FillRgn(DC: HDC; Rgn: HRgn; Brush: HBrush): Bool;
  386. function FindAtom(Str: PChar): TAtom;
  387. function FindResource(Instance: THandle; Name, ResType: PChar): THandle;
  388. function FindWindow(Classname, WindowName: PChar): HWnd;
  389. function FlashWindow(Wnd: HWnd; Invert: Bool): Bool;
  390. function FloodFill(DC: HDC; X, Y: Integer; Color: TColorRef): Bool;
  391. function FlushComm(Cid, Queue: Integer): Integer;
  392. procedure FrameRect(DC: HDC; const Rect: TRect; Brush: HBrush);
  393. function FrameRgn(DC: HDC; Rgn: HRgn; Brush: HBrush; Width,
  394.   Height: Integer): Bool;
  395. procedure FreeLibrary(LibModule: THandle);
  396. function FreeModule(Module: THandle): Bool;
  397. procedure FreeProcInstance(Proc: TFarProc);
  398. function FreeResource(ResData: THandle): Bool;
  399. function FreeSelector(Selector: Word): Word;
  400. function GetActiveWindow: HWnd;
  401. function GetAspectRatioFilter(DC: HDC): LongInt;
  402. function GetAsyncKeyState(Key: Integer): Integer;
  403. function GetAtomHandle(AnAtom: TAtom): THandle;
  404. function GetAtomName(AnAtom: TAtom; Buffer: PChar; Size: Integer): Word;
  405. function GetBitmapBits(Bitmap: HBitmap; Count: LongInt; 
  406.   Bits: Pointer): LongInt;
  407. function GetBitmapDimension(Bitmap: HBitmap): LongInt;
  408. function GetBkColor(DC: HDC): LongInt;
  409. function GetBkMode(DC: HDC): Integer;
  410. function GetBrushOrg(DC: HDC): LongInt;
  411. function GetCapture: HWnd;
  412. function GetCaretBlinkTime: Word;
  413. procedure GetCaretPos(var Point: TPoint);
  414. function GetCharWidth(DC: HDC; FirstChar, LastChar: Word;
  415.   var Buffer): Bool;
  416. function GetClassInfo(Instance: THandle; ClassInfo: PChar;
  417.   var WndClass: TWndClass): Bool;
  418. function GetClassLong(Wnd: HWnd; Index: Integer): LongInt;
  419. function GetClassName(Wnd: HWnd; ClassName: PChar; 
  420.   MaxCount: Integer): Integer;
  421. function GetClassWord(Wnd: HWnd; Index: Integer): Word;
  422. procedure GetClientRect(Wnd: HWnd; var Rect: TRect);
  423. function GetClipboardData(Format: Word): THandle;
  424. function GetClipboardFormatName(Format: Word; FormatName: PChar; 
  425.   MaxCount: Integer): Integer;
  426. function GetClipboardOwner: HWnd;
  427. function GetClipboardViewer: HWnd;
  428. function GetClipBox(DC: HDC; var Rect: TRect): Integer;
  429. function GetCodeHandle(Proc: TFarProc): THandle;
  430. procedure GetCodeInfo(Proc: TFarProc; SegInfo: Pointer);
  431. function GetCommError(Cid: Integer; var Stat: TComStat): Integer;
  432. function GetCommEventMask(Cid, EvtMask: Integer): Word;
  433. function GetCommState(Cid: Integer; var DCB: TDCB): Integer;
  434. function GetCurrentPDB: Word;
  435. function GetCurrentPosition(DC: HDC): LongInt;
  436. function GetCurrentTask: THandle;
  437. function GetCurrentTime: LongInt;
  438. procedure GetCursorPos(var Point: TPoint);
  439. function GetDC(Wnd: HWnd): HDC;
  440. function GetDCOrg(DC: HDC): LongInt;
  441. function GetDesktopHwnd: HWnd;
  442. function GetDesktopWindow: HWnd;
  443. function GetDeviceCaps(DC: HDC; Index: Integer): Integer;
  444. function GetDialogBaseUnits: LongInt;
  445. function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: Word; 
  446.   Bits: Pointer; var BitInfo: TBitmapInfo; Usage: Word): Integer;
  447. function GetDlgCtrlID(Wnd: HWnd): Integer;
  448. function GetDlgItem(Dlg: HWnd; IDDlgItem: Integer): HWnd;
  449. function GetDlgItemInt(Dlg: HWnd; IDDlgItem: Integer;
  450.   Translate: PBool; Signed: Bool): Word;
  451. function GetDlgItemText(Dlg: HWnd; IDDlgItem: Integer; Str: PChar;
  452.   MaxCount: Integer): Integer;
  453. function GetDOSEnvironment: PChar;
  454. function GetDoubleClickTime: Word;
  455. function GetDriveType(Drive: Integer): Word;
  456. function GetEnvironment(PortName: PChar; Environ: Pointer;
  457.   MaxCount: Word): Integer;
  458. function GetFocus: HWnd;
  459. function GetFreeSpace(Flag: Word): LongInt;
  460. function GetInputState: Bool;
  461. function GetKBCodePage: Integer;
  462. procedure GetKeyboardState(var KeyState: TKeyboardState);
  463. function GetKeyboardType(TypeFlag: Integer): Integer;
  464. function GetKeyNameText(lParam: LongInt; Buffer: PChar;
  465.   Size: Integer): Integer;
  466. function GetKeyState(VirtKey: Integer): Integer;
  467. function GetLastActivePopup(Owner: HWnd): HWnd;
  468. function GetMapMode(DC: HDC): Integer;
  469. function GetMenu(Wnd: HWnd): HMenu;
  470. function GetMenuCheckMarkDimensions: LongInt;
  471. function GetMenuItemID(Menu: HMenu; Pos: Integer): Word;
  472. function GetMenuState(Menu: HMenu; Id, Flags: Word): Word;
  473. function GetMenuString(Menu: HMenu; IDItem: Word; Str: PChar; 
  474.   MaxCount: Integer; Flag: Word): Integer;
  475. function GetMessage(var Msg: TMsg; Wnd: HWnd; MsgFilterMin,
  476.   MsgFilterMax: Word): Bool;
  477. function GetMessagePos: LongInt;
  478. function GetMessageTime: LongInt;
  479. function GetMetaFile(Filename: PChar): THandle;
  480. function GetMetaFileBits(MF: THandle): THandle;
  481. function GetModuleFileName(Module: THandle; Filename: PChar; Size: Integer): Integer;
  482. function GetModuleHandle(ModuleName: PChar): THandle;
  483. function GetModuleUsage(Module: THandle): Integer;
  484. function GetNearestColor(DC: HDC; Color: TColorRef): TColorRef;
  485. function GetNearestPaletteIndex(Palette: HPalette; Color: TColorRef): Word;
  486. function GetNextDlgGroupItem(Dlg, Ctl: HWnd; Previous: Bool): HWnd;
  487. function GetNextDlgTabItem(Dlg, Ctl: HWnd; Previous: Bool): HWnd;
  488. function GetNextWindow(Wnd: HWnd; Flag: Word): HWnd;
  489. function GetNumTasks: Word;
  490. function GetObject(hObject: THandle; Count: Integer;
  491.   lpObject: Pointer): Integer;
  492. function GetPaletteEntries(Palette: HPalette; StartIndex, NumEntries: Word;
  493.   var PaletteEntries): Word;
  494. function GetParent(Wnd: HWnd): HWnd;
  495. function GetPixel(DC: HDC; X, Y: Integer): TColorRef;
  496. function GetPolyFillMode(DC: HDC): Integer;
  497. function GetPriorityClipboardFormat(var PriorityList;
  498.   Count: Integer): Integer;
  499. function GetPrivateProfileInt(ApplicationName, KeyName: PChar; 
  500.   Default: Integer; FileName: PChar): Word;
  501. function GetPrivateProfileString(ApplicationName, KeyName: PChar; 
  502.   Default: PChar; ReturnedString: PChar; Size: Integer; 
  503.   FileName: PChar): Integer;
  504. function GetProcAddress(Module: THandle; ProcName: PChar): TFarProc;
  505. function GetProfileInt(AppName, KeyName: PChar; 
  506.   Default: Integer): Word;
  507. function GetProfileString(AppName, KeyName, Default, ReturnedString: PChar;
  508.   Size: Integer): Integer;
  509. function GetProp(Wnd: HWnd; Str: PChar): THandle;
  510. function GetRgnBox(Rgn: HRgn; var Rect: TRect): Integer;
  511. function GetROP2(DC: HDC): Integer;
  512. function GetScrollPos(Wnd: HWnd; Bar: Integer): Integer;
  513. procedure GetScrollRange(Wnd: HWnd; Bar: Integer; var MinPos,
  514.   MaxPos: Integer);
  515. function GetStockObject(Index: Integer): THandle;
  516. function GetStretchBltMode(DC: HDC): Integer;
  517. function GetSubMenu(Menu: HMenu; Pos: Integer): HMenu;
  518. function GetSysColor(Index: Integer): TColorRef;
  519. function GetSysModalWindow: HWnd;
  520. function GetSystemDirectory(Buffer: PChar; Size: Word): Word;
  521. function GetSystemMenu(Wnd: HWnd; bRevert: Bool): HMenu;
  522. function GetSystemMetrics(Index: Integer): Integer;
  523. function GetSystemPaletteEntries(DC: HDC; StartIndex, NumEntries: Word;
  524.   var PaletteEntries): Word;
  525. function GetSystemPaletteUse(DC: HDC): Word;
  526. function GetTabbedTextExtent(DC: HDC; Str: PChar; Count: Integer;
  527.   TabPostions: Integer; var TabStopPostions): LongInt;
  528. function GetTempDrive(DriveLetter: Char): Char;
  529. function GetTempFileName(DriveLetter: Char; PrefixString: PChar;
  530.   Unique: Word; TempFileName: PChar): Integer;
  531. function GetTextAlign(DC: HDC): Word;
  532. function GetTextCharacterExtra(DC: HDC): Integer;
  533. function GetTextColor(DC: HDC): TColorRef;
  534. function GetTextExtent(DC: HDC; Str: PChar; Count: Integer): LongInt;
  535. function GetTextFace(DC: HDC; Count: Integer; Facename: PChar): Integer;
  536. function GetTextMetrics(DC: HDC; var Metrics: TTextMetric): Bool;
  537. function GetThresholdEvent: PInteger;
  538. function GetThresholdStatus: Integer;
  539. function GetTickCount: LongInt;
  540. function GetTopWindow(Wnd: HWnd): HWnd;
  541. function GetUpdateRect(Wnd: HWnd; var Rect: TRect; Erase: Bool): Bool;
  542. function GetUpdateRgn(Wnd: HWnd; Rgn: HRgn; Erase: Bool): Integer;
  543. function GetVersion: LongInt;
  544. function GetViewportExt(DC: HDC): LongInt;
  545. function GetViewportOrg(DC: HDC): LongInt;
  546. function GetWindow(Wnd: HWnd; Cmd: Word): HWnd;
  547. function GetWindowDC(Wnd: HWnd): HDC;
  548. function GetWindowExt(DC: HDC): LongInt;
  549. function GetWindowLong(Wnd: HWnd; Index: Integer): LongInt;
  550. function GetWindowOrg(DC: HDC): LongInt;
  551. procedure GetWindowRect(Wnd: HWnd; var Rect: TRect);
  552. function GetWindowsDirectory(Buffer: PChar; Size: Word): Word;
  553. function GetWindowTask(Wnd: HWnd): THandle;
  554. function GetWindowText(Wnd: HWnd; Str: PChar;
  555.   MaxCount: Integer): Integer;
  556. function GetWindowTextLength(Wnd: HWnd): Integer;
  557. function GetWindowWord(Wnd: HWnd; Index: Integer): Word;
  558. function GetWinFlags: LongInt;
  559. function GlobalAddAtom(Str: PChar): TAtom;
  560. function GlobalAlloc(Flags: Word; Bytes: LongInt): THandle;
  561. function GlobalCompact(MinFree: LongInt): LongInt;
  562. function GlobalDeleteAtom(AnAtom: TAtom): TAtom;
  563. function GlobalDiscard(Mem: THandle): THandle;
  564. function GlobalDosAlloc(Bytes: LongInt): LongInt;
  565. function GlobalDosFree(Selector: Word): Word;
  566. function GlobalFindAtom(Str: PChar): TAtom;
  567. procedure GlobalFix(Mem: THandle);
  568. function GlobalFlags(Mem: THandle): Word;
  569. function GlobalFree(Mem: THandle): THandle;
  570. function GlobalGetAtomName(AnAtom: TAtom; Buffer: PChar; Size: Integer): Word;
  571. function GlobalHandle(Mem: Word): LongInt;
  572. function GlobalLock(Mem: THandle): Pointer;
  573. function GlobalLRUNewest(Mem: THandle): THandle;
  574. function GlobalLRUOldest(Mem: THandle): THandle;
  575. procedure GlobalNotify(NotifyProc: TFarProc);
  576. function GlobalPageLock(Selector: THandle): Word;
  577. function GlobalPageUnlock(Selector: THandle): Word;
  578. function GlobalReAlloc(Mem: THandle; Bytes: LongInt; Flags: Word): THandle;
  579. function GlobalSize(Mem: THandle): LongInt;
  580. function GlobalUnlock(Mem: THandle): Bool;
  581. function GlobalUnWire(Mem: THandle): Bool;
  582. function GlobalWire(Mem: THandle): Pointer;
  583. function GrayString(DC: HDC; Brush: HBrush; OutputFunc: TFarProc; 
  584.   Data: LongInt; Count, X, Y, Width, Height: Integer): Bool;
  585. procedure HideCaret(Wnd: HWnd);
  586. function HiliteMenuItem(Wnd: HWnd; Menu: HMenu; IDHilite, 
  587.   Hilite: Word): Bool;
  588. procedure InflateRect(var Rect: TRect; X, Y: Integer);
  589. function InitAtomTable(Size: Integer): Bool;
  590. function InSendMessage: Bool;
  591. function InsertMenu(Menu: HMenu; Position, Flags, IDNewItem: Word;
  592.   NewItem: PChar): Bool;
  593. function IntersectClipRect(DC: HDC; X1, Y1, X2, Y2: Integer): Integer;
  594. function IntersectRect(var DestRect: TRect;
  595.   const Src1Rect, Src2Rect: TRect): Integer;
  596. procedure InvalidateRect(Wnd: HWnd; Rect: PRect; Erase: Bool);
  597. procedure InvalidateRgn(Wnd: HWnd; Rgn: HRgn; Erase: Bool);
  598. procedure InvertRect(DC: HDC; var Rect: TRect);
  599. function InvertRgn(DC: HDC; Rgn: HRgn): Bool;
  600. function IsCharAlpha(Chr: Char): Bool;
  601. function IsCharAlphaNumeric(Chr: Char): Bool;
  602. function IsCharLower(Chr: Char): Bool;
  603. function IsCharUpper(Chr: Char): Bool;
  604. function IsChild(WndParent, Wnd: HWnd): Bool;
  605. function IsClipboardFormatAvailable(Format: Word): Bool;
  606. function IsDialogMessage(Dlg: HWnd; var Msg: TMsg): Bool;
  607. function IsDlgButtonChecked(Wnd: HWnd; IDButton: Integer): Word;
  608. function IsIconic(Wnd: HWnd): Bool;
  609. function IsRectEmpty(const Rect: TRect): Bool;
  610. function IsTwoByteCharPrefix(Chr: Char): Bool;
  611. function IsWindow(Wnd: HWnd): Bool;
  612. function IsWindowEnabled(Wnd: HWnd): Bool;
  613. function IsWindowVisible(Wnd: HWnd): Bool;
  614. function IsZoomed(Wnd: HWnd): Bool;
  615. function KillTimer(Wnd: HWnd; IDEvent: Integer): Bool;
  616. procedure LimitEmsPages(Kbytes: LongInt);
  617. procedure LineDDA(X1, Y1, X2, Y2: Integer; LineFunc: TFarProc; 
  618.   Data: Pointer);
  619. function LineTo(DC: HDC; X, Y: Integer): Bool;
  620. function LoadAccelerators(Instance: THandle; TableName: PChar): THandle;
  621. function LoadBitmap(Instance: THandle; BitmapName: PChar): HBitmap;
  622. function LoadCursor(Instance: THandle; CursorName: PChar): HCursor;
  623. function LoadIcon(Instance: THandle; IconName: PChar): HIcon;
  624. function LoadLibrary(LibFileName: PChar): THandle;
  625. function LoadMenu(Instance: THandle; MenuName: PChar): HMenu;
  626. function LoadMenuIndirect(MenuTemplate: Pointer): HMenu;
  627. function LoadModule(ModuleName: PChar; ParameterBlock: Pointer): THandle;
  628. function LoadResource(Instance: THandle; ResInfo: THandle): THandle;
  629. function LoadString(Instance: THandle; ID: Word; Buffer: PChar; 
  630.   BufferMax: Integer): Integer;
  631. function LocalAlloc(Flags, Bytes: Word): THandle;
  632. function LocalCompact(MinFree: Word): Word;
  633. function LocalDiscard(Mem: THandle): THandle; 
  634. function LocalFlags(Mem: THandle): Word;
  635. function LocalFree(Mem: THandle): THandle;
  636. function LocalHandle(Mem: Word): THandle;
  637. function LocalInit(Segment, Start, EndPos: Word): Bool;
  638. function LocalLock(Mem: THandle): Pointer;
  639. function LocalNotify(NotifyProc: TFarProc): TFarProc;
  640. function LocalReAlloc(Mem: THandle; Bytes, Flags: Word): THandle;
  641. function LocalShrink(Seg: THandle; Size: Word): Word;
  642. function LocalSize(Mem: THandle): Word;
  643. function LocalUnlock(Mem: THandle): Bool;
  644. function LockData(Dummy: Integer): THandle;
  645. function LockResource(ResData: THandle): Pointer;
  646. function LockSegment(Segment: Word): THandle;
  647. function LPtoDP(DC: HDC; var Points; Count: Integer): Bool;
  648. function lstrcat(Str1, Str2: PChar): PChar;
  649. function lstrcmp(Str1, Str2: PChar): Integer;
  650. function lstrcmpi(Str1, Str2: PChar): Integer;
  651. function lstrcpy(Str1, Str2: PChar): PChar;
  652. function lstrlen(Str: PChar): Integer;
  653. function MakeProcInstance(Proc: TFarProc; Instance: THandle): TFarProc;
  654. procedure MapDialogRect(Dlg: HWnd; var Rect: TRect);
  655. function MapVirtualKey(Code, MapType: Word): Word;
  656. procedure MessageBeep(BeepType: Word);
  657. function MessageBox(WndParent: HWnd; Txt, Caption: PChar; 
  658.   TextType: Word): Integer;
  659. function ModifyMenu(Menu: HMenu; Position, Flags, IDNewItem: Word; 
  660.   NewItem: PChar): Bool;
  661. function MoveTo(DC: HDC; X, Y: Integer): LongInt;
  662. procedure MoveWindow(Wnd: HWnd; X, Y, Width, Height: Integer; Repaint: Bool);
  663. function MulDiv(Number: Integer; Numerator: Integer;
  664.   Denominator: Integer): Integer;
  665. procedure NetBIOSCall;
  666. function OemKeyScan(OemChar: Word): LongInt;
  667. function OffsetClipRgn(DC: HDC; X, Y: Integer): Integer;
  668. procedure OffsetRect(var Rect: TRect; X, Y: Integer);
  669. function OffsetRgn(Rgn: HRgn; X, Y: Integer): Integer;
  670. function OffsetViewportOrg(DC: HDC; X, Y: Integer): LongInt;
  671. function OffsetWindowOrg(DC: HDC; X, Y: Integer): LongInt;
  672. function OpenClipboard(Wnd: HWnd): Bool;
  673. function OpenComm(ComName: PChar; InQueue, OutQueue: Word): Integer;
  674. function OpenFile(FileName: PChar; var ReOpenBuff: TOfStruct;
  675.   Style: Word): Integer;
  676. function OpenIcon(Wnd: HWnd): Bool;
  677. function OpenSound: Integer;
  678. procedure OutputDebugString(OutputString: PChar);
  679. function PaintRgn(DC: HDC; Rgn: HRgn): Bool;
  680. function PatBlt(DC: HDC; X, Y, Width, Height: Integer; Rop: LongInt): Bool;
  681. function PeekMessage(var Msg: TMsg; Wnd: HWnd; MsgFilterMin,
  682.   MsgFilterMax: Word; RemoveMsg: Word): Bool;
  683. function Pie(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): Bool;
  684. function PlayMetaFile(DC: HDC; MF: THandle): Bool;
  685. procedure PlayMetaFileRecord(DC: HDC; var HandleTable: THandleTable;
  686.   var MetaRecord: TMetaRecord; Handles: Word);
  687. function Polygon(DC: HDC; var Points; Count: Integer): Bool;
  688. function Polyline(DC: HDC; var Points; Count: Integer): Bool;
  689. function PolyPolygon(DC: HDC; var Points; var PolyCounts;
  690.   Count: Integer): Bool;
  691. function PostAppMessage(Task: THandle; Msg, wParam: Word; 
  692.   lParam: LongInt): Bool;
  693. function PostMessage(Wnd: HWnd; Msg, wParam: Word; lParam: LongInt): Bool;
  694. procedure PostQuitMessage(ExitCode: Integer);
  695. function PtInRect(const Rect: TRect; Point: TPoint): Bool;
  696. function PtInRegion(Rgn: HRgn; X, Y: Integer): Bool;
  697. function PtVisible(DC: HDC; X, Y: Integer): Bool;
  698. function ReadComm(Cid: Integer; Buf: PChar; Size: Integer): Integer;
  699. function RealizePalette(DC: HDC): Word;
  700. function Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): Bool;
  701. function RectInRegion(Rgn: HRgn; const Rect: TRect): Bool;
  702. function RectVisible(DC: HDC; const Rect: TRect): Bool;
  703. function RegisterClass(var WndClass: TWndClass): Bool;
  704. function RegisterClipboardFormat(FormatName: PChar): Word;
  705. function RegisterWindowMessage(Str: PChar): Word;
  706. procedure ReleaseCapture;
  707. function ReleaseDC(Wnd: HWnd; DC: HDC): Integer;
  708. function RemoveFontResource(Filename: PChar): Bool;
  709. function RemoveMenu(Menu: HMenu; Position, Flags: Word): Bool;
  710. function RemoveProp(Wnd: HWnd; Str: PChar): THandle;
  711. procedure ReplyMessage(Reply: LongInt);
  712. function ResizePalette(Palette: HPalette; NumEntries: Word): Bool;
  713. function RestoreDC(DC: HDC; SavedDC: Integer): Bool;
  714. function RoundRect(DC: HDC; X1, Y1, X2, Y2, X3, Y3: Integer): Bool;
  715. function SaveDC(DC: HDC): Integer;
  716. function ScaleViewportExt(DC: HDC; Xnum, Xdenom, Ynum,
  717.   Ydenom: Integer): LongInt;
  718. function ScaleWindowExt(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer): LongInt;
  719. procedure ScreenToClient(Wnd: HWnd; var Point: TPoint);
  720. function ScrollDC(DC: HDC; dx, dy: Integer; const Scroll, Clip: TRect;
  721.   UpdateRgn: HRgn; UpdateRect: PRect): Bool;
  722. procedure ScrollWindow(Wnd: HWnd; XAmount, YAmount: Integer; Rect: PRect;
  723.   ClipRect: PRect);
  724. function SelectClipRgn(DC: HDC; Rgn: HRgn): Integer;
  725. function SelectObject(DC: HDC; hObject: THandle): THandle;
  726. function SelectPalette(DC: HDC; Palette: HPalette; 
  727.   ForceBackground: Bool): HPalette;
  728. function SendDlgItemMessage(Dlg: HWnd; IDDlgItem: Integer; Msg, wParam: Word; 
  729.   lParam: LongInt): LongInt;
  730. function SendMessage(Wnd: HWnd; Msg, wParam: Word; lParam: LongInt): LongInt;
  731. function SetActiveWindow(Wnd: HWnd): HWnd;
  732. function SetBitmapBits(Bitmap: HBitmap; Count: LongInt; Bits: Pointer): LongInt;
  733. function SetBitmapDimension(Bitmap: HBitmap; X, Y: Integer): LongInt;
  734. function SetBkColor(DC: HDC; Color: TColorRef): TColorRef;
  735. function SetBkMode(DC: HDC; BkMode: Integer): Integer;
  736. function SetBrushOrg(DC: HDC; X, Y: Integer): LongInt;
  737. function SetCapture(Wnd: HWnd): HWnd;
  738. procedure SetCaretBlinkTime(MSeconds: Word);
  739. procedure SetCaretPos(X, Y: Integer);
  740. function SetClassLong(Wnd: HWnd; Index: Integer; NewLong: LongInt): LongInt;
  741. function SetClassWord(Wnd: HWnd; Index: Integer; NewWord: Word): Word;
  742. function SetClipboardData(Format: Word; Mem: THandle): THandle;
  743. function SetClipboardViewer(Wnd: HWnd): HWnd;
  744. function SetCommBreak(Cid: Integer): Integer;
  745. function SetCommEventMask(Cid: Integer; EvtMask: Word): PWord;
  746. function SetCommState(var DCB: TDCB): Integer;
  747. function SetCursor(Cursor: HCursor): HCursor;
  748. procedure SetCursorPos(X, Y: Integer);
  749. function SetDIBits(DC: HDC; Bitmap: THandle; StartScan, NumScans: Word;
  750.   Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: Word): Integer;
  751. function SetDIBitsToDevice(DC: HDC; DestX, DestY, Width, Height, SrcX, SrcY,
  752.   nStartScan, NumScans: Word; Bits: Pointer; var BitsInfo: TBitmapInfo;
  753.   Usage: Word): Integer;
  754. procedure SetDlgItemInt(Dlg: HWnd; IDDlgItem: Integer; Value: Word;
  755.   Signed: Bool);
  756. procedure SetDlgItemText(Dlg: HWnd; IDDlgItem: Integer; Str: PChar);
  757. procedure SetDoubleClickTime(Count: Word);
  758. function SetEnvironment(PortName: PChar; Environ: Pointer; 
  759.   Count: Word): Integer;
  760. function SetErrorMode(Mode: Word): Word;
  761. function SetFocus(Wnd: HWnd): HWnd;
  762. function SetHandleCount(Number: Word): Word;
  763. procedure SetKeyboardState(var KeyState: TKeyboardState);
  764. function SetMapMode(DC: HDC; MapMode: Integer): Integer;
  765. function SetMapperFlags(DC: HDC; Flag: LongInt): LongInt;
  766. function SetMenu(Wnd: HWnd; Menu: HMenu): Bool;
  767. function SetMenuItemBitmaps(Menu: HMenu; Position, Flags: Word; 
  768.   BitmapUnchecked, BitmapChecked: HBitmap): Bool;
  769. function SetMessageQueue(Msg: Integer): Bool;
  770. function SetMetaFileBits(Mem: THandle): THandle;
  771. function SetPaletteEntries(Palette: HPalette; StartIndex, NumEntries: Word;
  772.   var PaletteEntries): Word;
  773. function SetParent(WndChild: HWnd; WndNewParent: HWnd): HWnd;
  774. function SetPixel(DC: HDC; X, Y: Integer; Color: TColorRef): LongInt;
  775. function SetPolyFillMode(DC: HDC; PolyFillMode: Integer): Integer;
  776. function SetProp(Wnd: HWnd; Str: PChar; Data: THandle): Bool;
  777. procedure SetRect(var Rect: TRect; X1, Y1, X2, Y2: Integer);
  778. procedure SetRectEmpty(var Rect: TRect);
  779. procedure SetRectRgn(Rgn: HRgn; X1, Y1, X2, Y2: Integer);
  780. function SetROP2(DC: HDC; DrawMode: Integer): Integer;
  781. function SetScrollPos(Wnd: HWnd; Bar, Pos: Integer; Redraw: Bool): Integer;
  782. procedure SetScrollRange(Wnd: HWnd; Bar, MinPos, MaxPos: Integer; 
  783.   Redraw: Bool);
  784. function SetSoundNoise(Source, Duration: Integer): Integer;
  785. function SetStretchBltMode(DC: HDC; StretchMode: Integer): Integer;
  786. function SetSwapAreaSize(Size: Word): LongInt;
  787. procedure SetSysColors(Changes: Integer; var SysColor; var ColorValues);
  788. function SetSysModalWindow(Wnd: HWnd): HWnd;
  789. function SetSystemPaletteUse(DC: HDC; Usage: Word): Word;
  790. function SetTextAlign(DC: HDC; Flags: Word): Word;
  791. function SetTextCharacterExtra(DC: HDC; CharExtra: Integer): Integer;
  792. function SetTextColor(DC: HDC; Color: TColorRef): TColorRef;
  793. function SetTextJustification(DC: HDC; BreakExtra, 
  794.   BreakCount: Integer): Integer;
  795. function SetTimer(Wnd: HWnd; IDEvent: Integer; Elapse: Word; 
  796.   TimerFunc: TFarProc): Word;
  797. function SetViewportExt(DC: HDC; X, Y: Integer): LongInt;
  798. function SetViewportOrg(DC: HDC; X, Y: Integer): LongInt;
  799. function SetVoiceAccent(Voice, Tempo, Volume, Mode, Pitch: Integer): Integer;
  800. function SetVoiceEnvelope(Voice, Shape, RepeatCount: Integer): Integer;
  801. function SetVoiceNote(Voice, Value, Length, Cdots: Integer): Integer;
  802. function SetVoiceQueueSize(Voice, Bytes: Integer): Integer;
  803. function SetVoiceSound(Voice: Integer; Frequency: LongInt; 
  804.   Duration: Integer): Integer;
  805. function SetVoiceThreshold(Voice, Notes: Integer): Integer;
  806. function SetWindowExt(DC: HDC; X, Y: Integer): LongInt;
  807. function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: LongInt): LongInt;
  808. function SetWindowOrg(DC: HDC; X, Y: Integer): LongInt;
  809. procedure SetWindowPos(Wnd: HWnd; WndInsertAfter: HWnd; X, Y, cx, cy: Integer;
  810.   Flags: Word);
  811. function SetWindowsHook(FilterType: Integer; FilterFunc: TFarProc): TFarProc;
  812. procedure SetWindowText(Wnd: HWnd; Str: PChar);
  813. function SetWindowWord(Wnd: HWnd; Index: Integer; NewWord: Word): Word;
  814. procedure ShowCaret(Wnd: HWnd);
  815. function ShowCursor(Show: Bool): Integer;
  816. procedure ShowOwnedPopups(Wnd: HWnd; Show: Bool);
  817. procedure ShowScrollBar(Wnd: HWnd; Bar: Word; Show: Bool);
  818. function ShowWindow(Wnd: HWnd; CmdShow: Integer): Bool;
  819. function SizeofResource(Instance, ResInfo: THandle): LongInt;
  820. function StartSound: Integer;
  821. function StopSound: Integer;
  822. function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; 
  823.   XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: LongInt): Bool;
  824. function StretchDIBits(DC: HDC; DestX, DestY, DestWidth, DestHegiht, SrcX, 
  825.   SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo;
  826.   Usage: Word; Rop: LongInt): Integer;
  827. function SwapMouseButton(Swap: Bool): Bool;
  828. procedure SwapRecording(Flag: Word);
  829. procedure SwitchStackBack;
  830. procedure SwitchStackTo(StackSegment, StackPointer, StackTop: Word);
  831. function SyncAllVoices: Integer;
  832. function TabbedTextOut(HC: HDC; X, Y: Integer; Str: PChar; Count: Integer; 
  833.   TabPositions: Integer; var TabStopPositions; TabOrigin: Integer): LongInt;
  834. function TextOut(DC: HDC; X, Y: Integer; Str: PChar; Count: Integer): Bool;
  835. procedure Throw(var CatchBuf: TCatchBuf; ThrowBack: Integer);
  836. function ToAscii(VirtKey, ScanCode: Word; KeyState: PChar; Char: Pointer; 
  837.   Flags: Word): integer;
  838. function TrackPopupMenu(Menu: HMenu; Flags: Word; x, y, Reserved: Integer; 
  839.   Wnd: HWnd; Reserved: Pointer): Bool;
  840. function TranslateAccelerator(Wnd: HWnd; AccTable: THandle;
  841.   var Msg: TMsg): Integer;
  842. function TranslateMDISysAccel(Wnd: HWnd; var Msg: TMsg): Bool;
  843. function TranslateMessage(var Msg: TMsg): Bool;
  844. function TransmitCommChar(Cid: Integer; Chr: Char): Integer;
  845. function UngetCommChar(Cid: Integer; Chr: Char): Integer;
  846. function UnhookWindowsHook(Hook: Integer; HookFunc: TFarProc): Bool;
  847. function UnionRect(var DestRect: TRect;
  848.   const Src1Rect, Src2Rect: TRect): Integer;
  849. function UnlockData(Dummy: Integer): THandle;
  850. function UnlockResource(ResData: THandle): Bool;
  851. function UnrealizeObject(hObject: HBrush): Bool;
  852. function UnregisterClass(ClassName: PChar; Instance: THandle): Bool;
  853. function UpdateColors(DC: HDC): Integer;
  854. procedure UpdateWindow(Wnd: HWnd);
  855. procedure ValidateCodeSegments;
  856. procedure ValidateFreeSpaces;
  857. procedure ValidateRect(Wnd: HWnd; Rect: PRect);
  858. procedure ValidateRgn(Wnd: HWnd; Rgn: HRgn);
  859. function VkKeyScan(Chr: Word): Word;
  860. procedure WaitMessage;
  861. function WaitSoundState(State: Integer): Integer;
  862. function WindowFromPoint(Point: TPoint): HWnd;
  863. function WinExec(CmdLine: PChar; CmdShow: Word): Word;
  864. function WinHelp(Wnd: HWnd; HelpFile: PChar; Command: Word; 
  865.   Data: LongInt): Bool;
  866. function WriteComm(Cid: Integer; Buf: PChar; Size: Integer): Integer;
  867. function WritePrivateProfileString(ApplicationName, KeyName, Str,
  868.   FileName: PChar): Bool;
  869. function WriteProfileString(ApplicationName, KeyName, Str: PChar): Bool;
  870. function wvsprintf(DestStr, Format: PChar; var ArgList): Integer;
  871. function Yield: Bool;
  872. function _lclose(FileHandle: Integer): Integer;
  873. function _lcreat(PathName: PChar; Atribute: Integer): Integer;
  874. function _llseek(FileHandle: Integer; Offset: LongInt;
  875.   Origin: Integer): LongInt;
  876. function _lopen(PathName: PChar; ReadWrite: Integer): Integer;
  877. function _lread(FileHandle: Integer; Buffer: PChar; Bytes: Integer): Word;
  878. function _lwrite(FileHandle: Integer; Buffer: PChar; Bytes: Integer): Word;
  879.  
  880. { Various inline and wrapper routines }
  881.  
  882. function MakeLong(A, B: Word): LongInt;
  883. inline(
  884.   $5A/    { POP DX }
  885.   $58);   { POP AX }
  886.  
  887. function LoWord(A: LongInt): Word;
  888. inline(
  889.   $58/    { POP AX }
  890.   $5A);   { POP DX }
  891.  
  892. function HiWord(A: LongInt): Word;
  893. inline(
  894.   $5A/    { POP DX }
  895.   $58);   { POP AX }
  896.  
  897. function LoByte(A: Word): Byte;
  898. inline(
  899.   $58/       { POP AX    }
  900.   $32/$E4);  { XOR AH,AH }
  901.  
  902. function HiByte(A: Word): Byte;
  903. inline(
  904.   $58/       { POP AX    }
  905.   $8A/$C4/   { MOV AL,AH }
  906.   $32/$E4);  { XOR AH,AH }
  907.  
  908. function RGB(R: Byte; G: Byte; B: Byte): LongInt;
  909. inline(
  910.   $5A/       { POP DX    }
  911.   $5B/       { POP BX    }
  912.   $58/       { POP AX    }
  913.   $8A/$E3/   { MOV AH,BL }
  914.   $32/$F6);  { XOR DH,DH }
  915.  
  916. function PaletteRGB(R: Byte; G: Byte; B: Byte): LongInt;
  917. inline(
  918.   $5A/       { POP DX    }
  919.   $5B/       { POP BX    }
  920.   $58/       { POP AX    }
  921.   $8A/$E3/   { MOV AH,BL }
  922.   $B6/$02);  { MOV DH,2  }
  923.  
  924. function GetRValue(RGB: LongInt): Byte;
  925. inline(
  926.   $58/       { POP AX    }
  927.   $5A/       { POP DX    }
  928.   $32/$E4);  { XOR AH,AH }
  929.  
  930. function GetGValue(RGB: LongInt): Byte;
  931. inline(
  932.   $58/       { POP AX    }
  933.   $5A/       { POP DX    }
  934.   $8A/$C4/   { MOV AL,AH }
  935.   $32/$E4);  { XOR AH,AH }
  936.  
  937. function GetBValue(RGB: LongInt): Byte;
  938. inline(
  939.   $5A/       { POP DX    }
  940.   $58/       { POP AX    }
  941.   $32/$E4);  { XOR AH,AH }
  942.  
  943. function PaletteIndex(PaletteIndex: Integer): TColorRef;
  944. inline(
  945.   $58/            { POP AX      }
  946.   $BA/$00/$01); { MOV DX,$100 }
  947.  
  948. implementation
  949.