Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use this API function in my VB code????? 2

Status
Not open for further replies.

getimran

Programmer
Aug 23, 2001
64
ES

This is a c++ code of an API FUNCTION. Can anybody translate in VB format. Actually I am worried about parameters conversion also about handle. How can i pass handle of application.

note : function is used to retrieve reference/handle to an icon.

Declaration starts here
------------------------

HICON ExtractIcon(
HINSTANCE hInst, // instance handle
LPCTSTR lpszExeFileName, // file name
UINT nIconIndex // icon index
);

Parameters details
------------------
hInst
[in] Handle to the instance of the application calling the function.
lpszExeFileName
[in] Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.
nIconIndex
[in] Specifies the zero-based index of the icon to retrieve. For example, if this value is 0, the function returns a handle to the first icon in the specified file.
 
Public Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long


Is this what you were looking for? Troy Williams B.Eng.
fenris@hotmail.com

 
The API viewer is not a bad tool either.

Wil Mead
wmead@optonline.net

 
That is what I used to get the vb version.... Troy Williams B.Eng.
fenris@hotmail.com

 
Good !!!

What about its parameters. I am new to API. how to pass application handle???

Besides this how to check multiple attributes of folder/file with FileSystemObject.

if (fso.attributes AND HIDDEN) or (fso.attributes AND volume) ...... will work. Actually its not working.
Any suggestions would be appreciated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top