Thanks for the link. Some of them I've already seen, but some not. In the meantime, I found some code that is "supposed" to get around the issue. However, I'm getting the famous "such and such is not declared and may not be... yada, yada. Maybe someone can tell me why this is happening to me?
Private Shared Function ROT13(ByVal input As String) As String
Dim sb As New StringBuilder
For Each c As Char In input
If Char.IsLetter(c) Then
If Convert.ToInt32((Char.ToUpper(c))) < 78 Then
sb.Append(Convert.ToChar(Convert.ToInt32(c) + 13))
Else
sb.Append(Convert.ToChar(Convert.ToInt32(c) - 13))
End If
Else
sb.Append(c)
End If
Next
Return sb.ToString
End Function
Public Sub writeToRegStream(ByVal appExecutable As String, ByVal visibleValue As IconStreamVisibleValues)
Dim iconStreamBytes() As Byte = Nothing
Dim iconHeader() As Byte = Nothing
Dim exeName() As Byte = Nothing
Dim recordCount As Integer = 0
Dim r As RegistryKey = Registry.CurrentUser.OpenSubKey(
"Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify", True)
iconStreamBytes = r.GetValue("IconStreams", Nothing)
Using ms As New MemoryStream(iconStreamBytes)
Using reader As New BinaryReader(ms)
iconHeader = reader.ReadBytes(20)
recordCount = BitConverter.ToInt32(iconHeader, 12)
For i As Integer = 1 To recordCount
exeName = reader.ReadBytes(528)
reader.ReadInt32()
If (ROT13(Encoding.Unicode.GetString(exeName))).Contains(appExecutable) Then
Using bw As New BinaryWriter(ms)
bw.Seek(reader.BaseStream.Position - 4, SeekOrigin.Begin)
bw.Write(CInt(visibleValue))
r.SetValue("IconStreams", ms.ToArray)
End Using
Exit For
End If
reader.BaseStream.Seek(1108, SeekOrigin.Current)
Next
End Using
End Using
r.Close()
End Sub
End Class
It's the "writeToRegStream" sub that is giving me heartache. Also, can you tell if this will work or not? I'm really not sure at this point.
Thanks again everyone.