Click here to Skip to main content
15,906,569 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Calculator code Pin
albCode29-Mar-06 0:22
albCode29-Mar-06 0:22 
AnswerRe: Calculator code Pin
J4amieC29-Mar-06 1:16
J4amieC29-Mar-06 1:16 
QuestionMedia Player Pin
MHASSANF28-Mar-06 23:46
MHASSANF28-Mar-06 23:46 
AnswerRe: Media Player Pin
albCode29-Mar-06 0:14
albCode29-Mar-06 0:14 
AnswerRe: Media Player Pin
MHASSANF29-Mar-06 4:24
MHASSANF29-Mar-06 4:24 
QuestionProblem with ApplicationDeployProcessor, Updater Application Block 2.0 Pin
dlarkin7728-Mar-06 23:37
dlarkin7728-Mar-06 23:37 
QuestionAbout retriving data from video files Pin
ramyasangeet28-Mar-06 23:13
ramyasangeet28-Mar-06 23:13 
QuestionOutlook dev and icon probs Pin
thewebgremlin28-Mar-06 23:12
thewebgremlin28-Mar-06 23:12 
Hi there

i have registered a dll icon library to be assocuited with our .tru extension. everywhere on the sustem the icon is shown, even in outlook when i add a .tru file to a new mail.

but, in outlook, no icon is displayed on incoming mials with a .tru file attached

does anyone know why this is, i have included all icon sizes from 16x16 to 96x96, in three colour variations

is this an outlook problem or is there something else i need to do

you can see an image here,

http://www.vbforums.com/showthread.php?p=2413151#post2413151[^]

I place the dll into the sys 32 folder, then I use the following code to register the icon on the system.

<br />
'CALLING FUNCTION<br />
Call FileAssociation.CreateAssociation("MyFile", "tru", "Myfile File", "Mydll.dll") ' associate tru with icon<br />
<br />
'MODULE<br />
' Usage:<br />
' CreateAssociation Program name, Extension, Description, Iconfile<br />
' EX:<br />
' CreateAssociation "Cryo", "cdf", "Cryo Datafile", "Cryo.dll, 0"<br />
'<br />
'<br />
<br />
Option Explicit<br />
<br />
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long<br />
Public Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long<br />
Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long<br />
Public Declare Function RegSetValueExString Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal lpValue As String, ByVal cbData As Long) As Long<br />
Public Declare Function RegSetValueExLong Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpValue As Long, ByVal cbData As Long) As Long<br />
<br />
Public Const REG_SZ As Long = 1<br />
Public Const REG_DWORD As Long = 4<br />
Public Const HKEY_CLASSES_ROOT = &H80000000<br />
Public Const HKEY_CURRENT_USER = &H80000001<br />
Public Const HKEY_LOCAL_MACHINE = &H80000002<br />
Public Const HKEY_USERS = &H80000003<br />
Public Const ERROR_NONE = 0<br />
Public Const ERROR_BADDB = 1<br />
Public Const ERROR_BADKEY = 2<br />
Public Const ERROR_CANTOPEN = 3<br />
Public Const ERROR_CANTREAD = 4<br />
Public Const ERROR_CANTWRITE = 5<br />
Public Const ERROR_OUTOFMEMORY = 6<br />
Public Const ERROR_INVALID_PARAMETER = 7<br />
Public Const ERROR_ACCESS_DENIED = 8<br />
Public Const ERROR_INVALID_PARAMETERS = 87<br />
Public Const ERROR_NO_MORE_ITEMS = 259<br />
Public Const KEY_ALL_ACCESS = &H3F<br />
Public Const REG_OPTION_NON_VOLATILE = 0<br />
<br />
Public Sub CreateAssociation(PROG As String, EXT As String, BESKRIV As String, IconLib As String)<br />
        Dim sPath As String<br />
        sPath = App.path & "\" & App.EXEName & " %1"<br />
        <br />
        CreateNewKey "." & EXT, HKEY_CLASSES_ROOT<br />
        SetKeyValue "." & EXT, "", PROG, REG_SZ<br />
        <br />
        CreateNewKey PROG & "\shell\open\command", HKEY_CLASSES_ROOT<br />
        CreateNewKey PROG & "\DefaultIcon", HKEY_CLASSES_ROOT<br />
        <br />
        SetKeyValue PROG, "", BESKRIV, REG_SZ<br />
        SetKeyValue PROG & "\shell\open\command", "", sPath, REG_SZ<br />
        SetKeyValue PROG & "\DefaultIcon", "", IconLib, REG_SZ<br />
End Sub<br />
Public Sub CreateNewKey(sNewKeyName As String, lPredefinedKey As Long)<br />
        'handle to the new key<br />
        Dim hKey As Long<br />
        'result of the RegCreateKeyEx function<br />
        Dim r As Long<br />
        r = RegCreateKeyEx(lPredefinedKey, sNewKeyName, 0&, vbNullString, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0&, hKey, r)<br />
        Call RegCloseKey(hKey)<br />
End Sub<br />
<br />
Public Sub SetKeyValue(sKeyName As String, sValueName As String, vValueSetting As Variant, lValueType As Long)<br />
        'result of the SetValueEx function<br />
        Dim r As Long<br />
        'handle of opened key<br />
        Dim hKey As Long<br />
        'open the specified key<br />
        r = RegOpenKeyEx(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_ALL_ACCESS, hKey)<br />
        r = SetValueEx(hKey, sValueName, lValueType, vValueSetting)<br />
        Call RegCloseKey(hKey)<br />
End Sub<br />
<br />
<br />
Public Function SetValueEx(ByVal hKey As Long, sValueName As String, lType As Long, vValue As Variant) As Long<br />
        Dim nValue As Long<br />
        Dim sValue As String<br />
        Select Case lType<br />
        Case REG_SZ<br />
                sValue = vValue & Chr$(0)<br />
                SetValueEx = RegSetValueExString(hKey, sValueName, 0&, lType, sValue, Len(sValue))<br />
        Case REG_DWORD<br />
                nValue = vValue<br />
                SetValueEx = RegSetValueExLong(hKey, sValueName, 0&, lType, nValue, 4)<br />
        End Select<br />
End Function<br />
<br />
<br />
<br />
<br />



any help woudl be gretaly appreciated

many thanks

Jamie
QuestionI want to change color of TD using C# code in ASP.NET Pin
Khawar Abbas128-Mar-06 23:04
Khawar Abbas128-Mar-06 23:04 
AnswerRe: I want to change color of TD using C# code in ASP.NET Pin
Chatura Dilan29-Mar-06 1:07
Chatura Dilan29-Mar-06 1:07 
GeneralRe: OK I want to change color of TD in VB code in ASP.NET Pin
Khawar Abbas129-Mar-06 1:11
Khawar Abbas129-Mar-06 1:11 
GeneralRe: OK I want to change color of TD in VB code in ASP.NET Pin
Dave Kreskowiak29-Mar-06 1:26
mveDave Kreskowiak29-Mar-06 1:26 
AnswerRe: I want to change color of TD using C# code in ASP.NET Pin
bony_baba30-Mar-06 1:00
bony_baba30-Mar-06 1:00 
QuestionHow to avoid Recursive Event Triggering between Controls Pin
twohops28-Mar-06 22:03
twohops28-Mar-06 22:03 
QuestionQuestion In vb.net Pin
Arag0328-Mar-06 21:59
Arag0328-Mar-06 21:59 
AnswerRe: Question In vb.net Pin
albCode28-Mar-06 22:12
albCode28-Mar-06 22:12 
Questiondatareader problem Pin
thepityone28-Mar-06 20:45
thepityone28-Mar-06 20:45 
Questionsound recognition Pin
susee_132328-Mar-06 20:44
susee_132328-Mar-06 20:44 
QuestionScanner Activation Pin
Thoombath28-Mar-06 20:17
Thoombath28-Mar-06 20:17 
QuestionRetrieving value from Subitem of Listview Pin
wilde28-Mar-06 20:12
wilde28-Mar-06 20:12 
AnswerRe: Retrieving value from Subitem of Listview Pin
alien viper28-Mar-06 20:33
alien viper28-Mar-06 20:33 
QuestionComparing strings with variable lengths/misspells/... Pin
mayhem_rules28-Mar-06 18:59
mayhem_rules28-Mar-06 18:59 
AnswerRe: Comparing strings with variable lengths/misspells/... Pin
dptalt29-Mar-06 2:33
dptalt29-Mar-06 2:33 
QuestionUnicode supported characters in filenames Pin
sp_ranjan28-Mar-06 18:48
sp_ranjan28-Mar-06 18:48 
QuestionRichtextbox.Line property Pin
wilde28-Mar-06 18:06
wilde28-Mar-06 18:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.