forked from ChrisTitusTech/winutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create ep refresh function & map tweaks
- Loading branch information
1 parent
bcfbce6
commit 2fcf076
Showing
5 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function Invoke-WinUtilExplorerRefresh { | ||
<# | ||
.SYNOPSIS | ||
Refreshes the Windows Explorer | ||
#> | ||
|
||
Invoke-WPFRunspace -DebugPreference $DebugPreference -ScriptBlock { | ||
# Send the WM_SETTINGCHANGE message to all windows | ||
Add-Type -TypeDefinition @" | ||
using System; | ||
using System.Runtime.InteropServices; | ||
public class Win32 { | ||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] | ||
public static extern IntPtr SendMessageTimeout( | ||
IntPtr hWnd, | ||
uint Msg, | ||
IntPtr wParam, | ||
string lParam, | ||
uint fuFlags, | ||
uint uTimeout, | ||
out IntPtr lpdwResult); | ||
} | ||
"@ | ||
|
||
$HWND_BROADCAST = [IntPtr]0xffff | ||
$WM_SETTINGCHANGE = 0x1A | ||
$SMTO_ABORTIFHUNG = 0x2 | ||
$timeout = 100 | ||
|
||
# Send the broadcast message to all windows | ||
[Win32]::SendMessageTimeout($HWND_BROADCAST, $WM_SETTINGCHANGE, [IntPtr]::Zero, "ImmersiveColorSet", $SMTO_ABORTIFHUNG, $timeout, [ref]([IntPtr]::Zero)) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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