Recent

Author Topic: shellapi.pp, struct.inc, NOTIFYICONDATA definition problems  (Read 733 times)

440bx

  • Hero Member
  • *****
  • Posts: 6339
shellapi.pp, struct.inc, NOTIFYICONDATA definition problems
« on: August 01, 2025, 12:44:22 am »
Hello,

NOTIFYICONDATA (A/W) is defined twice, once in shellapi.pp and another time in struct.inc.  The definitions are not equivalent nor are they faithful translations of the C definitions.

Both are missing the field that is available on or after Windows Vista.

The C definitions layout varies based on the Windows version while the ones in shellapi.pp or struct.inc either don't vary depending on the Windows version or vary based on IE version.

Just for the record, the C definitions are:
Code: C  [Select][+][-]
  1.  
  2. typedef struct _NOTIFYICONDATAA {
  3.     DWORD cbSize;
  4.     HWND hWnd;
  5.     UINT uID;
  6.     UINT uFlags;
  7.     UINT uCallbackMessage;
  8.     HICON hIcon;
  9.  
  10. #if (NTDDI_VERSION < NTDDI_WIN2K)
  11.     CHAR   szTip[64];
  12. #endif
  13.  
  14. #if (NTDDI_VERSION >= NTDDI_WIN2K)
  15.     CHAR   szTip[128];
  16.     DWORD dwState;
  17.     DWORD dwStateMask;
  18.     CHAR   szInfo[256];
  19.  
  20.   #ifndef _SHELL_EXPORTS_INTERNALAPI_H_
  21.     union {
  22.         UINT  uTimeout;
  23.         UINT  uVersion;  // used with NIM_SETVERSION, values 0, 3 and 4
  24.     } DUMMYUNIONNAME;
  25.   #endif
  26.  
  27.     CHAR   szInfoTitle[64];
  28.     DWORD dwInfoFlags;
  29. #endif
  30.  
  31. #if (NTDDI_VERSION >= NTDDI_WINXP)
  32.     GUID guidItem;
  33. #endif
  34.  
  35. #if (NTDDI_VERSION >= NTDDI_VISTA)
  36.     HICON hBalloonIcon;
  37. #endif
  38.  
  39. } NOTIFYICONDATAA, *PNOTIFYICONDATAA;
  40.  
  41.  
  42.  
  43.  
  44.  
  45. typedef struct _NOTIFYICONDATAW {
  46.     DWORD cbSize;
  47.     HWND hWnd;
  48.     UINT uID;
  49.     UINT uFlags;
  50.     UINT uCallbackMessage;
  51.     HICON hIcon;
  52. #if (NTDDI_VERSION < NTDDI_WIN2K)
  53.     WCHAR  szTip[64];
  54. #endif
  55. #if (NTDDI_VERSION >= NTDDI_WIN2K)
  56.     WCHAR  szTip[128];
  57.     DWORD dwState;
  58.     DWORD dwStateMask;
  59.     WCHAR  szInfo[256];
  60. #ifndef _SHELL_EXPORTS_INTERNALAPI_H_
  61.     union {
  62.         UINT  uTimeout;
  63.         UINT  uVersion;  // used with NIM_SETVERSION, values 0, 3 and 4
  64.     } DUMMYUNIONNAME;
  65. #endif
  66.     WCHAR  szInfoTitle[64];
  67.     DWORD dwInfoFlags;
  68. #endif
  69. #if (NTDDI_VERSION >= NTDDI_WINXP)
  70.     GUID guidItem;
  71. #endif
  72. #if (NTDDI_VERSION >= NTDDI_VISTA)
  73.     HICON hBalloonIcon;
  74. #endif
  75. } NOTIFYICONDATAW, *PNOTIFYICONDATAW;
  76.  
Also, the C header defines versions 1, 2 and 3 of the structure. There are no versions in the Pascal definitions.

HTH.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018