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.

99 lines
3.7 KiB

  1. //*****************************************************************************
  2. //
  3. // Cursor and Icon compatibility Support -
  4. //
  5. // Support for apps - which do a GlobalLock on Cursors and Icons to
  6. // create headaches for us.
  7. //
  8. // A compatibility issue.
  9. //
  10. //
  11. // 21-Apr-92 NanduriR Created.
  12. //
  13. //*****************************************************************************
  14. #define HANDLE_TYPE_UNKNOWN 0x01
  15. #define HANDLE_TYPE_ICON 0x02
  16. #define HANDLE_TYPE_CURSOR 0x04
  17. #define HANDLE_TYPE_WOWGLOBAL 0x08
  18. #define HANDLE_16BIT 0x01
  19. #define HANDLE_32BIT 0x02
  20. #define HANDLE_16BITRES 0x04
  21. #define CIALIAS_TASKISGONE 0x01
  22. #define CIALIAS_HMOD 0x02
  23. #define CIALIAS_HTASK 0x04
  24. typedef struct _CURSORICONALIAS {
  25. struct _CURSORICONALIAS FAR *lpNext;
  26. BYTE fInUse;
  27. BYTE flType;
  28. HAND16 h16;
  29. HAND32 h32;
  30. HAND16 hInst16;
  31. HAND16 hMod16;
  32. HTASK16 hTask16;
  33. WORD hRes16; // 16bit resource handle
  34. WORD cbData;
  35. UINT cLock;
  36. VPVOID vpData;
  37. LPBYTE pbDataOld;
  38. LPBYTE pbDataNew;
  39. LPBYTE lpszName; // name of 16bit resource
  40. } CURSORICONALIAS, FAR *LPCURSORICONALIAS;
  41. #define PROBABLYCURSOR(BitsPixel, Planes) ((((BitsPixel) == 1) && \
  42. ((Planes) == 1)) || \
  43. (BitsPixel) == 0 || (Planes) == 0)
  44. #define BOGUSHANDLE(h) (~(h) & 0x4)
  45. extern UINT cPendingCursorIconUpdates;
  46. HANDLE W32CreateCursorIcon32(LPCURSORICONALIAS lpCIAlias);
  47. HAND16 W32Create16BitCursorIcon(HAND16 hInst16, INT xHotSpot, INT yHotSpot,
  48. INT nWidth, INT nHeight, INT nPlanes, INT nBitsPixel,
  49. LPBYTE lpBitsAND, LPBYTE lpBitsXOR, INT nBytesAND, INT nBytesXOR);
  50. HANDLE GetCursorIconAlias32(HAND16 h16, UINT flType);
  51. HAND16 GetCursorIconAlias16(HAND32 h32, UINT flType);
  52. LPCURSORICONALIAS AllocCursorIconAlias();
  53. LPCURSORICONALIAS FindCursorIconAlias(ULONG hCI, UINT flHandleSize);
  54. BOOL DeleteCursorIconAlias(ULONG hCI, UINT flHandleSize);
  55. BOOL FreeCursorIconAlias(HAND16 hand16, ULONG ulFLags);
  56. HAND16 SetupCursorIconAlias(HAND16 hInst16, HAND32 h32, HAND16 h16, UINT flType,
  57. LPBYTE lpResName, WORD hRes16);
  58. HAND16 SetupResCursorIconAlias(HAND16 hInst16, HAND32 h32, LPBYTE lpResName, WORD hRes16, UINT flType);
  59. ULONG SetCursorIconFlag(HAND16 h16, BOOL fSet);
  60. BOOL ReplaceCursorIcon(LPCURSORICONALIAS lpCIAliasIn);
  61. BOOL FASTCALL WK32WowCursorIconOp(PVDMFRAME pFrame);
  62. VOID UpdateCursorIcon(VOID);
  63. HAND16 W32Create16BitCursorIconFrom32BitHandle(HANDLE h32, HAND16 hMod16,
  64. PUINT cbData);
  65. BOOL InitStdCursorIconAlias(VOID);
  66. #if defined(FE_SB)
  67. BOOL FindCursorIconAliasInUse(ULONG hCI);
  68. #endif
  69. #define HCURSOR32(hobj16) GetCursorIconAlias32((HAND16)(hobj16), HANDLE_TYPE_CURSOR)
  70. #define GETHCURSOR16(hobj32) GetCursorIconAlias16((HAND32)(hobj32), HANDLE_TYPE_CURSOR)
  71. #define FREEHCURSOR16(hobj16) DeleteCursorIconAlias((ULONG)(hobj16), HANDLE_16BIT)
  72. #define HICON32(hobj16) GetCursorIconAlias32((HAND16)(hobj16), HANDLE_TYPE_ICON)
  73. #define GETHICON16(hobj32) GetCursorIconAlias16((HAND32)(hobj32), HANDLE_TYPE_ICON)
  74. #define FREEHICON16(hobj16) DeleteCursorIconAlias((ULONG)(hobj16), HANDLE_16BIT)
  75. #define HICON32_REGCLASS(hobj16) GetClassCursorIconAlias32((HAND16)(hobj16))
  76. HANDLE GetClassCursorIconAlias32(HAND16 h16);
  77. VOID InvalidateCursorIconAlias(LPCURSORICONALIAS lpT);
  78. //
  79. // In win32 USER
  80. //
  81. HANDLE WINAPI WOWLoadCursorIcon(HANDLE hInstance, LPCSTR lpIconName,
  82. LPTSTR rt, LPHANDLE lphRes16);
  83. HAND16 W32CheckIfAlreadyLoaded(VPVOID pData, WORD ResType);