Menues with Bitmaps - Size (API Expertise needed - I guess - )
Is there any way to add bitmaps to the left of the menuitem which are bigger than 13x11 and get all the image shown?? Is it possible to not get the icon highlighted (when you hover the mouse over the item) but get it squared? I mean.. Is there any way to make menues like the ones in MS-Word, for example. Its "icons" are bigger than this and the image is not highlighted, but squared.
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
From what i know, you can add a bitmap in a menu using the following (i guess to change the content of the menu on mouse over you can have a 'Private Sub mnuNameHere_MouseMove()' sub:
Public Declare Function WinGetMenu Lib "user32" Alias "GetMenu" _
(ByVal hwnd As Long) As Long
Public Declare Function WinGetSubMenu Lib "user32" _
Alias "GetSubMenu" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function WinModifyMenu Lib "user32" _
Alias "ModifyMenuA" (ByVal hMenu As Long, _
ByVal nPosition As Long, ByVal wFlags As Long, _
ByVal wIDNewItem As Long, ByVal lpString As Any) As Long
Public Const MF_BYPOSITION = &H400&
Public Const MF_BITMAP = &H4&
Public Function AddMenuImage(pForm As Form, ByVal pMenuNum As Long, _
ByVal pMenuItemNum As Long, ByVal pImageHandle As Long) As Boolean
Dim lngMenuID As Long
Dim lngMenuHandle As Long
Dim lngSubMenuHandle As Long
Dim lngRet As Long
AddMenuImage = False
On Error Resume Next
' Get a handle to the form's menu
lngMenuHandle = WinGetMenu(pForm.hwnd)
If lngMenuHandle = 0 Then Exit Function
' Get a handle to the top level menu using its position
lngSubMenuHandle = WinGetSubMenu(lngMenuHandle, pMenuNum)
If lngSubMenuHandle = 0 Then Exit Function
' Place the bitmap on the menu
lngRet = WinModifyMenu(lngSubMenuHandle, pMenuItemNum, _
MF_BITMAP Or MF_BYPOSITION, 0, pImageHandle)
If lngRet > 0 Then
AddMenuImage = True
End If
I can't get it work. But it's pretty similar to the one I've got (different APIs, though) So, I don't think this would be the way
Emiliano F. Martín
If a post has helped you then pleaseRate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
Office uses what are referred to as Owner-Drawn menus. This basically means that you are responsible for drawing the menu items, and Windows will tell you what items to draw.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You". -- Linus Torvalds