Re: How to get an associated file icon without the Alpha Channel i

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mark Collard (MarkCollard_at_discussions.microsoft.com)
Date: 10/13/04

  • Next message: zhangjian: "how to use usb for sigma-koki?"
    Date: Wed, 13 Oct 2004 01:17:03 -0700
    
    

    Hi Mike

    I think I've come up with a simply solution on how to create an icon with
    the shadow effect, but I need a little help please.

    I had a Picture Box control on to a Form and then used the SHGetFileInfo API
    to get a handle to the small icon with an Alpha Channel. I then used the
    DrawIconEx API to draw the icon on to the Picture Boxes DC. The icon is drawn
    with the shadow effect.

    This is what I'm thinking as a solution:
    - Use the SHGetFileInfo to get a handle to the small file icon
    - Create a DC using the CreateCompatibleDC API
    - Draw the icon on to the DC using the DrawIconEx API (so that the alpha
    channel is drawn as the shadow effect)
    - Use the GetIconInfo API to get the Icon info
    - Replace the icon bitmap with the image that was drawn in the DC. There is
    no need to change the mask
    - Convert the icon into a StdPicture object

    It the "Replace the icon bitmap with the image that was drawn in the DC" bit
    I don't know how to do.

    Can you please show me how to do that bit?

    Thanks again

    Regards
    Mark


  • Next message: zhangjian: "how to use usb for sigma-koki?"

    Relevant Pages

    • Re: Can HIML (handle to Image List) be wrapped by ImageList Control?
      ... I am populating treeview, fill up with image indexes from ... with every icon from himl. ... No calls to ShGetFileInfo are very fast bottle neck is creating exact copy of System Image List to VB ImageList Control, ... ImageList_GetIcon API using OleCreateIconIndirect and there are to many steps in this. ...
      (microsoft.public.vb.winapi)
    • Re: Listview/Imagelist
      ... Assign the LV a VB IL with 1 icon in it already. ... Use SETIMAGELIST to set the LV smallicon IL to the API IL. ... I then use the return value in the SETITEM call to set the Icon. ... No luck in finding such animal quickly. ...
      (microsoft.public.vb.winapi)
    • Re: Renaming the task bar Application name
      ... >I dont think your api call changes anything I never used them. ... >> I have an access app nearing completion. ... >> runtime environment and on startup it hides the runtime environment using ... >> app it shows an access icon with the name of the mdb on the task bar. ...
      (microsoft.public.access.modulesdaovba)
    • Re: Listview/Imagelist
      ... >>> Sounds like you are creating a system tray replacement utility? ... with the API IL. ... Assign the LV a VB IL with 1 icon in it already. ... Add a LI to the LV (trying both w/ & w/o assigning an icon at ...
      (microsoft.public.vb.winapi)
    • RE: Renaming the task bar Application name
      ... I dont think your api call changes anything I never used them. ... search for 'startup properties example'. ... > runtime environment and on startup it hides the runtime environment using ... > app it shows an access icon with the name of the mdb on the task bar. ...
      (microsoft.public.access.modulesdaovba)