Click here to Skip to main content
15,913,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Clean Build Pin
SimonS1-Sep-03 5:07
SimonS1-Sep-03 5:07 
GeneralRe: Clean Build Pin
jholt1-Sep-03 9:41
jholt1-Sep-03 9:41 
GeneralTrigger a Windows Form Notification Pin
su_see31-Aug-03 8:08
su_see31-Aug-03 8:08 
GeneralProblem In Msgbox And InputBox Pin
Meysam Khayatan30-Aug-03 8:59
Meysam Khayatan30-Aug-03 8:59 
GeneralRe: Problem In Msgbox And InputBox Pin
Hesham Amin30-Aug-03 20:49
Hesham Amin30-Aug-03 20:49 
GeneralRe: Problem In Msgbox And InputBox Pin
Dave Kreskowiak3-Sep-03 17:27
mveDave Kreskowiak3-Sep-03 17:27 
GeneralMAJOR PROJECT Pin
IT_student30-Aug-03 0:29
IT_student30-Aug-03 0:29 
Generalsaving icon to hard drive Pin
pnpfriend29-Aug-03 6:57
pnpfriend29-Aug-03 6:57 
Hello all..
How to get the icon that is associate with the file?

I have email item... which contain file attachments..
So first get the file attachment using mail.Attachments and mail.Attachment. Up to here no problem..

here the code to get the icon and saving it in C:\PCKM so I can call the image file from HTML code


<br />
Function GetIconLocation(ByVal filename As String) As String<br />
        Dim loc As String<br />
        'Use this to get the small icon.<br />
        Dim fName As String      'The file name to get the icon from.<br />
        Dim shinfo As SHFILEINFO<br />
        shinfo = New SHFILEINFO<br />
        Dim openFileDialog1 As OpenFileDialog<br />
        openFileDialog1 = New OpenFileDialog<br />
        Dim hImgSmall As IntPtr  'The handle to the system image list.<br />
<br />
        hImgSmall = SHGetFileInfo(filename, 0, shinfo, Marshal.SizeOf(shinfo), SHGFI_ICON Or SHGFI_SMALLICON)<br />
        Dim hIcon As Icon<br />
        hIcon = Icon.FromHandle(shinfo.hIcon)<br />
<br />
        Dim bip As System.Drawing.Bitmap<br />
        bip = hIcon.ToBitmap()<br />
        bip.Save("c:\pckm\icon.bmp")<br />
        loc = "<img src=""c:\pckm\icon.bmp""><br>" & filename<br />
<br />
        GetIconLocation = loc<br />
    End Function<br />


After I saved the icon.bmp I try to open it by double clicking the file or using open with to oen the file but can't open with any other programs

How to save the icon to the hard drive???

Thank you
Generalgetting icon location Pin
pnpfriend29-Aug-03 2:48
pnpfriend29-Aug-03 2:48 
GeneralRandom Number Maths Quiz Pin
Alvin Wong29-Aug-03 1:50
Alvin Wong29-Aug-03 1:50 
GeneralRe: Random Number Maths Quiz Pin
Corinna John1-Sep-03 3:18
Corinna John1-Sep-03 3:18 
GeneralRe: Random Number Maths Quiz Pin
Corinna John1-Sep-03 6:16
Corinna John1-Sep-03 6:16 
QuestionHow do I check if a registry entry exists in the windows registry. Pin
Simon_22117528-Aug-03 19:08
Simon_22117528-Aug-03 19:08 
AnswerRe: How do I check if a registry entry exists in the windows registry. Pin
Dave Kreskowiak29-Aug-03 4:54
mveDave Kreskowiak29-Aug-03 4:54 
QuestionHow do I export a registry hive? Pin
wobblervb28-Aug-03 16:24
wobblervb28-Aug-03 16:24 
AnswerRe: How do I export a registry hive? Pin
Dave Kreskowiak29-Aug-03 9:10
mveDave Kreskowiak29-Aug-03 9:10 
GeneralXP Accelerators and Focus Rects Pin
Punchinello28-Aug-03 4:00
Punchinello28-Aug-03 4:00 
GeneralRe: XP Accelerators and Focus Rects Pin
Dave Kreskowiak28-Aug-03 8:24
mveDave Kreskowiak28-Aug-03 8:24 
GeneralRe: XP Accelerators and Focus Rects Pin
Punchinello28-Aug-03 8:52
Punchinello28-Aug-03 8:52 
GeneralRe: XP Accelerators and Focus Rects Pin
Dave Kreskowiak28-Aug-03 9:57
mveDave Kreskowiak28-Aug-03 9:57 
GeneralRe: XP Accelerators and Focus Rects Pin
Punchinello28-Aug-03 11:18
Punchinello28-Aug-03 11:18 
GeneralRe: XP Accelerators and Focus Rects Pin
J. Dunlap28-Aug-03 11:21
J. Dunlap28-Aug-03 11:21 
GeneralRe: XP Accelerators and Focus Rects Pin
Punchinello28-Aug-03 11:47
Punchinello28-Aug-03 11:47 
GeneralGranting &quot;Logon As Service Rights&quot; Pin
alunboyd28-Aug-03 3:09
alunboyd28-Aug-03 3:09 
GeneralRe: Granting &quot;Logon As Service Rights&quot; Pin
Dave Kreskowiak28-Aug-03 8:27
mveDave Kreskowiak28-Aug-03 8:27 

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.