Hi.. I need a freeware ocx or dll to add icons to menus. Do you know any site with files like this besides vbaccelerator?
I prefer tested solutions...
Thank you..
Printable View
Hi.. I need a freeware ocx or dll to add icons to menus. Do you know any site with files like this besides vbaccelerator?
I prefer tested solutions...
Thank you..
Add to a Form with a PictureBox (with a valid Bitmap loaded) and with a menu and Submenus.
Code:Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long
Const MF_BITMAP = &H4&
Private Sub Command1_Click()
Dim hMenu As Long, hSub As Long, ItemID As Long
hMenu = GetMenu(Me.hwnd)
hSub = GetSubMenu(hMenu, 0)
ItemID = GetMenuItemID(hSub, 0)
SetMenuItemBitmaps hMenu, ItemID, MF_BITMAP, Picture1, Picture1
End Sub