-
December 24th, 2002, 05:36 AM
#1
Display of iconsor embedding icons
When we select some of the files such iexplore.exe in the change ico option in the folder option. It displays list of icons but my application display only one icon. Is it possible to embedd the necessary icons, so that my application to displays the list of icons to select with
Last edited by Vetri Selvan; December 24th, 2002 at 05:53 AM.
Vetri
-
December 26th, 2002, 07:16 PM
#2
I think you are talking about the ChangeIconDialog API. Here is a sample. The Sample needs a command button an label and a textbox
Code:
Option Explicit
Private Declare Function SHChangeIconDialog Lib "shell32" Alias "#62" (ByVal _
hOwner As Long, ByVal szFilename As String, ByVal Reserved As _
Long, lpIconIndex As Long) As Long
Function IconBrowser(ByRef sFile As String, ByVal nIndex As Long) _
As Long
If SHChangeIconDialog(Me.hWnd, sFile, 0, nIndex) Then
IconBrowser = nIndex
Else
IconBrowser = -1
End If
End Function
Private Sub Command1_Click()
Label1.Caption = IconBrowser(Text1.Text, 10)
End Sub
Private Sub Form_Load()
Text1.Text = "C:\Windows\System\Shell32.dll"
End Sub
-
December 26th, 2002, 11:41 PM
#3
hai john,
Thanks for the reply. I think i have not made my point clear. I need the multiple icon,i.e If i were to associate my program to a file then i set association of file type in the folder option there i set the association to my file, there i select the icon for the file, if i select some other program such as iexplore they have list of icons to select where as my application only one icon to select icon that to i have added to my form. Is there any of setting my application so that i shows list of icon.
for example u have given the icon diaplog in which if u select mspaint.exe it shows me list of icons in the same way if i choose my applicatio it must also list me several icon. I thing its clear now.
Vetri
-
December 27th, 2002, 03:10 AM
#4
hai,
it is very simple. u need to attach a resource file with the project. in that u can add all ur required icons. when u create exe this also will go along with it. so when u create short cut , when u click the change icon option it displays all the icons listed in the resource file.
to add resouce file do add it through add-in manager.
try it out
m.mohan kumar
-
December 29th, 2002, 11:23 PM
#5
hai,
Thank you for the reply u posted, that was i expeced and it really much helpful to me.
Vetri
Vetri
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|