Add cmdlets to play with window position#3
Merged
PrzemyslawKlys merged 35 commits intomasterfrom Mar 21, 2025
Merged
Conversation
- Introduced methods for getting shell window handle, enumerating windows, and retrieving window text. - Added functionality to check window visibility and manipulate window positions. - Enhanced display settings management with new extern method signatures.
- Introduced WindowMessage enum for system command messages. - Added WindowCommand enum with various window commands.
- Introduced WindowInfo class to represent basic window information. - Added WindowPosition class inheriting from WindowInfo to include position details.
- Implement CmdletGetDesktopWindow class to get information about visible windows. - Support filtering windows by title using wildcards. - Include examples in the documentation for usage.
…tions - Implement CmdletGetDesktopWindowPosition class to get the position of desktop windows. - Support filtering of windows by title using wildcards. - Include examples in the documentation for usage.
- Implement CmdletSetDesktopWindowPosition to set the position of a desktop window. - Support identifying windows by title with wildcard matching. - Include parameters for window title, left position, and top position. - Add processing logic to move the specified window to the desired coordinates.
- Implement Cmdlet to set the state of desktop windows (close, minimize, maximize, restore). - Support for identifying windows by title with wildcard matching. - Include error handling for window state changes.
…tion - Added 'Get-DesktopWindow', 'Get-DesktopWindowPosition', 'Set-DesktopWindowPosition', and 'Set-DesktopWindowState' to CmdletsToExport - Updated module description to reflect window management capabilities - Corrected Tags and IconUri in PrivateData section
- Implement methods to get, set, close, minimize, maximize, and restore windows. - Include functionality to retrieve all visible windows with optional title filtering. - Add support for getting and setting window positions.
- Improved handling of wildcard patterns in window title filtering. - Added support for wildcards at the start, end, and middle of the pattern.
- Consolidate CmdletsToExport array formatting - Refine module description for accuracy - Update ModuleVersion to '2.0.2' - Adjust Tags for consistency
- Import DesktopManager module - Retrieve and format desktop windows in a table
- Updated summary and description to reflect both position and size adjustments. - Added examples demonstrating setting window size along with position. - Modified ShouldProcess message to include width and height parameters. - Updated SetWindowPosition method call to include width and height.
- Moved Width and Height properties into the WindowInfo class for better encapsulation. - Updated documentation to reflect changes in property locations. - Ensured WindowPosition class remains intact for position and size representation.
- Added optional width and height parameters to SetWindowPosition method - Updated method implementation to handle resizing of windows - Improved error handling with an exception for failed position setting
- Enhanced GetWindows method to retrieve and store the position of each window. - Added Left, Top, Right, and Bottom properties to WindowInfo for position data.
…he module's functionality.
…wPosition method to identify the primary monitor for each window.
- Introduced MonitorIndex to track the primary monitor index. - Added MonitorDeviceId for identifying the monitor device. - Included MonitorDeviceName for the monitor's name. - Added IsOnPrimaryMonitor to indicate if the window is on the primary monitor.
- Introduced WindowState enum with values for Normal, Minimize, Maximize, and Close. - Provides a structured way to manage and reference window states in the application.
- Reorganized code structure for better readability - Added summary comments for properties and methods - Ensured consistent formatting and spacing
- Adjusted Format-Table to display all properties of desktop windows - Modified Set-DesktopWindowPosition to maximize a specific window by name
- Introduced CmdletSetDesktopWindow to manage window position, size, and state. - Removed CmdletSetDesktopWindowPosition and CmdletSetDesktopWindowState for consolidation. - Enhanced functionality to support window state changes (minimize, maximize, close, restore).
…etsToExport in DesktopManager.psd1 - Updated CmdletsToExport to streamline available cmdlets - Removed unnecessary cmdlets for improved clarity
…tting - Moved window position setting logic inside the process check - Removed duplicate position setting code
- Added retrieval of window state (minimized, maximized, normal) in GetWindows method. - Updated SetWindowPosition method to conditionally move or resize windows based on input parameters.
…roperties - Updated summary for the State property to reflect its purpose. - Removed ShouldResize and ShouldReposition properties for simplification.
- Introduced GetWindowLong method for retrieving window information. - Defined constants for window style values (GWL_STYLE, WS_MINIMIZE, WS_MAXIMIZE).
- Replace Set-DesktopWindowPosition with Set-DesktopWindow - Specify Height, Width, and Left position for the window
- Changed VersionPrefix from 1.0.1 to 3.0.0
…o 3.0.0 - Changed VersionPrefix from 2.0.0 to 3.0.0
- Added `Get-DesktopWindow` - Added `Set-DesktopWindow`
- Incremented ModuleVersion from 2.0.2 to 3.0.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds 2 cmdlets for use in PowerShell
In C# adds multiple methods to use in C#