azzdawg_dev
New member
- Joined
- Apr 30, 2012
- Messages
- 4
- Programming Experience
- 1-3
hi there,
i'm trying to write a program that sets a file association and sets the icon for that filetype. so far, i have accomplished the filetype association part, and loading the data from the file into my app.
the problem is that i cannot figure out how to set the icon.
i have tried this:
i have also tried writing a much simpler piece of code that eliminates the unneccesary declarations above. i have scoured the net, nothing is working (also, everything i've found supposedly works up to vista. not windows 7 and later)
please do not post other languages (even C#). if you believe you have the answer, but its a different language, translate it into vb.net (if you use a code converter, test it BEFORE posting!)
thank you in advance for your help!
i'm trying to write a program that sets a file association and sets the icon for that filetype. so far, i have accomplished the filetype association part, and loading the data from the file into my app.
the problem is that i cannot figure out how to set the icon.
i have tried this:
VB.NET:
Dim rk As Microsoft.Win32.RegistryKey = ClassesRoot Dim rk1 As Microsoft.Win32.RegistryKey = ClassesRoot
Dim ext As Microsoft.Win32.RegistryKey = rk.OpenSubKey(".tst")
Dim regtype As String = ext.GetValue(String.Empty)
ext = rk1.OpenSubKey(regtype, True).OpenSubKey("DefaultIcon", True)
ext.SetValue(String.Empty, "D:\dev\pen.ico")
i have also tried writing a much simpler piece of code that eliminates the unneccesary declarations above. i have scoured the net, nothing is working (also, everything i've found supposedly works up to vista. not windows 7 and later)
please do not post other languages (even C#). if you believe you have the answer, but its a different language, translate it into vb.net (if you use a code converter, test it BEFORE posting!)
thank you in advance for your help!