Icons on Menus and Extract Icons from Files?Message-ID: <3f 
Author Message
 Icons on Menus and Extract Icons from Files?Message-ID: <3f


Newsgroup: comp.lang.basic.visual
Organization: Mead Data Central, Dayton OH

Quote:
>I need two questions answered. I hope someone can help me.
>1.  Has anyone tried to attach icons beside menu items using
>Visual Basic.  This icon/bitmap would replace the standard area
>reserved for the Checkbox on a menu item.
>Windows 95 and HP Dashboard do this and I was
>trying to duplicate their efforts.
>2.  I am using a vbx called FileIcon which will extract the first
>icon from a file.  I need to get the 2nd, 3rd, or nth icon and don't
>know how to do this.

1. Using icons instead the conventional check mark can easily be done in
VB, just using few API calls. First you should use the
GetMenuCheckMarkDimensions Function to determine the size of the
checkmark (both bitmap and checkmark must be the same size !) and then
you can call SetMenuItemBitmaps to change the checkmark.
For more info look at WIN31SDK.HLP

2. As above, you could just use standard API calls to retrieve icons
from files. The function you should use is ExtractIcon. I'll give you
some tricks to use this function.

Declare Function ExtractIcon Lib "SHELL.DLL" (ByVal hInst%, ByVal
          lpszExeName$, ByVal iIcon%) As Integer
where:
        hInst is the instance handle of your application.
        lpszExeName is the full name of the program from which to
                    extract an icon
        iIcon is the index number of the icon to retrive. If it is -1,
                    the function returns the total number of icons in
                    the file.

I hope this helps you !

Oliver Berke

---
 t OLX 2.2 t SPECIMEN: An Italian astronaut.



Sun, 13 Jul 1997 10:27:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Icon: Extract icon and save it as ico-file

2. help extracting icons from dll to icon property

3. Extract icon from dll into form.icon

4. How to extract an icon from a file (for example a .dll file)

5. tray icon/menu icon

6. Icon on WindowList menu using MDIChild Form icon.

7. Extract icon from an exe file?

8. Extracting an Icon from a .exe file

9. Extracting an icon from a given .exe file

10. Extract Icon from EXE files

11. Extracting Icons from Link Files

12. Extract Icons from a file name.

 

 
Powered by phpBB® Forum Software