Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Returns all the icons from an executable file. ...
Author:
Duncan Jones
E-mail:
Click to e-mail author
Website:
http://www.merrioncomputing.com
Submitted:
3/27/2001
Version:
VB4
Compatibility:
VB4, VB5, VB6
Category:
Windows API
Views:
8964
Returns all the icons from an executable file. (This snippet is part of the "Simply Subclassing" dll which is also downloadable from this site)
Declarations:
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Code:
'\\ --[IconsFromFilename]------------------------------------------------------------------- '\\ Returns a collection of Icon handles from the filename given. '\\ ---------------------------------------------------------------------------------------- '\\ You have a royalty free right to use, reproduce, modify, publish and mess with this code '\\ I'd like you to visit http://www.merrioncomputing.com for updates, but won't force you '\\ ---------------------------------------------------------------------------------------- Public Property Get IconsFromExeFilename(ByVal Filename As String) As Collection Dim lIndex As Long Dim lIconCount As Long Dim lret As Long Dim colIcons As Collection '\\ Initialise the collection Set colIcons = New Collection '\\ Get the number of items lIconCount = ExtractIcon(App.hInstance, Filename, -1) If lIconCount > 0 Then For lIndex = 0 To lIconCount - 1 lret = ExtractIcon(App.hInstance, Filename, lIndex) If lret > 0 Then colIcons.Add lRet End If Next lIndex End If '\\ Return the collection Set IconsFromExeFilename = colIcons End Property
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement