Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/DesktopManager/MonitorNativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
/// <summary>
/// Enumerates all top-level windows.
/// </summary>
/// <param name="lpEnumFunc">The callback function to invoke for each window.</param>

Check warning on line 68 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

XML comment has a param tag for 'lpEnumFunc', but there is no parameter by that name

Check warning on line 68 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

XML comment has a param tag for 'lpEnumFunc', but there is no parameter by that name

Check warning on line 68 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

XML comment has a param tag for 'lpEnumFunc', but there is no parameter by that name

Check warning on line 68 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

XML comment has a param tag for 'lpEnumFunc', but there is no parameter by that name

Check warning on line 68 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

XML comment has a param tag for 'lpEnumFunc', but there is no parameter by that name

Check warning on line 68 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

XML comment has a param tag for 'lpEnumFunc', but there is no parameter by that name
/// <param name="lParam">Application-defined value to pass to the callback function.</param>
/// <returns>True if the enumeration completes, false if it was cancelled.</returns>
public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam);

Check warning on line 71 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Parameter 'hWnd' has no matching param tag in the XML comment for 'MonitorNativeMethods.EnumWindowsProc' (but other parameters do)

Check warning on line 71 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Parameter 'hWnd' has no matching param tag in the XML comment for 'MonitorNativeMethods.EnumWindowsProc' (but other parameters do)

Check warning on line 71 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Parameter 'hWnd' has no matching param tag in the XML comment for 'MonitorNativeMethods.EnumWindowsProc' (but other parameters do)

Check warning on line 71 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Parameter 'hWnd' has no matching param tag in the XML comment for 'MonitorNativeMethods.EnumWindowsProc' (but other parameters do)

Check warning on line 71 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Parameter 'hWnd' has no matching param tag in the XML comment for 'MonitorNativeMethods.EnumWindowsProc' (but other parameters do)

Check warning on line 71 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Parameter 'hWnd' has no matching param tag in the XML comment for 'MonitorNativeMethods.EnumWindowsProc' (but other parameters do)
[DllImport("user32.dll")]
public static extern bool EnumWindows(EnumWindowsProc enumFunc, int lParam);

Check warning on line 73 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.EnumWindows(MonitorNativeMethods.EnumWindowsProc, int)'

Check warning on line 73 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.EnumWindows(MonitorNativeMethods.EnumWindowsProc, int)'

Check warning on line 73 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.EnumWindows(MonitorNativeMethods.EnumWindowsProc, int)'

Check warning on line 73 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.EnumWindows(MonitorNativeMethods.EnumWindowsProc, int)'

Check warning on line 73 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.EnumWindows(MonitorNativeMethods.EnumWindowsProc, int)'

Check warning on line 73 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.EnumWindows(MonitorNativeMethods.EnumWindowsProc, int)'

/// <summary>
/// Gets the window text length.
Expand Down Expand Up @@ -159,5 +159,11 @@
/// Window style values
/// </summary>
public const int WS_MINIMIZE = 0x20000000;
public const int WS_MAXIMIZE = 0x01000000;

Check warning on line 162 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.WS_MAXIMIZE'

Check warning on line 162 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.WS_MAXIMIZE'

Check warning on line 162 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.WS_MAXIMIZE'

Check warning on line 162 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.WS_MAXIMIZE'

Check warning on line 162 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.WS_MAXIMIZE'

Check warning on line 162 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.WS_MAXIMIZE'

/// <summary>
/// Window position flags
/// </summary>
public const int SWP_NOZORDER = 0x0004;
public const int SWP_NOSIZE = 0x0001;

Check warning on line 168 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.SWP_NOSIZE'

Check warning on line 168 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.SWP_NOSIZE'

Check warning on line 168 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.SWP_NOSIZE'

Check warning on line 168 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 7

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.SWP_NOSIZE'

Check warning on line 168 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.SWP_NOSIZE'

Check warning on line 168 in Sources/DesktopManager/MonitorNativeMethods.cs

View workflow job for this annotation

GitHub Actions / Windows PowerShell 5.1

Missing XML comment for publicly visible type or member 'MonitorNativeMethods.SWP_NOSIZE'
}
8 changes: 3 additions & 5 deletions Sources/DesktopManager/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void SetWindowPosition(WindowInfo windowInfo, int left, int top) {
top,
-1,
-1,
1)) {
MonitorNativeMethods.SWP_NOZORDER | MonitorNativeMethods.SWP_NOSIZE)) {
throw new InvalidOperationException("Failed to set window position");
}
}
Expand All @@ -146,11 +146,9 @@ public void SetWindowPosition(WindowInfo windowInfo, int left, int top) {
/// <param name="width">The width of the window. Use -1 to keep current width.</param>
/// <param name="height">The height of the window. Use -1 to keep current height.</param>
public void SetWindowPosition(WindowInfo windowInfo, int left, int top, int width = -1, int height = -1) {
const int SWP_NOZORDER = 0x0004;
const int SWP_NOMOVE = 0x0002;
const int SWP_NOSIZE = 0x0001;

int flags = SWP_NOZORDER;
int flags = MonitorNativeMethods.SWP_NOZORDER;

// If position is -1, don't move
if (left < 0 && top < 0) {
Expand All @@ -159,7 +157,7 @@ public void SetWindowPosition(WindowInfo windowInfo, int left, int top, int widt

// If size is -1, don't resize
if (width < 0 && height < 0) {
flags |= SWP_NOSIZE;
flags |= MonitorNativeMethods.SWP_NOSIZE;
}

if (!MonitorNativeMethods.SetWindowPos(
Expand Down