http://dieseyer.de • all rights reserved • © 2011 v11.4
'*** v9.4 *** www.dieseyer.de ******************************
'
' Datei: icon.vbs
' Autor: dieseyer@gmx.de
' Auf: www.dieseyer.de
'
' In Hta kann ein Symbol (Icon) für das Hta definiert werden:
' ICON="dieseyer.ico"
' The ICON attribute in Hta can be set with
' ICON="dieseyer.ico"
' Die Prozedur IcoAusHexDaten() erstellt aus den im Hta
' hinterlegten Binärdaten eine Icon-Datei.
' Einfügen der Binärdaten eines Icons: Öffnen der Ico-Datei
' mit PSPad; die Anzeige erfolgt im HEX-Format. Mit
' [Strg-a][Strg-c] befindet sich die gesamte Datei im HEX-
' Format in der Zwischenablage. Diese Zeichenkette wird hier
' im Beispiel der Variable Tst zugewiesen. Beim Aufruf von
' IcoAusHexDaten( ZielDatei, Txt )
' werden die Zeichen in die Icon-Datei geschrieben.
'
' Aus einer 4KByte Ico-Datei wird eine 8KByte Zeichenkette!
'
' The procedure IcoAusHexDaten() create icon from data
' that was set in hta.
' Input data in hta: Open ico-file with pspad-editor in
' hex-view, press [ctrl-a], [ctrl-c] and paste the clipboard-
' string to variable 'Tst' in Hta-code.
'
' Vergl.
' http://dieseyer.de/scr/WIM-BuR.hta
'
'***********************************************************
Option Explicit ' Siehe http://dieseyer.de/dse-wsh-lernen.html#OptionExpl
Dim Tst
Tst = "0000010001002020000001001800A80C00001600000028000000200000004000000001001800000000000000000048000000480000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFEFEFEFBFBFBFDFDFDF2F2F2F5F5F5F0F0F0FFFFFFFFFFFFFAFAFAE1E1E1E6E6E6E6E6E6ECECECF4F4F4FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCFCFCE9E9E9ECECECF6F6F6FFFFFFF1F1F1E0E0E0F0F0F0FEFEFEFFFFFFFAFAFAEDEDEDF6F6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B63737379898987B7B7B5B5B5BACACACDBDBDBAAAAAAC6C6C67E7E7E6F6F6FADADADB3B3B3AEAEAEDFDFDFD3D3D3F3F3F3FFFFFFFFFFFFFFFFFFFFFFFFCDCDCD6A6A6AADADADE7E7E7DCDCDCE9E9E9FBFBFBFFFFFFFCFCFCBBBBBBDFDFDFA4A4A4ABABABC0C0C0575757A4A4A4FBFBFBF6F6F6F7F7F7FBFBFBDBDBDB8888889F9F9FA1A1A1808080B3B3B3B0B0B0D3D3D3FDFDFDFFFFFFFFFFFFFFFFFF717171555555999999DDDDDDB5B5B5CECECEF7F7F7DDDDDDBEBEBEB8B8B8D6D6D6B0B0B05757576C6C6CB0B0B0E8E8E8FFFFFFFFFFFFFFFFFFFFFFFFFEFEFEA4A4A4F9F9F9E9E9E98888888C8C8C8F8F8FBDBDBDE6E6E6FFFFFFFFFFFFFFFFFF4747474A4A4A707070A3A3A3B4B4B4B2B2B2D0D0D0AAAAAA979797969696A3A3A3717171535353CECECEE0E0E0DBDBDBFFFFFFFFFFFFFFFFFFFFFFFFF6F6F6A8A8A8FEFEFEE5E5E59696967979796F6F6F9D9D9DC6C6C6FDFDFDFFFFFFFFFFFF4A4A4A3B3B3B6464647C7C7C9595957C7C7C9595958484846A6A6A4D4D4D5C5C5C747474A3A3A3B9B9B9EEEEEEC6C6C6FEFEFEFFFFFFFFFFFFFFFFFFE1E1E1ABABABFEFEFEBBBBBBA7A7A78787875151518C8C8CB4B4B4FBFBFBFFFFFFFFFFFF4848483E3E3E7474748A8A8A7A7A7A6060608383838585858A8A8A6C6C6C747474959595949494929292FBFBFBB4B4B4F7F7F7FFFFFFFFFFFFFFFFFFBFBFBFB7B7B7F4F4F4858585AFAFAF7A7A7A4141417D7D7DA1A1A1F7F7F7FFFFFFFFFFFF5252525151512525257B7B7B6D6D6D515151787878787878A6A6A68F8F8F333333717171A6A6A6939393D1D1D1C4C4C4EBEBEBFFFFFFFFFFFFFEFEFE9F9F9FDCDCDCCDCDCD747474A8A8A86C6C6C6E6E6E656565777777EDEDEDFFFFFFFFFFFF5757576060605D5D5D8D8D8D6E6E6E6868687171716F6F6F8484848F8F8F6E6E6E515151979797BBBBBB828282E2E2E2DADADAFDFDFDFFFFFFFDFDFDBCBCBCF5F5F58D8D8D6666669A9A9A8383835F5F5F6C6C6C787878E9E9E9FFFFFFFFFFFF3D3D3D6E6E6E7A7A7A6969697878786E6E6E6A6A6A6262627C7C7C9898986E6E6E909090838383AEAEAE9D9D9D909090C3C3C3848484AAAAAAD4D4D4BDBDBDDCDCDC7D7D7D9494949999999898986767678E8E8E808080E9E9E9FFFFFFFFFFFF5959595252527E7E7E7575758B8B8B8A8A8A7E7E7E9696968686867A7A7A949494959595C9C9C9C7C7C7CECECEC2C2C2C4C4C4A8A8A8C1C1C1C8C8C8D6D6D6CBCBCBB5B5B5BFBFBFC2C2C2BEBEBE8A8A8A9393937A7A7AE7E7E7FFFFFFFFFFFF686868666666797979909090939393ABABAB888888999999B1B1B17D7D7DB9B9B9A7A7A7E4E4E4E8E8E8E7E7E7EEEEEEDADADADEDEDEE3E3E3FDFDFDF3F3F3EDEDEDF6F6F6F5F5F5DBDBDBE3E3E3D0D0D08B8B8B888888F9F9F9FFFFFFFFFFFF676767B0B0B0888888AAAAAAAFAFAFC8C8C89696969F9F9FBABABACDCDCDC6C6C6F0F0F0CECECEE1E1E1E1E1E1EDEDEDF8F8F8CFCFCFEBEBEBF5F5F5F5F5F5F8F8F8FDFDFDE3E3E3DDDDDDEFEFEFECECEC808080D5D5D5FFFFFFFFFFFFFFFFFF7A7A7A787878AFAFAFD6D6D6E0E0E0DFDFDFE5E5E5D1D1D1CCCCCCD9D9D9C3C3C3D5D5D5FDFDFDF8F8F8D4D4D4F0F0F0EAEAEAE8E8E8FDFDFDF2F2F2E5E5E5F7F7F7BDBDBDE0E0E0F4F4F4F8F8F8BFBFBFD3D3D3FEFEFEFFFFFFFFFFFFFFFFFF8B8B8B929292AFAFAFCACACAFCFCFCFDFDFDBEBEBEF4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E9E9E9E9E9E9FEFEFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F0F0DFDFDFECECECF2F2F2C5C5C5C0C0C0EFEFEFF7F7F7C4C4C4D5D5D5D5D5D5F6F6F6FEFEFEF4F4F4EEEEEEECECECDEDEDEE2E2E2FBFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
IcoAusHexDaten WScript.ScriptFullName & ".ico", Tst
MsgBox "Erledigt: " & WScript.ScriptFullName & ".ico", , WScript.ScriptName
WScript.Quit
'*** v9.4 *** www.dieseyer.de ******************************
Sub IcoAusHexDaten( ZielDatei, HexDaten )
'***********************************************************
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim FileOut, Tst, i
' Läßt sich die ZielDatei anlegen?
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Error Resume Next
Set FileOut = fso.OpenTextFile( ZielDatei, 2, True )
Tst = err.Number & " - " & err.Description
On Error GoTo 0
If Len( Tst ) > 4 Then Exit Sub
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i = 1
Do
FileOut.Write Chr( CInt( "&H" & Mid( HexDaten, i, 2 ) ) )
i = i + 2 : If i > Len( HexDaten ) Then Exit Do
Loop
FileOut.Close
Set FileOut = nothing
' CreateObject("WScript.Shell").SendKeys "{F5}"
End Sub ' IcoAusHexDaten( ZielDatei, HexDaten )
http://dieseyer.de • all rights reserved • © 2011 v11.4