Marook-Online
* 06.Feb.2012, 16:19 UTC+1
Welcome, Guest. Please login or register.
Username:
Password:

News: Back again Wink
Main Menu
  Navigation
   Downloads
     Tools
     Music Discs
     SMF Mods
     Trainer & Patches
     EgoShare Uploader
   Guestbook
   NoPaste
   User Map
   Gallery
  
   Malware Scan
   Hacker Blacklist
   Find Abusemail
Top Downloads
Support Me !
Help me by donating a small amount!



Advanced search

Google


Pages: [1]   Go Down
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read
22-Dec-2007 04:37
Marook
Administrator
*****
Offline Offline

Joined: 01-Jan-2005
Posts: 224


In .NET its very easy to load icons from any dll or exe files, we can use the simple API ExtractIcon(). Paste the following code into a new form and press F5.

Code
GeSHi (vbnet):
  1. Public Class Form1
  2.    Private Declare Auto Function ExtractIcon Lib "shell32.dll" ( _
  3.        ByVal hIcon As IntPtr, _
  4.        ByVal lpszExeFileName As String, _
  5.        ByVal nIconIndex As Integer) As IntPtr
  6.  
  7.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  8.        Me.Icon = LoadIconFromDLL("c:\windows\explorer.exe", 1)
  9.    End Sub
  10.    Private Function LoadIconFromDLL(ByVal sFile As String, ByVal Index As Integer) As Icon
  11.        Dim iHandle As IntPtr = ExtractIcon(IntPtr.Zero, sFile, Index)
  12.  
  13.        Select Case iHandle
  14.            Case 0
  15.                Return Nothing
  16.            Case Else
  17.                Return Icon.FromHandle(iHandle)
  18.        End Select
  19.    End Function
  20. End Class
Created by GeSHI 1.0.7.20
Logged
 

Pages: [1]   Go Up
Jump to:  

Theme by webtechnica.net

MHD v2.1 © 2oo8 by Marook
32116 hacking attempts defended!