Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.9 KiB

  1. /*
  2. **************************************************************************
  3. *
  4. * draw.h header file
  5. *
  6. *
  7. *
  8. ***************************************************************************
  9. */
  10. #include <mmsystem.h>
  11. // Function Prototypes
  12. LRESULT PASCAL dfDispFrameWndFn(HWND,UINT,WPARAM,LPARAM);
  13. BOOL PASCAL RegSndCntrlClass(LPCTSTR);
  14. BOOL dfDrawRect(HDC, RECT);
  15. BOOL DIBInfo(HANDLE hbi,LPBITMAPINFOHEADER lpbi);
  16. HPALETTE CreateBIPalette(LPBITMAPINFOHEADER lpbi);
  17. WORD PaletteSize(VOID FAR * pv);
  18. WORD NumDIBColors (VOID FAR * pv);
  19. WORD WINAPI bmfGetNumDIBs(LPTSTR lpszFile);
  20. WORD WINAPI bmfNumDIBColors(HANDLE hDib);
  21. HPALETTE WINAPI bmfCreateDIBPalette(HANDLE hDib);
  22. HANDLE WINAPI bmfDIBFromBitmap(HBITMAP hBmp, DWORD biStyle,
  23. WORD biBits,HPALETTE hPal);
  24. HBITMAP WINAPI bmfBitmapFromDIB(HANDLE hDib, HPALETTE hPal);
  25. HBITMAP WINAPI bmfBitmapFromIcon (HICON hIcon, DWORD dwColor);
  26. BOOL WINAPI bmfDrawBitmap(HDC hdc, int xpos, int ypos,
  27. HBITMAP hBmp, DWORD rop);
  28. DWORD WINAPI bmfDIBSize(HANDLE hDIB);
  29. BOOL WINAPI bmfDrawBitmapSize (HDC hdc, int xpos, int ypos,
  30. int xSize, int ySize, HBITMAP hBmp, DWORD rop);
  31. // Defines
  32. #define DF_DISP_EXTRA 8
  33. #define DF_GET_BMPHANDLE (HBITMAP)(GetWindowLongPtr(hWnd, 0))
  34. #define DF_SET_BMPHANDLE(x) (SetWindowLongPtr(hWnd, 0, (LONG_PTR)(x)))
  35. #ifndef _WIN64
  36. #define DF_GET_BMPPAL (HPALETTE)(GetWindowLong(hWnd, 4))
  37. #define DF_SET_BMPPAL(x) (SetWindowLong(hWnd, 4, (LONG)(x)))
  38. #else
  39. #define DF_GET_BMPPAL (HPALETTE)(GetWindowLongPtr(hWnd, sizeof(UINT_PTR)))
  40. #define DF_SET_BMPPAL(x) (SetWindowLongPtr(hWnd, sizeof(UINT_PTR), (LONG_PTR)(x)))
  41. #endif
  42. /* Help Macros */
  43. #define DF_MID(x,y) (((x)+(y))/2)
  44. #define DISPICONCLASS TEXT("WSS_DispIcon")
  45. #define DISPFRAMCLASS TEXT("WSS_DispFrame")
  46. /* Header signatutes for various resources */
  47. #define BFT_ICON 0x4349 /* 'IC' */
  48. #define BFT_BITMAP 0x4d42 /* 'BM' */
  49. #define BFT_CURSOR 0x5450 /* 'PT' */
  50. /* macro to determine if resource is a DIB */
  51. #define ISDIB(bft) ((bft) == BFT_BITMAP)
  52. /* Macro to align given value to the closest DWORD (unsigned long ) */
  53. #define ALIGNULONG(i) (((i)+3)/4*4)
  54. /* Macro to determine to round off the given value to the closest byte */
  55. #define WIDTHBYTES(i) (((i)+31)/32*4)
  56. #define PALVERSION 0x300
  57. #define MAXPALETTE 256 /* max. # supported palette entries */
  58. //******** DISPFRAM ********************************************************
  59. // DispFrame Control messages.
  60. #define DF_PM_SETBITMAP (WM_USER+1)
  61. /* Parent Window Message string */
  62. #define DF_WMDISPFRAME TEXT("PM_DISPFRAME")
  63. #define DISP_DIB_CHUNK 1
  64. #define DISP_TEXT_CHUNK 2
  65. #define LIST_INFO_CHUNK 4
  66. #define MAXDESCSIZE 4095
  67. #define MAXLABELSIZE 255