Repository navigation
Expand file tree
/
Copy pathIWindow.cs
More file actions
160 lines (137 loc) · 6.09 KB
/
Copy pathIWindow.cs
File metadata and controls
160 lines (137 loc) · 6.09 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
using System;
using System.Collections.Generic;
using ProcessNET.Native;
using ProcessNET.Native.Types;
using ProcessNET.Threads;
using ProcessNET.Windows.Keyboard;
using ProcessNET.Windows.Mouse;
namespace ProcessNET.Windows
{
/// <summary>
/// An interface that defines operations and values r
/// </summary>
public interface IWindow : IDisposable
{
/// <summary>
/// Gets all the child windows of this window.
/// </summary>
IEnumerable<IWindow> Children { get; }
/// <summary>
/// Gets the class name of the window.
/// </summary>
string ClassName { get; }
/// <summary>
/// The handle of the window.
/// </summary>
/// <remarks>
/// The type here is not <see cref="SafeMemoryHandle" /> because a window cannot be closed by calling
/// <see cref="Kernel32.CloseHandle" />.
/// For more information, see:
/// http://stackoverflow.com/questions/8507307/why-cant-i-close-the-window-handle-in-my-code.
/// </remarks>
IntPtr Handle { get; }
/// <summary>
/// Gets or sets the height of the element.
/// </summary>
int Height { get; set; }
/// <summary>
/// Gets if the window is currently activated.
/// </summary>
bool IsActivated { get; }
/// <summary>
/// Gets if this is the main window.
/// </summary>
bool IsMainWindow { get; }
/// <summary>
/// Tools for managing a virtual keyboard in the window.
/// </summary>
IKeyboard Keyboard { get; set; }
/// <summary>
/// Tools for managing a virtual mouse in the window.
/// </summary>
IMouse Mouse { get; set; }
/// <summary>
/// Gets or sets the placement of the window.
/// </summary>
WindowPlacement Placement { get; set; }
/// <summary>
/// Gets or sets the specified window's show state.
/// </summary>
WindowStates State { get; set; }
/// <summary>
/// Gets the thread of the window.
/// </summary>
IRemoteThread Thread { get; }
/// <summary>
/// Gets or sets the title of the window.
/// </summary>
string Title { get; set; }
/// <summary>
/// Gets or sets the width of the element.
/// </summary>
int Width { get; set; }
/// <summary>
/// Gets or sets the x-coordinate of the window.
/// </summary>
int X { get; set; }
/// <summary>
/// Gets or sets the y-coordinate of the window.
/// </summary>
int Y { get; set; }
/// <summary>
/// Activates the window.
/// </summary>
void Activate();
/// <summary>
/// Closes the window.
/// </summary>
void Close();
/// <summary>
/// Flashes the window, typically one time. It does not change the active state of the window.
/// </summary>
void Flash();
/// <summary>
/// Flashes the window. It does not change the active state of the window.
/// </summary>
/// <param name="count">The number of times to flash the window.</param>
/// <param name="timeout">The rate at which the window is to be flashed.</param>
/// <param name="flags">The flash status.</param>
void Flash(int count, TimeSpan timeout, FlashWindowFlags flags = FlashWindowFlags.All);
/// <summary>
/// Places (posts) a message in the message queue associated with the thread that created the window and returns
/// without waiting for the thread to process the message.
/// </summary>
/// <param name="message">The message to be posted.</param>
/// <param name="wParam">Additional message-specific information.</param>
/// <param name="lParam">Additional message-specific information.</param>
void PostMessage(WindowsMessages message, IntPtr wParam, IntPtr lParam);
/// <summary>
/// Places (posts) a message in the message queue associated with the thread that created the window and returns
/// without waiting for the thread to process the message.
/// </summary>
/// <param name="message">The message to be posted.</param>
/// <param name="wParam">Additional message-specific information.</param>
/// <param name="lParam">Additional message-specific information.</param>
void PostMessage(int message, IntPtr wParam, IntPtr lParam);
/// <summary>
/// Sends the specified message to a window or windows.
/// The SendMessage function calls the window procedure for the specified window and does not return until the window
/// procedure has processed the message.
/// </summary>
/// <param name="message">The message to be sent.</param>
/// <param name="wParam">Additional message-specific information.</param>
/// <param name="lParam">Additional message-specific information.</param>
/// <returns>The return value specifies the result of the message processing; it depends on the message sent.</returns>
IntPtr SendMessage(WindowsMessages message, IntPtr wParam, IntPtr lParam);
/// <summary>
/// Sends the specified message to a window or windows.
/// The SendMessage function calls the window procedure for the specified window and does not return until the window
/// procedure has processed the message.
/// </summary>
/// <param name="message">The message to be sent.</param>
/// <param name="wParam">Additional message-specific information.</param>
/// <param name="lParam">Additional message-specific information.</param>
/// <returns>The return value specifies the result of the message processing; it depends on the message sent.</returns>
IntPtr SendMessage(int message, IntPtr wParam, IntPtr lParam);
}
}