@@ -36,6 +36,12 @@ Param(
36
36
[Parameter (Mandatory = $false , HelpMessage = " Display this help message" )][switch ]$help ,
37
37
[Parameter (Mandatory = $false , HelpMessage = " Uninstall" )][switch ]$uninstall
38
38
)
39
+ if ( test-path $env: TEMP ) {
40
+ $null = Set-Location $env: TEMP
41
+ }
42
+ elseif ( test-path " c:\windows\temp" ) {
43
+ $null = Set-Location " c:\windows\temp"
44
+ }
39
45
Add-Type - AssemblyName System.Drawing
40
46
Add-Type - AssemblyName System.Windows.Forms
41
47
Add-Type - AssemblyName PresentationFramework
@@ -425,7 +431,11 @@ Function GetIcon {
425
431
$Rectangle = [System.Drawing.RectangleF ]::FromLTRB(0 , 0 , 128 , 128 )
426
432
$graphics.DrawString ($number , $Font , $bg , $rectangle , $format )
427
433
$graphics.Dispose ()
428
- Return [System.Drawing.Icon ]::FromHandle(([System.Drawing.Bitmap ]::new($bmp ).GetHIcon()))
434
+ # $icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon())))
435
+ # $icon = ([System.Drawing.Icon]::FromHandle(([System.Drawing.Bitmap]::new($graphics).GetHIcon())))
436
+ # $icon = $bmp.GetHIcon()
437
+ $icon = [System.Drawing.Icon ]::FromHandle(([System.Drawing.Bitmap ]::new($bmp ).GetHIcon()))
438
+ Return $icon
429
439
}
430
440
431
441
# experimental setting to check "focus assist"
@@ -448,4 +458,4 @@ function DisturbOk {
448
458
else { return $true }
449
459
}
450
460
451
- & $MainFunction
461
+ & $MainFunction
0 commit comments