Hello everyone,
First of all, I want to wish you all a merry christmas and a happy new year.
I am trying to make a menu like ICQ's (I attached an image).
I wanna create a "left-side-bar" like the one in ICQ's menu in the image and I wanna add bitmaps to the menu.
I tryed to use the function SeMenuItemBitmaps but I read that this function is used for the check marks and indeed the bitmaps looked ungly, I noticed that the limit was a 12x12 bitmap and I wanna use 16x16 bitmaps.
How do I do this?
I think I have to use owner-draw menus, right?
Can anyone help me?
Is there any example that uses this?

Thanks in advance.
Happy holidays.
Posted on 2001-12-24 22:33:05 by dilau
Sorry guys, I forgot the image.
I also forgot to say that I wanna do this lines that seen like groupboxes.
Posted on 2001-12-24 22:44:51 by dilau

I wanna create a "left-side-bar" like the one in ICQ's menu in the image and I wanna add bitmaps to the menu.
I tryed to use the function SeMenuItemBitmaps but I read that this function is used for the check marks and indeed the bitmaps looked ungly, I noticed that the limit was a 12x12 bitmap and I wanna use 16x16 bitmaps.


I don't know for sure but I believe you can also use 16x16 bitmaps. However, when you move over them, they are inverted (like checkboxes, they turn white when you select them). There's an example of this in the masm32 v7 package (rclkmenu, ex8).


How do I do this?
I think I have to use owner-draw menus, right?


Yes, I'm using it in a trayicon menu, I got some source code from vom-bonjour which I used.
However remember that you also have to draw the text on it and that can be very hard because you need to draw the text differently for grayed items, disabled items, enabled items, selected items, and so on..
Luckily I didn't need this..

For the bar on the left, it's actually a seperate menu page. The first item is a normal menu item (which is the bar), the next item has the MFT_MENUBARBREAK style. This will cause that menu to start on a new menu page (on the right).

There's a very detailed document & example on the subject at msdn (http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0198/coolmenu.htm&nav=/msj/0198/newnav.htm). It's all c++ though.

I'll post some source code of my own project here today, but I can't give you a full example because I have to rip it out of the project.

Thomas
Posted on 2001-12-25 05:07:50 by Thomas
The attachment is one file of my HTTP file transfer project, I can't give you a fully working example, but it may be useful to you.
The file contains several functions to create a system tray icon and a menu that pops up when you right-click it.

In addition to the source, two messages in the window procedures are handled like this:


.ELSEIF eax==WM_MEASUREITEM
mov eax, wParam
.IF eax==0
invoke TrayProcessMeasureItem, hWnd, lParam
xor eax, eax
inc eax
.ELSE
xor eax, eax
.ENDIF
.ELSEIF eax==WM_DRAWITEM
mov eax, wParam
.IF eax==0
invoke TrayProcessDrawItem, lParam
xor eax, eax
inc eax
.ELSE
xor eax, eax
.ENDIF


Thomas
Posted on 2001-12-25 14:04:38 by Thomas
This is how it looks:
Posted on 2001-12-25 14:05:24 by Thomas
Thank you very much, Thomas! :)
That will be very helpful to me!
Merry christmas!
Posted on 2001-12-25 19:18:35 by dilau