Skip to content

Commit

Permalink
Fixed temporary directory location
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkessel authored Aug 13, 2024
1 parent 5e78937 commit 901d975
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sit-stand.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ Param(
[Parameter(Mandatory = $false, HelpMessage = "Display this help message")][switch]$help,
[Parameter(Mandatory = $false, HelpMessage = "Uninstall")][switch]$uninstall
)
if ( test-path $env:TEMP ) {
$null = Set-Location $env:TEMP
}
elseif ( test-path "c:\windows\temp" ) {
$null = Set-Location "c:\windows\temp"
}
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName PresentationFramework
Expand Down Expand Up @@ -425,7 +431,11 @@ Function GetIcon {
$Rectangle = [System.Drawing.RectangleF]::FromLTRB(0, 0, 128, 128)
$graphics.DrawString($number, $Font, $bg, $rectangle, $format)
$graphics.Dispose()
Return [System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($bmp).GetHIcon()))
#$icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon())))
#$icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon())))
#$icon = $bmp.GetHIcon()
$icon = [System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($bmp).GetHIcon()))
Return $icon
}

# experimental setting to check "focus assist"
Expand All @@ -448,4 +458,4 @@ function DisturbOk {
else { return $true }
}

& $MainFunction
& $MainFunction

0 comments on commit 901d975

Please sign in to comment.