home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m248 / 4.ddi / APWAPI.C_ / APWAPI.C
Encoding:
C/C++ Source or Header  |  1993-02-01  |  1.6 KB  |  71 lines

  1. /*
  2.     apwapi.c -- utility routines for apw callbacks
  3. */
  4.  
  5. #include <windows.h>
  6. #include "apwpost.h"
  7.  
  8.  
  9. BOOL FAR PASCAL APWSetPalette( HWND hWnd, HPALETTE hPal, DWORD flags )
  10. /*
  11.     Tells Authorware to use the specified palette.
  12.  
  13.     Parameters:
  14.         hWnd            Window handle of Authorware presentation window
  15.         hPal            Logical palette to use.
  16.         flags            SP_DEFAULT, SP_NOSTATIC, SP_RAW.
  17.  
  18.      (    bNoStatic    TRUE to override static colors, regardless of
  19.      (                    Preserve System Colors setting in file.
  20.      (                    FALSE to use file's Preserve System colors setting.
  21.  
  22.     Returns:
  23.         TRUE            If the operation succeeded.
  24.         FALSE            If it failed.
  25.  
  26.     Notes:
  27.         hPal is no longer valid after this call, whether or not
  28.         the operation succeeded.
  29. */
  30. {
  31.     BOOL    result;
  32.  
  33.     result = (BOOL)SendMessage(hWnd, APWC_SETPAL, hPal, flags);
  34.  
  35.     // APW doesn't delete the palette if the operation failed, so do it here.
  36.     if (!result)
  37.        DeleteObject(hPal);
  38.  
  39.     return result;
  40. }
  41.  
  42.  
  43. HPALETTE FAR PASCAL APWGetPalette( HWND hWnd )
  44. /*
  45.     Gets a handle to Authorware's current palette.  This is the
  46.     actual palette in use, not a copy.  Do not delete it.
  47.  
  48.     Parameters:
  49.         hWnd            Window handle of Authorware presentation window
  50.  
  51.     Returns:
  52.         Handle to Authorware's current palette or NULL if there is
  53.         no current palette.
  54. */
  55. {
  56.     return (HPALETTE)SendMessage(hWnd, APWC_GETPAL, 0, 0);
  57. }
  58.  
  59.  
  60. VOID FAR PASCAL APWResetPalette( HWND hWnd )
  61. /*
  62.     Resets the palette and static color usage settings to that
  63.     defined in the file's File Setup.
  64.  
  65.     Parameters:
  66.         hWnd            Window handle of Authorware presentation window
  67. */
  68. {
  69.     SendMessage(hWnd, APWC_RESETPAL, 0, 0);
  70. }
  71.