Results 1 to 5 of 5

Thread: Menues with Bitmaps - Size (API Expertise needed - I guess - )

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    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 please Rate 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.

  2. #2

    Reply 2 Menuz w/bitmaps

    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

    End Function

  3. #3

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    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 please Rate 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.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    Attached Files Attached Files
    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

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    And the other one...

    These were by V(ery) Basic -- not seen him around for a while
    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

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