-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathNotifyIconData.cs
More file actions
131 lines (114 loc) · 4.1 KB
/
NotifyIconData.cs
File metadata and controls
131 lines (114 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// -----------------------------------------------------------------------
// <copyright>
// Created by Matt Weber <matt@badecho.com>
// Copyright @ 2025 Bad Echo LLC. All rights reserved.
//
// Bad Echo Technologies are licensed under the
// GNU Affero General Public License v3.0.
//
// See accompanying file LICENSE.md or a copy at:
// https://www.gnu.org/licenses/agpl-3.0.html
// </copyright>
// -----------------------------------------------------------------------
using System.Runtime.InteropServices.Marshalling;
namespace BadEcho.Interop;
/// <summary>
/// Provides information that the system needs to display notifications in the
/// notification area.
/// </summary>
[NativeMarshalling(typeof(NotifyIconDataMarshaller))]
internal sealed class NotifyIconData
{
/// <summary>
/// Initializes a new instance of the <see cref="NotifyIconData"/> class.
/// </summary>
/// <param name="window">
/// A handle to the window that receives notifications associated with an icon in the
/// notification area.
/// </param>
/// <param name="id">The unique identifier of the taskbar icon.</param>
/// <param name="flags">
/// Flags that either indicate which of the other members of the structure contain valid
/// data or provide additional information to the tooltip as to how it should display.
/// </param>
public NotifyIconData(WindowHandle window, Guid id, NotifyIconFlags flags)
{
Require.NotNull(window, nameof(window));
Window = window;
Id = id;
// It is implied that the Guid identifier member is valid given our constructor's
// parameters.
Flags = flags | NotifyIconFlags.Guid;
}
/// <summary>
/// Gets a handle to the window that receives notifications associated with an icon
/// in the notification area.
/// </summary>
public WindowHandle Window
{ get; }
/// <summary>
/// Gets the unique identifier of the taskbar icon.
/// </summary>
public Guid Id
{ get; }
/// <summary>
/// Gets flags that either indicate which of the other members of the structure contain
/// valid data or provide additional information to the tooltip as to how it should display.
/// </summary>
public NotifyIconFlags Flags
{ get; }
/// <summary>
/// Gets or sets an application-defined message identifier.
/// </summary>
public uint CallbackMessage
{ get; set; }
/// <summary>
/// Gets or sets a handle to the icon to be added, modified, or deleted.
/// </summary>
public IconHandle? Icon
{ get; set; }
/// <summary>
/// Gets or sets the state of the icon.
/// </summary>
public uint State
{ get; set; }
/// <summary>
/// Gets or sets a value that specifies which bits of the <see cref="State"/> member
/// are retrieved or modified.
/// </summary>
public uint StateMask
{ get; set; }
/// <summary>
/// Gets or sets either the timeout value, in milliseconds, for the notification, or a
/// specification of which version of the Shell notification icon interface should be used.
/// </summary>
public uint TimeoutOrVersion
{ get; set; }
/// <summary>
/// Gets or sets flags that can be set to modify the behavior and appearance of a
/// balloon notification.
/// </summary>
public NotifyIconInfoFlags InfoFlags
{ get; set; }
/// <summary>
/// Gets or sets A handle to a customized notification icon that should be used independently
/// of the notification area icon.
/// </summary>
public IconHandle? BalloonIcon
{ get; set; }
/// <summary>
/// Gets or sets a string that specifies the text for a standard tooltip.
/// </summary>
public string? Tip
{ get; set; }
/// <summary>
/// Gets or sets a string that specifies the text to display in a balloon notification.
/// </summary>
public string? Info
{ get; set; }
/// <summary>
/// Gets or sets a string that specifies a title for a balloon notification.
/// </summary>
public string? InfoTitle
{ get; set; }
}