Click here to Skip to main content
15,914,162 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionChange Exe Icon using vb.net code Pin
~Khatri Mitesh~8-Aug-08 22:05
~Khatri Mitesh~8-Aug-08 22:05 
AnswerRe: Change Exe Icon using vb.net code Pin
jzonthemtn9-Aug-08 2:28
jzonthemtn9-Aug-08 2:28 
GeneralRe: Change Exe Icon using vb.net code Pin
~Khatri Mitesh~9-Aug-08 4:24
~Khatri Mitesh~9-Aug-08 4:24 
GeneralRe: Change Exe Icon using vb.net code Pin
Manas Bhardwaj9-Aug-08 6:02
professionalManas Bhardwaj9-Aug-08 6:02 
GeneralRe: Change Exe Icon using vb.net code Pin
jzonthemtn9-Aug-08 9:02
jzonthemtn9-Aug-08 9:02 
GeneralRe: Change Exe Icon using vb.net code Pin
LloydA1119-Aug-08 16:17
LloydA1119-Aug-08 16:17 
GeneralRe: Change Exe Icon using vb.net code Pin
~Khatri Mitesh~15-Aug-08 0:17
~Khatri Mitesh~15-Aug-08 0:17 
GeneralRe: Change Exe Icon using vb.net code Pin
LloydA11115-Aug-08 2:35
LloydA11115-Aug-08 2:35 
Hiya!

I eventually found something similar to the original:

API:
Private Declare Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Int32, ByRef phiconLarge As IntPtr, ByRef phiconSmall As IntPtr, ByVal nIcons As Int32) As Int32

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim FileName As String = "%SystemRoot%\system32\shell32.dll"

Dim Index As Integer = 1 'Change number here for the icon.

Dim icoLarge As IntPtr

Dim icoSmall As IntPtr

ExtractIconEx(FileName, Index, icoLarge, icoSmall, 1) 'This number (from what I can undrstand) will give you an alternative icon for the specified index.

If Not icoLarge.Equals(IntPtr.Zero) Then

Dim i As Icon = System.Drawing.Icon.FromHandle(icoLarge)

PictureBox1.Image = i.ToBitmap

End If

If Not icoSmall.Equals(IntPtr.Zero) Then

Dim i As Icon = System.Drawing.Icon.FromHandle(icoSmall)

PictureBox2.Image = i.ToBitmap

End If

End Sub

Hope that helps, you could set the Index to the number of a NumericUpDown component!

Lloyd A.

Lloyd J. Atkinson

"Logic will get you from A to B, but imagination will take you everywhere" - ALbert Einstein

I look at Microsoft, and turn to my poster on the wall saying: "Bang head here in case of stress".

Questionproblem in exporting excel from crystal report Pin
jhyn8-Aug-08 7:18
jhyn8-Aug-08 7:18 
QuestionRe: problem in exporting excel from crystal report Pin
Paul Conrad8-Aug-08 19:33
professionalPaul Conrad8-Aug-08 19:33 
AnswerRe: problem in exporting excel from crystal report Pin
Mycroft Holmes9-Aug-08 13:46
professionalMycroft Holmes9-Aug-08 13:46 
GeneralRe: problem in exporting excel from crystal report Pin
jhyn12-Aug-08 17:03
jhyn12-Aug-08 17:03 
GeneralRe: problem in exporting excel from crystal report Pin
Mycroft Holmes12-Aug-08 17:16
professionalMycroft Holmes12-Aug-08 17:16 
QuestionXL VBA, Summing a Column, a Range Problem Pin
Dalek Dave8-Aug-08 4:48
professionalDalek Dave8-Aug-08 4:48 
AnswerRe: XL VBA, Summing a Column, a Range Problem Pin
Tim Carmichael8-Aug-08 10:48
Tim Carmichael8-Aug-08 10:48 
GeneralRe: XL VBA, Summing a Column, a Range Problem Pin
Dalek Dave8-Aug-08 17:09
professionalDalek Dave8-Aug-08 17:09 
QuestionDeveloping Mail Sending Application Pin
G.Manivannan8-Aug-08 2:04
G.Manivannan8-Aug-08 2:04 
AnswerRe: Developing Mail Sending Application Pin
Manas Bhardwaj8-Aug-08 2:28
professionalManas Bhardwaj8-Aug-08 2:28 
GeneralRe: Developing Mail Sending Application Pin
G.Manivannan9-Aug-08 3:20
G.Manivannan9-Aug-08 3:20 
AnswerRe: Developing Mail Sending Application Pin
Steven J Jowett8-Aug-08 4:02
Steven J Jowett8-Aug-08 4:02 
GeneralRe: Developing Mail Sending Application [modified] Pin
G.Manivannan9-Aug-08 2:28
G.Manivannan9-Aug-08 2:28 
GeneralRe: Developing Mail Sending Application Pin
Vimalsoft(Pty) Ltd10-Aug-08 9:41
professionalVimalsoft(Pty) Ltd10-Aug-08 9:41 
GeneralRe: Developing Mail Sending Application Pin
G.Manivannan11-Aug-08 18:30
G.Manivannan11-Aug-08 18:30 
GeneralRe: Developing Mail Sending Application Pin
Vimalsoft(Pty) Ltd11-Aug-08 20:18
professionalVimalsoft(Pty) Ltd11-Aug-08 20:18 
GeneralRe: Developing Mail Sending Application Pin
G.Manivannan12-Aug-08 23:42
G.Manivannan12-Aug-08 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.