Calendar

<<  May 2017  >>
MonTueWedThuFriSatSun
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

RecentComments

None

 
 
     
 

If you are using a GUI it is nice to have a form icon. I didn't want to have an ico or bmp file in the same folder as the ps1 file because it might get lost. So this bit of code can be put into your ps1 source file to give you a form icon

$iconstring = (@"
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACB
VGfHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUw
AADqYAAAOpgAABdwnLpRPAAAADBQTFRFAAAAgAAA
AIAAgIAAAACAgACAAICAwMDAgICA/wAAAP8A//8A
AAD//wD/AP//////TxMmSQAAACxJREFUKM9jcEED
DLQSYGBgQBFw4N69gQECIALcu+GAZQQKODDAAS2j
gUQBAF/KwfacIWwzAAAAAElFTkSuQmCC
"@)
.replace("`n", "")
$memory = new-object System.IO.MemoryStream
$memory.write(($bytes=[System.Convert]::FromBase64String($iconstring)), 0, $bytes.length)
$FORM.Icon = [System.Drawing.Icon]::FromHandle((new-object System.Drawing.Bitmap -argument $memory).GetHIcon())

Before and After

Before and After

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Add comment