| Delphi Graphics: Win 32 API |
API
Calls
Windows Messages
Windows API Tips and Tricks
Other Windows API Resources
![]() |
in |
|
look for | Delphi
Graphics Delphi Graphics |
|
API Calls |
|
Also see |
| - Project JEDI API
Conversion Library Graded Packs
Marcel's homepage contains the current version, the JEDI page mostly a previous version. http://members.chello.nl/m.vanbrakel2 |
| - API Conversion on the JEDI+ homepage: http://jediplus.pjh2.de/index.php |
| - the Delphi RTL Routines |
| Not all API functions are listed here: only the most common and most likely to be used are here. Delphi does a wonderful job in hiding much of the Windows complexity, so you can focus on the real problem you're trying to solve. I try only to use an API call when Delphi is lacking some feature. For example, why use the LineTo API call when the Canvas.LineTo method is much simpler to use? Or why use API calls to set a Pen Style when the Delphi VCL wraps all the API functionality in a simpler-to-use package? |
| Graphical API | Core API | ||
![]() |
Amazon Link |
![]() |
Amazon Link |
| API Call/ Structure | Description/Comments |
| AddFontResource, RemoveFontResource |
Adding TrueType fonts to windows in code (FAQ 2537D) |
| AnimatePalette | Tomes Graphical,
pp. 408-411 Delphi 2 Multimedia, pp. 311-318 to Edit the Palette, pp. 322-330 for Marquee lights AnimatePalette is for 256-color mode only. See Ray Lischner's example of palette animation at www.tempest-sw.com/freeware/Delphi/pal10.zip or via ftp at ftp://ftp.tempest-sw.com/pub/delphi/pal10.zip "Palettes Made Plain" by Ray Lischner in the July 1998 Delphi Informant,
pp. 34-43. Excellent article explaining basics of Windows palettes. Shows gradient palette
and palette animation demo. See Microsoft's Simulating Palette Animation on Non-Palette Displays: See |
| BeginPath | How do I use Paths and Geometric Pens? (FAQ 2724D)
Steve Schafer's UseNet Post with BeginPath/CloseFigure/EndPath/StrokeAndFillPath example Wayne Sherman's UseNet Post with BeginPath/DrawText/EndPath example |
| BitBlt | Henrik Palmér's UseNet
Post about a transparency solution using BitBlt twice
Harm's UseNet Post with FillAndBlitRect example procedure Copies bits from one device context to another. Tomes
Graphical, pp. 283-285.
Blitting Between
DCs for Different Devices Is Unsupported (MS Q195830) |
| ChangeDisplaySettings | The book The Tomes of Delphi 3: Win32 Graphical API
says (p. 23) that Delphi imports ChangeDisplaySettings incorrectly, so you need
to manually import it. The book shows a unit with this in the Interface function ChangeDisplaySettings(lpDevMode: PDeviceMode; dwFlags: DWORD): LongInt; stdcall; and this in the Implementation: function ChangeDisplaySettings; external user32 name 'ChangeDisplaySettingsA'; Changing the display mode settings in code (FAQ 735D) How to change video modes Davie Reed's UseNet Post with Example Time for a Change, PC Magazine, Sept 22, 98, p. 251-254: VB code to list available resolutions and change screen resolution using ChangeDisplaySettings |
| ClientToScreen | VAR BasePoint: TPoint; ... BasePoint := Image.ScreenToClient( ClientToScreen( Point(Bevel1.Left, Bevel1.Top)) ); |
| ClipCursor | RestrictCursorToDrawingArea and RemoveCursorRestrictions. For a complete example, see efg's Line Stretch Lab Report. |
| CloseFigure | Steve Schafer's UseNet Post with BeginPath/CloseFigure/EndPath/StrokeAndFillPath example |
| CombineRgn | Use CombineRgn to get the intersection of two regions.
See Lou's UseNet Post.
Ventanas de formas irregulares (Spanish) efg's Printer Demo #2 Lab Report |
| CopyCursor | CopyCursor (FAQ 1067D) |
| CopyIcon | CopyCursor (FAQ 1067D) |
| CreateBitmap | Creates a new bitmap with the specified width, height, and color depth. Tomes Graphical, pp. 289-291. |
| CreateBrushIndirect | How to create a brush using CreateBrushIndirect www.lmc-mediaagentur.de/dpool/tips04/0393.htm |
| CreateCompatibleBitmap | A better way to print a form (TI 1412D) |
| CreateEllipticRgn |
efg's Printer Demo #2 Lab Report |
| CreateHalftonePalette | Tomes Graphical, pp. 412-413 |
| CreateDIBitmap | Creates a device-dependent bitmap (DDB) based on the
attributes and image of the specified device-independent bitmap. Creating a bitmap from a pixel array (FAQ 1205D) |
| CreateDIBSection | Creates a Device Independent Bitmap (DIB) |
| CreateFontIndirect | Creates a logical font matching the specified font
attributes. Used to create a rotated font. Tomes Graphical,
pp. 477-483. "Drawing text at different angles," pp. 295-297, Delphi Programming Problem Solver, Neil Rubenking. Chris Hill's UseNet
Post about Antialiased Fonts Creating a rotated font (FAQ 615D) |
| CreateIconIndirect | How do I create an icon from a bitmap? (FAQ 2748D) How to
Create a Cursor from a Bitmap |
| CreatePalette | Creating a palette with more than one entry (FAQ 890D) Creating a bitmap from a pixel array (FAQ 1205D) Tomes Graphical,
pp. 414-420 See \Program Files\Borland\ Delphin\HELP\Examples\Bitmap\BMPFormU.PAS See: |
| CreatePen | Draw On Frame (FAQ 1079D) |
| CreatePolygonRgn | How to Implement Weird Shaped Windows www.developers.demon.co.uk/wierd.html Colin Sarsfield's UsetNet Post with an example How to Make a Polygonal Splash Screen by Michael Barnes www.undu.com/DN970101/00000006.htm How to make a triangular form |
| CreatePolyPolygon |
Chris Hill's UseNet Post with Example |
| CreateRectRgn |
efg's Printer Demo #2 Lab Report |
| CreateRectRgnIndirect | Sergey Prilutsky's "Using Clipping Regions for Faster GDI Drawing" |
| DeleteDC | Creating a bitmap from a pixel array (FAQ 1205D) |
| DeleteObject | Non VCL Bitmap buffering (FAQ 2774D) |
| DrawEllipse | TShape descendant that has a star shape and has
OnMouseEnter/Leave handlers Eddie Shipman's UseNet Post |
| DrawFocusRect | Selection rectangle (FAQ 1073D)
Claire Humphrey's UseNet Post with DrawFocusRect example David Lively in UseNet Posting: "DrawFocusRect uses an XOR to draw the rectangle. A second draw to the same coordinates will restore the background contents: A XOR B XOR B == A" |
| DrawIcon | Displaying a file's associated icon (FAQ 2646D) Creating a resource only DLL (FAQ 1595D) |
| DrawIconEx | How to Create BMP files for Standard Cursors see Cursors on efg's Delphi Graphics Algorithm page Kerstin Thaler's UseNet Post with example efg's ShowCursor
example of displaying cursor at any position on screen efg's |
| DrawRoundRect | TShape descendant that has a star shape and has
OnMouseEnter/Leave handlers Eddie Shipman's UseNet Post |
| DrawText DrawTextEx DrawTextParams |
Easiest way to implement word wrap
Mauro Patiño's UseNet Post explaining how to use an OnDrawCell to make the fixed row font and text centering different than the remainder of the rows in a TStringGrid component How can I have a TBitBtn component that has word-wrapped caption? (FAQ 1754D) Colin Wilson's UseNet Post about DrawTextParams and DrawTextEx Harm's UseNet Post about using DrawText |
| Ellipse | Non VCL Bitmap buffering (FAQ 2774D) |
| EndPath | see BeginPath |
| EnumDisplayDevices | Obtain information about the display devices in
a system Nemesis' UseNet Post with example http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/gdi/devcons_2303.htm |
| EnumDisplaySettings | Changing the display mode settings in code (FAQ 735D) How to enumerate video modes PC Magazine, Sept 22, 98, p. 254: VB code to list available resolutions (and change screen resolution) |
| EqualRect | |
| ExtCreatePen | Create a geometric pen style. Joe Hecht's UseNet Post with
example See Listing 7 in efg's Image Feathering Lab Report How do I use Paths and Geometric Pens? (FAQ 2724D) ExtCreatePen info from Microsoft |
| ExtractAssociatedIcon | Displaying a file's associated icon (FAQ 2646D) |
| ExtractIcon | Extracting an icon from a .EXE or .DLL (FAQ 2458D) Using an icon as the glyph in a TSpeedButton (FAQ 2122D) Kerstin Thaler's UseNet Post with example |
| ExtractIconEx | Extracting Icons (FAQ 1778D) Kerstin Thaler's UseNet Post with example |
| ExtSelectClipRgn | Sergey Prilutsky's "Using Clipping Regions for Faster GDI Drawing" |
| FindResource | Using JPEGs from resource files (FAQ 1882D) Loading bitmaps and cursors from RES files (TI 1081D) |
| FlashWindow | Creating a flashing icon (FAQ 1103D)
|
| FreeLibrary | Creating a resource only DLL (FAQ 1595D) |
| FreeResource | Using JPEGs from resource files (FAQ 1882D) |
| GetCursorInfo | Use GetCursorInfo to get the current cursor
image no matter which window is active
efg's ShowCursor
example of displaying cursor at any position on screen |
| GetCursorPos | How can I easily move a Window control at runtime (FAQ 896D) Simulating a mouse move in code (FAQ 2871D) efg's ShowCursor
example of displaying cursor at any position on screen |
| GetDC | Non VCL Bitmap buffering (FAQ 2774D) How can I draw directly on the Windows Desktop? (FAQ 2818D) Creating a bitmap from a pixel array (FAQ 1205D) GetDC(0) returns the Device Context for the desktop, which can also be
written as |
| GetDeviceCaps | Drawing in scale without using Windows Mapping Modes? (FAQ 2736D) Finding the color depth of a canvas (TI 1507D) How many colors will my display mode support? (FAQ 741D) Implementing the VB TwipsPerPixel in Delphi (FAQ 2506D) Passing TPrinter handle to GetDeviceCaps (FAQ 2610D) Index
Values Screen: TECHNOLOGY: Determining if a canvas is a Metafile Canvas? (FAQ 2638D) RASTERCAPS to create IsPaletteDevice function: Creating a bitmap from a pixel array (FAQ 1205D) GetDeviceCaps(hDC, RASTERCAPS) Description RC_PALETTE: A better way to print a form (TI 1412D) Printers: |
| GetDeviceGammaRamp | Philipp Pammler's Usenet Post with example of using GetDeviceGammaRamp and SetDeviceGammaRamp API calls. Michael Warner's reply that API gamma functions work with few video cards. |
| GetDIBits | Creates a device-independent bitmap (DIB) from a
device-dependent bitmap (DDB). A better way to print a form (TI 1412D) efg's Printer Demo #1 Andrew Rybenkov's UseNet Post about using GetDIBits/SetDIBits as an alternative to Scanline |
| GetIconInfo | Get "And" mask and an "Or"
mask buried in each TIcon ICOtoBMP.pas.txt |
| GetNearestColor | Color problems in 256 color mode (FAQ 2780D) |
| GetObject | Using the Win API GetObject to get a bitmap (FAQ 2518D) Painting a rainbow color spectrum onto a form (FAQ 1247D) |
| GetOutlineTextMetrics | Peter Haas' UseNet Post with example of GetOutlineTextMetrics |
| GetPaletteEntries | Retrieves a range of color palette entries from the specified
logical palette. How to use GetPaletteEntries and Convert pf8bit Bitmap to pf24bit Bitmap Using Scanline p. 436, Secrets of Delphi 2, Ray Lischner Mike Mormando's UseNet Post about passing NIL parameter to get the number of palette entries. |
| GetPixel | RASTERCAPS: Raster Operations (FAQ 2622D) |
| GetPrinter | Printing in color (FAQ 1650D) |
| GetRasterizerCaps | Checking if TrueType fonts are available (FAQ 2466D) |
| GetROP2 | Tomes Graphical, pp. 146-147 |
| GetStockObject | Tomes Graphical, pp. 149-150 |
| GetSystemMetrics | Retrieves dimensions in pixels of specific
Windows display element. Tomes Graphical,
p. 48-49 How can I create an icon from an (sic) bitmap? (FAQ 2748D) Extracting Icons (FAQ 1778D) Kerstin Thaler's UseNet Post with example for SM_CYSMICON François Gaillard's UseNet Post with SM_CYSCREEN and SM_CXSCREEN examples and SystemParametersInfo example Charles Hacker's UseNet Post with WM_NCPAINT example also showing GetSystemMetrics with parameters SM_CYMENU, SM_CXBORDER and SM_CYCAPTION. Shannon Broskie's UseNet Post
with DrawTitleBarImage function |
| GetSystemPaletteEntries | pp. 329-333, Delphi Programming Problem Solver, Neil
Rubenking A better way to print a form (TI 1412D) |
| GetTempPath | Save and load metafiles in a BLOB field without using DBImage (FAQ 878D) |
| GetTextMetrics | Determining a memo's number of lines showing (TI 1201D) |
| GetTickCount | Useful for timing purposes. Returns milliseconds (Cardinal or LongWord) since Windows started. Overflows every 49 days (high order bit set after about 24 days -- thanks for the comment, Ray Lischner). |
| GetWindow | How do I get a handle to the Windows 95 Desktop to access the Desktop
icons? Getting the Win95 DeskTop ListView Handle (FAQ 408D) Eddie Shipman's UseNet Post about capturing top-most image |
| GetWindowDC | Damon Chandler's UseNet Post about
Drawing on the Desktop
Gate's UseNet Post about the right method to allocate and release the DC without causing GDI Leak From the help file: "The GetWindowDC function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area." |
| GetWindowLong | Displaying a bitmap on the client area of an MDI parent form
(FAQ 176D) Removing a form's caption bar? (FAQ 908D) |
| GetWindowPlacement | See Neil Rubenking's GetPosFmINI_Internal or SetPosToINI in the AllFuncs.pas unit in his ColorClue PC Magazine utility. |
| GlobalAlloc, GlobalFree | Creating a bitmap from a pixel array (FAQ 1205D) |
| GlobalLock, GlobalUnlock |
Creating a bitmap from a pixel array (FAQ 1205D) Printing in color (FAQ 1650D) |
| GradientFill | Peter Söderman's UseNet Post with example of using
GradientFill Neil Rubenking's UseNet Post about problem using GradientFill |
| HBITMAP | Henrik Palmér's UseNet Post about HBITMAP to Image.Canvas |
| InflateRect | How to Draw Marching Ants by Robert Vivrette.
"Marching Ants" (sometimes called a marquee rectangle) is essentially
an animated rubber-banding line. http://www.undu.com/DN960901/00000008.htm |
| InvalidateRect | Using InvalidateRect to repaint the entire form (FAQ 1235D) How can I create an icon from an (sic) bitmap? (FAQ 2748D) Storing icons in your application for use at runtime? (FAQ 2767D) How to Draw Marching Ants by Robert Vivrette. "Marching Ants" (sometimes called a marquee rectangle) is essentially an animated rubber-banding line. http://www.undu.com/DN960901/00000008.htm Renate Schaaf's UseNet Post about "dirty rectangle" technique with images and postscript. Invalidate, InvalidateRect, and Flicker: If you invalidate a whole form, all TLabels will flicker when they're redrawn. An alternative is to use InvalidateRect with the False parameter to stop this background erase. Also, Validate/Invalidate can be used for some interesting effects. efg's Invalidate project shows how Invalidate, InvalidateRect and ValidateRect work. |
| IsRectEmpty | |
| LineDDA | Fancy Menus, etc.: Custom Menus, Rotated
Text, and Special Lines www.delphizine.com/features/2000/12/di200012bs_f/di200012bs_f.asp How do I plot a line? (FAQ 2934D)
How to Draw Marching Ants by Robert Vivrette. "Marching
Ants" (sometimes called a marquee rectangle) is essentially an animated
rubber-banding line. |
| LineTo | How can I draw directly on the Windows Desktop? (FAQ 2818D) |
| LoadBitmap | Keeping a glyph's transparent area transparent (FAQ 1385D) Loading bitmaps and cursors from RES files (TI 1081D) |
| LoadIcon | Storing icons in your application for use at runtime? (FAQ 2767D) |
| LoadImage | Using an animated cursor (FAQ 580D) LoadImage Alters Color Table with 256 Color Bitmaps (MS Q195831) |
| LoadLibrary | Creating a resource only DLL (FAQ 1595D) |
| LoadResource | Using JPEGs from resource files (FAQ 1882D) Extracting a JPEG Resource from an EXE (TI 4532D) |
| LockResource | Using JPEGs from resource files (FAQ 1882D) Loading bitmaps and cursors from RES files (TI 1081D) Extracting a JPEG Resource from an EXE (TI 4532D) |
| LockWindowUpdate | Prevent Window update (FAQ 1349D) [Use to
reduce flicker] Keeping a glyph's transparent area transparent (FAQ 1385D) Wayne Sheffield's UseNet Post about using LockWindowUpdate to avoid flicker |
| LPtoDP | Converts points from logical coordinates to device
coordinates. LIMITATION: TPoint structures should specify values no greater than 27 bits. (This is why I still use Doubles in my work!) |
| MakeObjectInstance | Displaying a bitmap on the client area of an MDI parent form (FAQ 176D) |
| MaskBlt (NT Only) | |
| Mouse_Event | Using mouse_event() to simulate mouse events (FAQ 1241D) |
| MoveToEx | How can I draw directly on the Windows Desktop? (FAQ 2818D) |
| PatBlt | Non VCL Bitmap buffering (FAQ 2774D) Painting a rainbow color spectrum onto a form (FAQ 1247D) Fast way to clear a given canvas (FAQ 1187D) If you
paint in White or in Black: |
| PaintRgn | Manipulating Regions with Delphi by Don Monroe www.undu.com/DN961001/00000016.htm Chris Hill's UseNet Example |
| PlgBlt (NT/2000 only) |
parallelogram block transfer -- can be used to rotate a
bitmap but only in NT See example in Delphi Informant, Jan. 99, pp. 68-71. Damon Chander's UseNet Post with a PlgBlt function |
| PolyBezier | David Ullrich's UseNet Example Chris Hill's Usenet Example Gordon Whittam's UseNet Post with DrawBullet procedure for drawing a bullet using PolyBezier API call. I tested Gordon's routine with this : procedure TForm1.Button1Click(Sender:
TObject); Tomes Graphical, p. 168. Note: To avoid a confusion with the TCanvas.PolyBezier call (and a compilation error), use Windows.PolyBezier to invoke this API function. |
| PolyDraw | Not supported in Win 95. Wayne Sherman's UseNet
Post with Win 95 alternative
See Microsoft's HowTo: How to Get Windows NT PolyDraw functionality in Windows 95. http://support.microsoft.com/support/kb/articles/Q135/0/59.asp |
| Polygon | How can I create a dynamic array of TPoints to draw a polygon? (FAQ919D) |
| PolyPolygon | Creating a PolyPolygon using a point array (FAQ 2946D) |
| PtInRect | PtInRegion pixel function (FAQ 2857D) How can I tell if the mouse is over my form? (FAQ 2759D) Microsoft's
Q121960: Alternative to PtInRegion for Hit Testing |
| PtInRegion | Manipulating Regions with Delphi by Don Monroe www.undu.com/DN961001/00000016.htm |
| RealizePalette | Creating a bitmap from a pixel array (FAQ 1205D) A better way to print a form (TI 1412D) See Palettes Section of efg's Delphi Graphics Color Page |
| Rectangle | Draw On Frame (FAQ 1079D) |
| RedrawWindow | I once used this to work around a problem: // Need both InvalidateRect and RedrawWindow to get // background repainted without flicker InvalidateRect(SELF.Handle, NIL {whole window},FALSE); // Don't use Application.ProcessMessages for update, or MouseUp may // trigger before MouseDown has completed. Use RedrawWindow RedrawWindow(SELF.Handle, NIL, 0, RDW_UPDATENOW); |
| ReleaseCapture | How can I easily move a Window control at runtime (FAQ 896D) |
| ReleaseDC | How can I draw directly on the Windows Desktop? (FAQ 2818D) Creating a bitmap from a pixel array (FAQ 1205D) |
| ResizePalette | Increases or decreases the number of palette entries in the specified logical palette. |
| ScreenToClient | |
| ScrollDC, ScrollWindow | |
| ScrollWindowEx | // Put a TImage on a form and
then click this button procedure TForm1.Button1Click(Sender: TObject); VAR R: TRect; begin R:=Form1.ClientRect; ScrollWindowEx(Form1.Handle, 5 {pixels right},5 {pixels down}, @R,@R,0,nil,SW_INVALIDATE); end; |
| SelectClipRgn | efg's Printer Demo #2 Lab Report |
| SelectPalette | pp. 329-333, Delphi Programming Problem Solver, Neil
Rubenking Creating a bitmap from a pixel array (FAQ 1205D) A better way to print a form (TI 1412D) See Palettes Section of efg's Delphi Graphics Color Page |
| SelectStockObject | Draw On Frame (FAQ 1079D) |
| SendMessge | See Windows Messages below |
| SetBkMode | Drawing transparent text onto a TBitmap (FAQ 2079D) Bitmaps and captions on TBitBtn (FAQ 1758D) Making text background transparent (FAQ 627D) |
| SetConsoleTextAttribute | Generating a Windows Console Application (FAQ 747D) |
| SetCursor | Philippe Bruno's E-Mail about changing cursor for a tray application |
| SetCursorPos | Simulating a mouse move in code (FAQ 2871D)
VAR ButtonOriginInScreenCoordinates:
TPoint; Windows.SetCursorPos( |
| SetDIBColorTable | Chris Hill's UseNet Post
about
SetDIBColorTable Robert Rossmair's UseNetPost about SetDIBColorTable Dean Verhoeven's E-mail about using SetDIBColorTable to alter palette of pf8bit bitmap |
| SetDIBits | Copies the bit values from the specified area in the DIB bit
values pointed to by the Bits parameter directly into the DDB indicated by the Bitmap
parameter.
Andrew Rybenkov's UseNet Post about using GetDIBits/SetDIBits as an alternative to Scanline |
| SetDIBitsToDevice | Note from Joe Hecht (via private E-mail, 19 Jan 99): "I never recommend SetDIBitsToDevice. It seems straight forward enough, but at driver level the most difficult of the bitmap functions to implement correctly, and I have enough failures in the real world to discourage its use." |
| SetMapMode | For an application to use true logical coordinates, the
mapping mode must be changed. How can I draw using LoEnglish Mapping Modes? (FAQ 2771D) Dave Shapiro's UseNet Post explaining "Why is 'y' upside down?" (or how to make the y-axis increase from bottom-to-top instead of top-to-bottom) Steve Schafer's UseNet Post about SetMapMode not affecting mouse position coordinates: "The mouse position is always given in terms of screen coordinates. The only variation is that they may be either screen-relative or window-relative. In either case, the GDI mapping mode does not apply." |
| SetMenuItemBitmaps | Small bitmaps in a TPopUpMenu (FAQ 1806D) |
| SetPixel | RASTERCAPS: Raster Operations (FAQ 2622D) |
| SetROP2 | Sets the foreground mix mode for the specified device context. |
| SetScrollPosition | Trap scrolling messages for the Scrollbars of a TScrollBox (FAQ 942D) |
| SetStretchBltMode | Sets the bitmap stretching mode. Tomes Graphical,
pp. 348-352 Windows API documentation says
STRETCH_DELETESCANS is "typically used to preserve color in color bitmaps." Image fidelity is not
good without this call when using EPIX pxd_StretchDIBits." When
a bitmap is compressed as a result of a call to StretchBlt, the
colors of some pixels in the original bitmap are lost. To get the
best results when using StretchBlt, set the bitmap stretching mode
to ColorOnColor before calling StretchBlt, e.g., See efg's Newsgroup Post about using SetStretchBltMode before CopyRect (but not before StretchDraw) |
| SetSysColors | Michael Winter's UseNet Post with SetSysColors example |
| SetSystemCursor | Philippe Bruno's E-Mail about changing cursor for a tray application |
| SetSystemPaletteUse | Non-Delphi: http://msdn.microsoft.com/library/psdk/gdi/colors_0sv9.htm Also see Palettes Section of efg's Delphi Graphics Color Page |
| SetViewPortEx | Sets the value for how much is added to a coordinate as it
reaches the device coordinate system. How can I draw using LoEnglish Mapping Modes? (FAQ 2771D) |
| SetViewportExtEx | Sets a factor that is multiplied by the coordinate as it arrives at the device coordinate system. |
| SetWindowExtEx | Sets a factor that is divided out of the coordinate as it leaves the logical coordinate system. |
| SetWindowLong | Displaying a bitmap on the client area of an MDI parent form
(FAQ 176D) Removing a forms caption bar? (FAQ 908D) |
| SetWindowOrgEx | Sets the value for how much is subtracted from a coordinate as it leaves the logical coordinate system. |
| SetWindowRgn | FormShaper: Say Good-bye to Rectangular Forms www.delphiinformant.com/features/2000/03/di200003pm_f/di200003pm_f.asp How to Make a Polygonal Splash Screen by Michael Barnes Ventanas de formas irregulares (Spanish) Complex Window Regions |
| ShowCursor | To turn cursors on or off, use ShowCursor(FALSE); or ShowCursor(TRUE); |
| ShowWindow | Hiding your application from the Windows Taskbar (FAQ 574D) |
| StretchBlt | Draws and scales pixels from one device
context to another. Tomes Graphical,
pp. 275-276 Blitting Between DCs for Different Devices Is Unsupported (MS Q195830) Draw and StretchDraw methods use the StretchBlt API call. See Item #1, "How can I print a Bitmap?" or the Printer Demo #1 Lab Report. Also see SetStretchBltMode above. Ignacio Alvarez's UseNet Post with modified TransparentStretchBlt function Shannon Broskie's UseNet Post with DrawTitleBarImage function (shows TransparentStretchBlt) |
| StretchDIBits | Draws and scales a device-independent bitmap onto a device
context. Tomes Graphical,
pp. 352-356. pp. 437, Secrets of Delphi 2, Ray Lischner Getting printer capabilities (FAQ 1475D) A better way to print a form (TI 1412D) Blitting Between DCs for Different Devices Is Unsupported (MS Q195830) efg's Printer Demo #1 efg's Lead Tools-to-Delphi conversions show how to start with a hDIB and end up with a TBitmap. In particular, look at Method 1. hDIB to TBitmap resulting in bmDDB using StretchDIBits |
| StrokeAndFillPath | Steve Schafer's UseNet Post
with
BeginPath/CloseFigure/EndPath/StrokeAndFillPath example Toni Sander's UseNet Post with an alternative to create Outline/Shadow Text |
| StrokePath | How do I use Paths and Geometric Pens? (FAQ 2724D)
|
| SubtractRect | |
| SystemParametersInfo | Getting the size of the desktop (FAQ 2567D) Creating a wallpaper using Delphi (TI 1351D) Preventing windows task switching (FAQ 509D) See SystemParametersInfo.Txt for Windows 95 trick to block CTRL+ALT+DEL or ALT+TAB
Toni Sanders' UseNet Post
about how to turn off windows font anti-aliasing François Gaillard's UseNet Post with SM_CYSCREEN and SM_CXSCREEN examples and SystemParametersInfo example Non-Delphi: How to Use SystemParametersInfo API for
Control Panel Settings How To: Determine the Size of the Desktop Area |
| TBitmap | Using the Win API GetObject to get a bitmap (FAQ 2518D) [Note: See comments under VCL TBitmap.] |
| TBitmapInfo, TBitmapInfoHeader | Creating a bitmap from a pixel array (FAQ 1205D) |
| TCursorInfo | efg's ShowCursor
example of displaying cursor at any position on screen (based on UseNet Post by Michael Winter) |
| TextOut | Changing the background color of Text (FAQ 990D) |
| TextOutW | Steve Schafer's UseNet Post about how to view Unicode on a form |
| TLogBrush | How do I use Paths and Geometric Pens? (FAQ 2724D) Chris Hill's UseNet Post with example |
| TLogFont | Creating a rotated font (FAQ 615D) |
| TLogPalette | Creating a bitmap from a pixel array (FAQ 1205D) A better way to print a form (TI 1412D) |
| TNonClientMetrics | Peter Below's UseNet Post about how to get the Windows title font (and information about TNonClientMetrics) |
| TPaletteEntry | Creating a bitmap from a pixel array (FAQ 1205D) A better way to print a form (TI 1412D) |
| TPath, TRegion | More Regions! www.undu.com/Articles/990128c.html |
| TransparentStretchBlt | See StretchBlt |
| TRGBQuad | Creating a bitmap from a pixel array (FAQ 1205D) |
| TRGBTriple | efg's Scanline examples using pf24bit bitmaps |
| UnionRect | |
| ValidateRect | How to Draw Marching Ants by Robert Vivrette.
"Marching Ants" (sometimes called a marquee rectangle) is essentially
an animated rubber-banding line. http://www.undu.com/DN960901/00000008.htm Invalidate, InvalidateRect, and Flicker: If you invalidate a whole form, all TLabels will flicker when they're redrawn. An alternative is to use InvalidateRect with the False parameter to stop this background erase. Also, Validate/Invalidate can be used for some interesting effects. efg's Invalidate project shows how Invalidate, InvalidateRect and ValidateRect work. |
| WarpBlt (Win 2000) |
Non-Delphi: HOWTO: Display a Bitmap into a Rotated or Non-rectangular Area http://support.microsoft.com/support/kb/articles/Q186/5/89.ASP |
Windows Messages
"Understanding Windows Messaging"
Chapter 5, Delphi
5 Developer's Guide
by Teixeria and Pacheco
Chapter 7, Messaging
Delphi
Component Design by Danny Thorpe
| General Info | Chapter 37, Handling messages, Borland's Delphi
5 Developer's Guide.
Messages, Appendix A, Tomes Graphical, pp. 725-848 Trapping Windows Messages in Delphi (TI 1487D) Windows Messages |
| CM_MouseEnter CM_MouseLeave |
www.openinfo.se/martin/texterdelphi/mouseex.htm
See ..\Source\VCL\Buttons.PAS, especially the MouseInControl property, for an example of how these messages are used in the VCL. Also see TControl.CMMouseEnter in Controls.PAS, and TApplication.DoMouseIdle in Forms.PAS. Delphi generates a CM_MouseLeave by monitoring when a different window is getting WM_MouseMove. In Chapter 13 of Mastering Delphi 5 (pp. 608-609), Marco Cantù shows how to create an "active" TMdActiveButton component that captures CM_MouseEnter and CM_MouseExit events. Mike Shkolnik's UseNet Post on MouseEnter and MouseExit events How to detect mouse leaving a control? (CM_MOUSEENTER, CM_MOUSELEAVE)
TShape descendant that has a star shape and has OnMouseEnter/Leave handlers. Eddie Shipman's UseNet Post |
| EM_SETTABSTOPS | Adjusting the tab location in a TMemo component (FAQ 960D) |
| LB_SETHORIZONTALEXTENT | Enabling a horizontal scroll bar for a list box (TI 531D) |
| LVM_ALIGN | How do I get a handle to the Windows 95 Desktop to access the Desktop
icons? Getting the Win95 DeskTop ListView Handle (FAQ 408D) |
| WM_ACTIVATE | Tomes Graphical, p. 725 |
| WM_CHAR | Tomes Graphical, p. 729 |
| WM_COMMAND | Tomes Graphical, p. 732 |
| WM_COPY, WM_CUT | Tomes Graphical, p. 735, 741 |
| WM_DISPLAYCHANGE | Tomes Graphical, p. 747 Windows Messages |
| WM_DROPFILES | Tomes Graphical, p. 750 Drag and Drop with Files (FAQ 529D) |
| WM_ENTERSIZEMOVE WM_EXITSIZEMOVE |
Peter Below's UseNet Post showing the pre-Win 95 method of resizing |
| WM_ERASEBKGND | Tomes Graphical, p754
Message sent to a window when it has been invalidated. Tomes Graphical,
pp. 754. Can be the cause of flicker -- intercept message to reduce flicker in some cases. |
| WM_GETMINMAXINFO | Tomes Graphical, p. 757
- example in efg's MazeMaker
Lab Report |
| WM_HOTKEY | Disable PrintScreen with Ctrl + Alt combinations (WMHotKey, RegisterHotKey) Morten Jacobsen's E-Mail with example |
| WM_HSCROLL | Alex Denissov's UseNet
Post with WM_HSCROLL and WM_VSCROLL examples
Tomes Graphical, p. 761 |
| WM_LBUTTONUP | Tomes Graphical, p. 770 How can I easily move a Window control at runtime (FAQ 896D) How to Simulate Visual Basic's SendKeys in Delphi |
| WM_MOUSEMOVE | Tomes Graphical, p. 789 |
| WM_NCHITTEST |
Message sent to a window when the mouse cursor moves over the window or a mouse button is clicked. Tomes Graphical, pp. 796-797 Moving a form by clicking in its client area (FAQ 2099D) "Unusual Windows Styles" of |
| WM_NCMOUSEMOVE | Tomes Graphical, p. 802 Trapping non client areas (FAQ 1535D) |
| WM_NCPAINT | Charles Hacker's UseNet
Post with WM_NCPAINT example
Tomes Graphical, p. 803 Used to paint the non-client area such as the caption bar and border. Draw on Frame (FAQ1079D) Chapter 1, Delphi Programming Problem Solver by Neil
Rubenking (p. 23-32) |
| WM_PAINT | Used to paint the client area -- the part inside the window. Tomes Graphical, pp. 809-810 |
| WM_PASTE | Tomes Graphical, p. 814 |
| WM_PALETTECHANGED | This message is sent to all top-level and overlapped windows when the
currently focused window changes the system palette by realizing a logical palette. Tomes
Graphical, pp. 811-812
GetPalette and PaletteChanged, pp. 211-212. Eddie Shipman's UseNet Post about making a rainbow background on a form Processing WM_PALETTECHANGED and WM_QUERYNEWPALETTE efg's Palette Lab Report |
| WM_QUERYNEWPALETTE | This message is received when a window is receiving keyboard focus
indicating it should realize its logical palette. Tomes Graphical,
pp. 816-817
see WM_PALETTECHANGED above |
| WM_SETCURSOR | What's This? Implementing a "What's This?"
Help Toolbar Button www.delphizine.com/features/1998/05/di199805dh_f/di199805dh_f.asp |
| WM_SYSCOLORCHANGE | http://msdn.microsoft.com/library/psdk/gdi/colors_0hph.htm
INFO: Changing Window Colors with Control Panel |
| WM_SYSCOMMAND | Tomes Graphical, p. 836 How can I easily move a Window control at runtime (FAQ 896D) Windows Messages |
| WM_UNDO | Tomes Graphical, p. 842 |
| WM_USER | How can I capture an image from a video source (FAQ 1037D) |
| WM_VSCROLL | Alex Denissov's UseNet
Post with WM_HSCROLL and WM_VSCROLL examples
Tomes Graphical, p. 844 |
| WM_WINDOWPOSCHANGED | Tomes Graphical, p. 846
Richard's UseNet Post showing WM_WINDOWPOSCHANGED example to get background images drawn on my MDI application |
| WM_WINDOWPOSCHANGING | Tomes Graphical, p. 847 |
Windows API Tips and Tricks
See "Messages" in Delphi in a
Nutshell, pp. 61-62 for an overview
| Callbacks | pp. 483-495, Delphi Programming Problem Solver, Neil Rubenking |
| Color Gradient Animation (256-color mode only) | Tomes Graphical, pp. 409-411 |
| Colors of the System Palette | Delphi 2 Multimedia, Table 6.2, p. 290 |
| Creating a Device-Dependent Bitmap (DDB) from a Device-Independent Bitmap (DIB) Setting the Image of a DDB from a DIB |
Tomes Graphical,
pp. 298-300 Tomes Graphical, pp. 343-344 |
| Creating a Device-Independent Bitmap (DIB) from a Device-Dependent Bitmap (DDB) | Tomes Graphical, pp. 319-320 |
| Creating a Round Window for an Analog Clock Application | Tomes Graphical, pp. 266-268 |
| Device Context | Display Device Context
Defaults: list of attributes and values (The Canvas.Handle is a device context). http://msdn.microsoft.com/library/psdk/gdi/pantdraw_3xtf.htm |
| Display Mode | How many colors will my display mode support? (FAQ 741D) Enumerating All Available Display Modes for Current Display: Tomes Graphical, pp. 33-34 Changing the Display Mode: Tomes Graphical, p. 23. |
| Displaying a Bitmap with Transparent Pixels | Tomes Graphical, pp. 278 |
| Loading a 256-color Bitmap from a Resource | Tomes Graphical, pp. 584-585 |
| Manipulating a DIB Using GDI Drawing Functions | Tomes Graphical, pp. 279-280 |
| Mapping Logical Coordinates into Device Coordinates | xViewport = (xWindow -
xWindowOrg)*(xViewportExt/xWindowExt) + xViewPortOrg yViewport = (yWindow - yWindowOrg)*(yViewportExt/yWindowExt) + yViewportOrg Tomes Graphical, pp. 14, 26-27, 57, 60-61, 74-78. See Limitation listed above with the LPtoDP API call. |
| Mapping Modes | MM_TEXT, 1:1, no translation MM_ANISOTROPIC, allows complete flexibility in setting offsets and scaling. Can set different horizontal and vertical factors to stretch (skew) the image. MM_ISOTROPIC, horizontal and vertical scaling is the same Tomes Graphical, p. 15, 74 |
| Masks and Bitmaps | How can I create an icon from an (sic) bitmap? (FAQ 2748D) Dynamically drawing a transparent image (FAQ 1794D) |
| Performing Special Animation Effects by Moving the Clipping Region | Tomes Graphical, pp. 242-243 |
| Programmatically Justifying Text | Tomes Graphical, pp. 539-541 |
| Raster Operations | Tomes Graphical,
pp. 277, Appendix B, Tertiary Raster Operation Codes, pp. 849-856. "The Standard Windows Raster Operations," Delphi 2 Multimedia, pp. 338-342, 361-373. Tim Roberts' UseNet Post about "What are ROPs?" |
| "Rubber-band" drawing of a rectangle | pp. 310-312, Delphi Programming Problem Solver, Neil Rubenking |
| Scaling a Bitmap and Retaining the Original Aspect Ratio | Tomes Graphical, pp. 275-276 |
| Text Output Functions | Tomes Graphical, Chapter 8, pp. 459-559 |
| Using a Multiple Polygon Region as a hot spot. | Tomes Graphical, pp. 214-216 |
| Flicker FAQ | www.bcbdev.com/faqs/faq34.htm Also see efg's Flicker notes. |
| Bitmaps and Palettes | Secrets of Delphi 2, Ray Lischner, pp. 432-438 |
| Delphi API Library (Project Jedi) | www.delphi-jedi.org |
| Graphics Objects | Secrets of Delphi 2, Ray Lischner, pp. 421-428, |
| Messages and Painting Text | Delphi 2 Unleashed, Charles Calvert, pp. 337-363 |
| Raw API Programming | Raw API Programming: When Size and Speed Are Paramount www.delphizine.com/features/2000/09/di200009aw_f/di200009aw_f.asp |
| Windows API Functions Windows Messages and Resources |
Chapters 14 and 15, pp. 483-550, Delphi Programming Problem Solver, Neil Rubenking |
Links Verified 28 May 2000
Updated 26 Feb 2005
since 1 Nov 1998