LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add a bitmap in a menu topic

Hi, I would like to use menu functions defined in user32.dll for adding bitmap in the menu bar.
Could you send me an example using either user32.dll or menu activeX.
Thanks.
Alexis de La Fontaine.
0 Kudos
Message 1 of 13
(3,772 Views)
Check the example here.
0 Kudos
Message 2 of 13
(3,772 Views)
Hi, thanks for response, but i know this example, i would like to use user32.dll.
In this dll, we can find create menu function, add bitmap to a topic, ...
But i don't know how to use this dll.
Thanks.
0 Kudos
Message 3 of 13
(3,772 Views)
> Hi, I would like to use menu functions defined in user32.dll for
> adding bitmap in the menu bar.
> Could you send me an example using either user32.dll or menu activeX.

If you are talking about adding the bitmap to a LV window's menu, then
the user32 function will not work very well as the LV menus are not
windows menus, but rather our own object that draws as a menu and
processes menus as an event.

Greg McKaskle
0 Kudos
Message 4 of 13
(3,772 Views)
I create a window menu but i can't receive selected item by user. Is it an event and not a dll? Is it WM_COMMAND ?
Thanks.
0 Kudos
Message 5 of 13
(3,772 Views)
> I create a window menu but i can't receive selected item by user. Is
> it an event and not a dll? Is it WM_COMMAND ?

You've lost me. The LV menu isn't based upon windows menu objects, and
it will not send notification via WM_ messages. You can independently
use SDK or MFC functions to make a menu object, and you might also be
able to attach this to a LV window, but I suspect that you are dancing
on thin ice. I wouldn't be at all surprised that the child window
containing the menu has problems with drawing and event handling.

Of course, if I'm wrong and you get it working that would be quite cool.

Greg McKaskle
0 Kudos
Message 6 of 13
(3,772 Views)
I don't xant to create a labview menu. The reason is that i want to attach bitmap with menu items like Excel, WORD, ...
Here an example which create a menu with user32.dll but i don't know how to receive item selected.
Thanks.
0 Kudos
Message 7 of 13
(3,772 Views)
Hi,

If you drop me a mail, I'll send you a library to use windows (user32) menus
in LV. Benefit of this is that you can have the menus popup everywhere, and
that the menus can have multiple levels (in stead of a menu ring). A menu
can be triggered by everything you want, e.g. a button.

You'll have to modify it to insert bitmaps.

Btw, when a menu item (a user32 menu item, not LV's menu items) is selected,
a message is send to the window. In response to this, a PopupMenus created
and there is a dll function to wait for the selection of the user.

Regards,

Wiebe.

"secmai" wrote in message
news:506500000008000000C9660000-1031838699000@exchange.ni.com...
> Hi, I would like to use menu functions defined in user32.dll for
> adding bitmap in the menu
bar.
> Could you send me an example using either user32.dll or menu activeX.
> Thanks.
> Alexis de La Fontaine.
0 Kudos
Message 8 of 13
(3,772 Views)
I'm very interesting by your library for using windows menu (user32) in LV.
Which message is send to the window when a menu item is selected ?

Regards,

Alexis de La Fontaine
SECMAI
0 Kudos
Message 9 of 13
(3,772 Views)
Hi,

The WM_COMMAND is send to a window if a menu item is selected (NOTE: not
when a labview (LVDChild class) menu item is selected, LV has it's own menu
functions!).
The least significant two bytes of wParam is the identifier of the selected
menu item.

I was wrong about this:
>Btw, when a menu item (a user32 menu item, not LV's menu items) is
selected,
>a message is send to the window. In response to this, a PopupMenus created
>and there is a dll function to wait for the selection of the user.

This is just how I do it! "Normally" (e.g. in C++) windows creates the
entire menu (e.g. with LoadMenu), and sends the messages to the parent
window.

Regards,

Wiebe.

"secmai" wrote in message
news:50650000000500000063B50000-1031838699000@
exchange.ni.com...
> I'm very interesting by your library for using windows menu (user32)
> in LV.
> Which message is send to the window when a menu item is selected ?
>
> Regards,
>
> Alexis de La Fontaine
> SECMAI
0 Kudos
Message 10 of 13
(3,772 Views)