You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 26, 2023. It is now read-only.
// Copyright (c) to owners found in https://github.com/AArnott/pinvoke/blob/master/COPYRIGHT.md. All rights reserved.
2
+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
3
+
4
+
namespacePInvoke
5
+
{
6
+
/// <content>
7
+
/// Contains the <see cref="GetWindowCommands"/> nested type.
8
+
/// </content>
9
+
publicpartialclassUser32
10
+
{
11
+
/// <summary>The commands that can be used as arguments to <see cref="GetWindow" />.</summary>
12
+
publicenumGetWindowCommands
13
+
{
14
+
/// <summary>
15
+
/// The retrieved handle identifies the window of the same type that is highest in the Z order.
16
+
/// If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.
17
+
/// </summary>
18
+
GW_HWNDFIRST=0,
19
+
20
+
/// <summary>
21
+
/// The retrieved handle identifies the window of the same type that is lowest in the Z order.
22
+
/// If the specified window is a topmost window, the handle identifies a topmost window. If the specified window is a top-level window, the handle identifies a top-level window. If the specified window is a child window, the handle identifies a sibling window.
23
+
/// </summary>
24
+
GW_HWNDLAST=1,
25
+
26
+
/// <summary>Returns a handle to the window below the given window.</summary>
27
+
GW_HWNDNEXT=2,
28
+
29
+
/// <summary>Returns a handle to the window above the given window.</summary>
30
+
GW_HWNDPREV=3,
31
+
32
+
/// <summary>The retrieved handle identifies the specified window's owner window, if any. For more information, see Owned Windows.</summary>
33
+
GW_OWNER=4,
34
+
35
+
/// <summary>The retrieved handle identifies the child window at the top of the Z order, if the specified window is a parent window; otherwise, the retrieved handle is NULL. The function examines only child windows of the specified window. It does not examine descendant windows.</summary>
36
+
GW_CHILD=5,
37
+
38
+
/// <summary>The retrieved handle identifies the enabled popup window owned by the specified window (the search uses the first such window found using <see cref="GW_HWNDNEXT" />); otherwise, if there are no enabled popup windows, the retrieved handle is that of the specified window.</summary>
Copy file name to clipboardExpand all lines: src/User32/User32.cs
+74Lines changed: 74 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -237,6 +237,12 @@ public static extern unsafe int GetClassName(
237
237
[Friendly(FriendlyFlags.Array)]char*lpClassName,
238
238
intnMaxCount);
239
239
240
+
/// <summary>
241
+
/// Retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.
242
+
/// </summary>
243
+
/// <param name="hWnd">A handle to the window. </param>
244
+
/// <param name="lpdwProcessId">A pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not.</param>
245
+
/// <returns>The return value is the identifier of the thread that created the window. </returns>
@@ -2362,6 +2368,51 @@ public static extern unsafe int GetWindowText(
2362
2368
[Friendly(FriendlyFlags.Array)]char*lpString,
2363
2369
intnMaxCount);
2364
2370
2371
+
/// <summary>
2372
+
/// Changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. However, SetWindowText cannot change the text of a control in another application.
2373
+
/// </summary>
2374
+
/// <param name="hWnd">A handle to the window or control whose text is to be changed. </param>
2375
+
/// <param name="lpString">The new title or control text. </param>
2376
+
/// <returns>
2377
+
/// If the function succeeds, the return value is nonzero.
2378
+
/// If the function fails, the return value is zero. To get extended error information, call GetLastError.
/// Examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order.
2388
+
/// </summary>
2389
+
/// <param name="hWnd">A handle to the parent window whose child windows are to be examined. If this parameter is NULL, the function returns a handle to the window at the top of the Z order.</param>
2390
+
/// <returns>
2391
+
/// If the function succeeds, the return value is a handle to the child window at the top of the Z order. If the specified window has no child windows, the return value is NULL. To get extended error information, use the GetLastError function.
2392
+
/// </returns>
2393
+
[DllImport(nameof(User32),SetLastError=true)]
2394
+
publicstaticexternIntPtrGetTopWindow(IntPtrhWnd);
2395
+
2396
+
/// <summary>
2397
+
/// Retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.
2398
+
/// </summary>
2399
+
/// <param name="hWnd">A handle to a window. The window handle retrieved is relative to this window, based on the value of the wCmd parameter. </param>
2400
+
/// <param name="wCmd">The relationship between the specified window and the window whose handle is to be retrieved.</param>
2401
+
/// <returns>If the function succeeds, the return value is a handle to the next (or previous) window. If there is no next (or previous) window, the return value is NULL. To get extended error information, call GetLastError.</returns>
2402
+
[DllImport(nameof(User32),SetLastError=true)]
2403
+
publicstaticexternIntPtrGetWindow(
2404
+
IntPtrhWnd,
2405
+
GetWindowCommandswCmd);
2406
+
2407
+
/// <summary>
2408
+
/// Retrieves a handle to the next or previous window in the Z-Order. The next window is below the specified window; the previous window is above.
2409
+
/// If the specified window is a topmost window, the function searches for a topmost window. If the specified window is a top-level window, the function searches for a top-level window. If the specified window is a child window, the function searches for a child window.
2410
+
/// </summary>
2411
+
/// <param name="hWnd">A handle to a window. The window handle retrieved is relative to this window, based on the value of the wCmd parameter. </param>
2412
+
/// <param name="wCmd">Indicates whether the function returns a handle to the next window or the previous window.</param>
2413
+
/// <returns>If the function succeeds, the return value is a handle to the next (or previous) window. If there is no next (or previous) window, the return value is NULL. To get extended error information, call GetLastError.</returns>
/// Moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen
2367
2418
/// rectangle set by the most recent ClipCursor function call, the system automatically adjusts the coordinates so that the
@@ -2548,6 +2599,20 @@ public static unsafe extern IntPtr CreateWindowEx(
2548
2599
IntPtrhInstance,
2549
2600
void*lpParam);
2550
2601
2602
+
/// <summary>
2603
+
/// Destroys the specified window. The function sends WM_DESTROY and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).
2604
+
/// If the specified window is a parent or owner window, DestroyWindow automatically destroys the associated child or owned windows when it destroys the parent or owner window. The function first destroys child or owned windows, and then it destroys the parent or owner window.
2605
+
/// DestroyWindow also destroys modeless dialog boxes created by the CreateDialog function.
2606
+
/// </summary>
2607
+
/// <param name="hWnd">A handle to the window to be destroyed. </param>
2608
+
/// <returns>
2609
+
/// If the function succeeds, the return value is nonzero.
2610
+
/// If the function fails, the return value is zero. To get extended error information, call GetLastError.
/// The BeginPaint function prepares the specified window for painting and fills a <see cref="PAINTSTRUCT"/> structure with information about the painting.
0 commit comments