From e3ec9d17d7b00245427ffe9d9c5059245d1fbf1a Mon Sep 17 00:00:00 2001 From: dahall Date: Wed, 1 Sep 2021 11:07:30 -0600 Subject: [PATCH] Updated documentation for NOTIFYICONIDENTIFIER and added constructors. --- PInvoke/Shell32/ShellApi.cs | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/PInvoke/Shell32/ShellApi.cs b/PInvoke/Shell32/ShellApi.cs index 091f9007..0d34b17d 100644 --- a/PInvoke/Shell32/ShellApi.cs +++ b/PInvoke/Shell32/ShellApi.cs @@ -3696,8 +3696,8 @@ namespace Vanara.PInvoke /// /// Type: HWND /// - /// A handle to the parent window used by the notification's callback function. For more information, see the member of the - /// NOTIFYICONDATA structure. + /// A handle to the parent window used by the notification's callback function. For more information, see the member of the NOTIFYICONDATA structure. /// /// public HWND hWnd; @@ -3705,8 +3705,8 @@ namespace Vanara.PInvoke /// /// Type: UINT /// - /// The application-defined identifier of the notification icon. Multiple icons can be associated with a single , each with their - /// own . + /// The application-defined identifier of the notification icon. Multiple icons can be associated with a single hWnd, + /// each with their own uID. /// /// public uint uID; @@ -3716,6 +3716,27 @@ namespace Vanara.PInvoke /// A registered GUID that identifies the icon. Use GUID_NULL if the icon is not identified by a GUID. /// public Guid guidItem; + + /// Initializes a new instance of the struct. + /// A handle to the parent window used by the notification's callback function. + /// The application-defined identifier of the notification icon. + public NOTIFYICONIDENTIFIER(HWND hWnd, uint uID) + { + cbSize = (uint)Marshal.SizeOf(typeof(NOTIFYICONIDENTIFIER)); + this.hWnd = hWnd; + this.uID = uID; + guidItem = default; + } + + /// Initializes a new instance of the struct. + /// A registered GUID that identifies the icon. + public NOTIFYICONIDENTIFIER(Guid guidItem) + { + cbSize = (uint)Marshal.SizeOf(typeof(NOTIFYICONIDENTIFIER)); + this.hWnd = default; + this.uID = default; + this.guidItem = guidItem; + } } /// Contains information used by ShellExecuteEx.