- WM_SHOWWINDOW message
- Parameters
- Return value
- Remarks
- Move-Item
- Syntax
- Description
- Examples
- Example 1: Move a file to another directory and rename it
- Example 2: Move a directory and its contents to another directory
- Example 3: Move all files of a specified extension from the current directory to another directory
- Example 4: Recursively move all files of a specified extension from the current directory to another directory
- Example 5: Move registry keys and values to another key
- Example 6: Move a directory and its contents to a subdirectory of the specified directory
- Parameters
- Inputs
- Outputs
- Notes
- Access or move a window, when its Title Bar goes off screen in Windows 10
- Window title bar goes off-screen
- How to move a window that is off-screen in Windows 10
- Access UI controls that extend off the screen
WM_SHOWWINDOW message
Sent to a window when the window is about to be hidden or shown.
A window receives this message through its WindowProc function.
Parameters
Indicates whether a window is being shown. If wParam is TRUE, the window is being shown. If wParam is FALSE, the window is being hidden.
The status of the window being shown. If lParam is zero, the message was sent because of a call to the ShowWindow function; otherwise, lParam is one of the following values.
Value | Meaning |
---|---|
SW_OTHERUNZOOM 4 | The window is being uncovered because a maximize window was restored or minimized. |
SW_OTHERZOOM 2 | The window is being covered by another window that has been maximized. |
SW_PARENTCLOSING 1 | The window’s owner window is being minimized. |
SW_PARENTOPENING 3 | The window’s owner window is being restored. |
Return value
Type: LRESULT
If an application processes this message, it should return zero.
Remarks
The DefWindowProc function hides or shows the window, as specified by the message. If a window has the WS_VISIBLE style when it is created, the window receives this message after it is created, but before it is displayed. A window also receives this message when its visibility state is changed by the ShowWindow or ShowOwnedPopups function.
The WM_SHOWWINDOW message is not sent under the following circumstances:
- When a top-level, overlapped window is created with the WS_MAXIMIZE or WS_MINIMIZE style.
- When the SW_SHOWNORMAL flag is specified in the call to the ShowWindow function.
Move-Item
Moves an item from one location to another.
Syntax
Description
The Move-Item cmdlet moves an item, including its properties, contents, and child items, from one location to another location. The locations must be supported by the same provider. For example, it can move a file or subdirectory from one directory to another or move a registry subkey from one key to another. When you move an item, it is added to the new location and deleted from its original location.
Examples
Example 1: Move a file to another directory and rename it
This command moves the «Test.txt» file from the C: drive to the «E:\Temp» directory and renames it from «test.txt» to «tst.txt».
Example 2: Move a directory and its contents to another directory
This command moves the «C:\Temp» directory and its contents to the «C:\Logs» directory. The «Temp» directory, and all of its subdirectories and files, then appear in the «Logs» directory.
Example 3: Move all files of a specified extension from the current directory to another directory
This command moves all of the text files («*.txt») in the current directory (represented by a dot (‘.’)) to the «C:\Logs» directory.
Example 4: Recursively move all files of a specified extension from the current directory to another directory
This command moves all of the text files from the current directory and all subdirectories, recursively, to the «C:\TextFiles» directory.
The command uses the Get-ChildItem cmdlet to get all of the child items in the current directory (represented by the dot [.]) and its subdirectories that have a «.txt» file name extension. It uses the Recurse parameter to make the retrieval recursive and the Include parameter to limit the retrieval to «.txt» files.
The pipeline operator ( | ) sends the results of this command to Move-Item , which moves the text files to the «TextFiles» directory.
If files that are to be moved to «C:\Textfiles» have the same name, Move-Item displays an error and continues, but it moves only one file with each name to «C:\Textfiles». The other files remain in their original directories.
If the «Textfiles» directory (or any other element of the destination path) does not exist, the command fails. The missing directory is not created for you, even if you use the Force parameter. Move-Item moves the first item to a file called «Textfiles» and then displays an error explaining that the file already exists.
Also, by default, Get-ChildItem does not move hidden files. To move hidden files, use the Force parameter with Get-ChildItem .
Note: In Windows PowerShell 2.0, when using the Recurse parameter of the Get-ChildItem cmdlet, the value of the Path parameter must be a container. Use the Include parameter to specify the .txt file name extension filter ( Get-ChildItem -Path .\* -Include *.txt -Recurse | Move-Item -Destination C:\TextFiles ).
Example 5: Move registry keys and values to another key
This command moves the registry keys and values within the «MyCompany» registry key in «HKLM\Software» to the «MyNewCompany» key. The wildcard character (‘*’) indicates that the contents of the «MyCompany» key should be moved, not the key itself. In this command, the optional Path and Destination parameter names are omitted.
Example 6: Move a directory and its contents to a subdirectory of the specified directory
This command moves the «Logs[Sept`06]» directory (and its contents) into the «Logs[2006]» directory.
The LiteralPath parameter is used instead of Path, because the original directory name includes left bracket and right bracket characters («[» and «]»). The path is also enclosed in single quotation marks (‘ ‘), so that the backtick symbol (`) is not misinterpreted.
The Destination parameter does not require a literal path, because the Destination variable also must be enclosed in single quotation marks, because it includes brackets that can be misinterpreted.
Parameters
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
This parameter is not supported by any providers installed with PowerShell. To impersonate another user, or elevate your credentials when running this cmdlet, use Invoke-Command.
Type: | PSCredential |
Position: | Named |
Default value: | Current user |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the path to the location where the items are being moved. The default is the current directory. Wildcards are permitted, but the result must specify a single location.
To rename the item being moved, specify a new name in the value of the Destination parameter.
Type: | String |
Position: | 1 |
Default value: | Current directory |
Accept pipeline input: | True |
Accept wildcard characters: | True |
Specifies, as a string array, an item or items that this cmdlet excludes from the operation. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as «*.txt». Wildcard characters are permitted.
Type: | String [ ] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies a filter in the format or language of the provider. The value of this parameter qualifies the Path parameter.
The syntax of the filter, including the use of wildcard characters, depends on the provider. Filters are more efficient than other parameters, because the provider applies them when the cmdlet gets the objects rather than having PowerShell filter the objects after they are retrieved.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Forces the command to run without asking for user confirmation. Implementation varies from provider to provider. For more information, see about_Providers.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies, as a string array, an item or items that this cmdlet moves in the operation. The value of this parameter qualifies the Path parameter. Enter a path element or pattern, such as «*.txt». Wildcard characters are permitted.
Type: | String [ ] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | True |
Specifies the path to the current location of the items. Unlike the Path parameter, the value of LiteralPath is used exactly as it is typed. No characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks tell PowerShell not to interpret any characters as escape sequences.
Type: | String [ ] |
Aliases: | PSPath |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the path to the current location of the items. The default is the current directory. Wildcard characters are permitted.
Type: | String [ ] |
Position: | 0 |
Default value: | Current directory |
Accept pipeline input: | True |
Accept wildcard characters: | True |
Includes the command in the active transaction. This parameter is valid only when a transaction is in progress. For more information, see about_Transactions.
Type: | SwitchParameter |
Aliases: | usetx |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
You can pipe a string that contains a path to this cmdlet.
Outputs
None or an object representing the moved item.
When you use the PassThru parameter, this cmdlet generates an object representing the moved item. Otherwise, this cmdlet does not generate any output.
Notes
This cmdlet will move files between drives that are supported by the same provider, but it will move directories only within the same drive.
Because a Move-Item command moves the properties, contents, and child items of an item, all moves are recursive by default.
This cmdlet is designed to work with the data exposed by any provider. To list the providers available in your session, type Get-PSProvider . For more information, see about_Providers.
Access or move a window, when its Title Bar goes off screen in Windows 10
On occasions it may have happened that the title bar of your open application window in Windows 10/8/7, may have moved off-screen, i .e., your application window slides off the desktop, as a result of which you are unable to move or close the window with the help of your mouse pointer.
Window title bar goes off-screen
This post shows how to move a window that is off the screen in Windows with the keyboard and bring the misplaced off-screen window back to your desktop.
This simple tip will help you move the window in such situations.
How to move a window that is off-screen in Windows 10
- Hold down Alt+Space-bar and then press the M key too. Let go of all the keys.
- Alternatively, you can also hold Shift down and right-click on the program’s icon in the taskbar, and select Move.
- You will see your mouse cursor transform into a 4-way arrow and place itself over the window’s title bar.
- Now use the arrow keys of your keyboard to relocate or move the window.
- Right-click the mouse when you have moved the window and are done.
Access UI controls that extend off the screen
If you are unable to access some user interface controls that extend off the screen on low-resolution computers, try this.
Press the ALT key to highlight which control currently has focus. Keep pressing TAB till the focus is moved to the control on the interface that extends off the screen and then press Enter.
To close an application, whose ‘x’ you cannot access, simply press ALT+F4 to close it.
UPDATE: If your Windows supports it, you could use the Aero Snap feature.
Date: September 14, 2018 Tags: Explorer, Tips, Tricks