|
Adding Palette Message Handlers
The following example illustrates simple message handlers for the WM_PALETTECHANGED and WM_QUERYNEWPALETTE messages. The example uses the DrawDibRealize function to process the WM_QUERYNEWPALETTE message.
Your application should respond to the WM_QUERYNEWPALETTE message by
invalidating the destination window to let the DrawDibDraw function redraw an image. You should respond to the WM_PALETTECHANGED message
by using the DrawDibRealize function to realize the palette.
case WM_PALETTECHANGED:
if ((HWND)wParam == hwnd)
break;
case WM_QUERYNEWPALETTE:
hdc = GetDC(hwnd);
f = DrawDibRealize(hdd, hdc, FALSE) > 0;
ReleaseDC(hwnd, hdc);
if (f)
InvalidateRect(hwnd, NULL, TRUE);
break;
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Programmer's Reference (win32.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|