The SelectPalette function selects the specified logical palette into a device context.
HPALETTE SelectPalette(
HDC hdc, |
// handle of device context |
HPALETTE hpal, |
// handle of logical color palette |
BOOL bForceBackground |
// foreground/background mode |
); |
If this value is FALSE, RealizePalette causes the logical palette to be copied into the device palette when the application is in the foreground. (If the hdc parameter is a memory device context, this parameter is ignored.)
If the function succeeds, the return value identifies the device context’s previous logical palette.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
An application can determine whether a device supports palette operations by calling the GetDeviceCaps function and specifying the RASTERCAPS constant.
An application can select a logical palette into more than one device context. However, changes to a logical palette will affect all device contexts for which it is selected.
An application might call the SelectPalette function with the bForceBackground parameter set to TRUE if the child windows of a top-level window each realize their own palettes. However, only the child window that needs to realize its palette must set bForceBackground to TRUE; other child windows must set this value to FALSE.
CreatePalette, GetDeviceCaps, RealizePalette
file: /Techref/os/win/api/win32/func/src/f75_11.htm, 3KB, , updated: 2000/4/7 11:19, local time: 2024/11/5 00:19,
18.216.111.153:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.org/Techref/os/win/api/win32/func/src/f75_11.htm"> SelectPalette</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232! |
.