CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to display Large Icons w.r.t Application just like in Windows Explorer ?

    Hi,

    How to display Large Icons for Application Specific. Just as we get in Windows Explorer. How to get the icon for that application from the registry.

    Please let me know imeediately

    contact : [email protected]

    Regards

    Prasad



  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: How to display Large Icons w.r.t Application just like in Windows Explorer ?

    Try using the ExtractAssociatedIcon API, here's an Example:

    private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (byval hInst as Long, byval lpIconPath as string, lpiIcon as Long) as Long
    private Declare Function DrawIconEx Lib "user32" (byval hdc as Long, byval xLeft as Long, byval yTop as Long, byval hIcon as Long, byval cxWidth as Long, byval cyWidth as Long, byval istepIfAniCur as Long, byval hbrFlickerFreeDraw as Long, byval diFlags as Long) as Long

    private Sub Command1_Click()
    Dim lIcon as Long
    on error GoTo User_Cancelled
    With CommonDialog1
    .CancelError = true
    .DialogTitle = "Select a File.."
    .Filter = "All Files (*.*)|*.*"
    .ShowOpen
    Picture1.Cls
    lIcon = ExtractAssociatedIcon(App.hInstance, .FileName, -1)
    Call DrawIconEx(Picture1.hdc, 0, 0, lIcon, 32, 32, 0, 0, 3)
    End With
    User_Cancelled:
    End Sub





    <STRONG>Aaron Young</STRONG>
    <EM>Analyst Programmer</EM>
    <A HREF="Mailto:[email protected]">[email protected]</A>
    <A HREF="Mailto:[email protected]">[email protected]</A>
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured