ADC Home > Reference Library > Technical Q&As > QuickTime > QuickTime for Windows >
|
Q
Under QuickTime 3 for Windows, my window procedure never receives WM_QUERYNEWPALETTE messages if I've called CreatePortAssociation in the same window procedure on WM_CREATE events. What's going on?
A You are right in that the window procedure for the HWND does not get forwarded the WM_QUERYNEWPALETTE message. To get around this, you can use the Mac toolbox functions NSetPalette and ActivatePalette to activate your custom palette. However, because of this anomaly in QTML (not forwarding this message), you need to work around it by capturing the WndProc and calling back through for all messages except the palette one (because you'll use NSetPalette and ActivatePalette to assert the palette instead). Here's a code snippet which illustrates this:
qtmlWndProc = SetWindowLong(hWnd, GWL_WNDPROC, MyNewWndProc); LRESULT CALLBACK MyWndProc() { if (message == WM_QUERYNEWPALETTE) { // do your thing } else CallWindowProc(qtmlWndProc, ...); } Note that this is kind of messy since you need to avoid going recursive with QTML calling back to you from within that Of course, you can always use the Win32 palette routines anywhere in your code to assert a custom palette. After you change the color environment, simply ensure that you make the QuickTime 1) Call Note also you can create a custom palette and associate it with your movie using the QuickTime 3 [Sep 21 1998] |
|