If you are trying to 'hide' xls files so they don't show up in Windows
Explorer or browse dialogs as Excel file, just change the extension to
something that refs to your project name. Note that file extensions can
be longer than 3 characters.
Have you tried changing the relevant entry in the registry?
Find HKEY_CLASSES_ROOT\.xls ; note its "(Default)" value (here, it's
Excel.Sheet.8 ). Find that key (HKEY_CLASSES_ROOT\Excel.Sheet.8) and the
key DefaultIcon below that; note its value (here:
C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0150048383C9}\xlicons.exe,1);
change it.
Have you tried changing the relevant entry in the registry?
Find HKEY_CLASSES_ROOT\.xls ; note its "(Default)" value (here, it's
Excel.Sheet.8 ). Find that key (HKEY_CLASSES_ROOT\Excel.Sheet.8) and the
key DefaultIcon below that; note its value (here:
C:\WINDOWS\Installer\{90110409-6000-11D3-8CFE-0150048383C9}\xlicons.exe,1);
change it.
Thanks! I had tried that last week to no avail.
Used ResHacker to view the icons in xlicons.exe.
It turns out that I had to add the UserChoice key to
the registry, also, or it would not take.
It seems to be working now.
Thanks! I had tried that last week to no avail.
Used ResHacker to view the icons in xlicons.exe.
It turns out that I had to add the UserChoice key to
the registry, also, or it would not take.
It seems to be working now.
I have not checked this buy you may?? be violating your user agreement.
I believe you are correct as the target keys are part of MSO's
installed structure, and is covered by the rather lengthy EULA (which
nobody ever bothers to actually read during install<g>). That's why I
simply change the file extensions of project files when/if desired!
Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetClassLongA Lib "user32" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetClassLongA Lib "user32" _
(ByVal hWnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function LoadImageA Lib "user32" _
(ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, _
ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Dim HIcon As Long, hWnd As Long
Sub Restore_Ico()
If HIcon Then SetClassLongA hWnd, -14, HIcon
End Sub
Sub Modify_Ico()
Dim FIcone As String
' Adapt the file path
FIcone = "C:\Documents and Settings\Administrateur\Mes documents\alarme.ico"
If Dir$(FIcone) <> "" Then
hWnd = FindWindowA(vbNullString, Application.Caption)
HIcon = GetClassLongA(hWnd, -14)
SetClassLongA hWnd, -14, LoadImageA(0, FIcone, 1, 0, 0, &H10)
End If
End Sub
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.