I have found a solution to my problem although the original issue still exists.

I originally created my menu to look like "File" and under that "Exit" like most other Windows applications. This creates two entries in $menu_popup, "File" and "File_Exit".

In my code above I was trying to display the menu starting from and including the "File" option, however this was not working.

I changed my RightClick code to be:

sub NI_RightClick() { print "NI_RightClick event called.\n" if ($debug); $win_main->TrackPopupMenu($menu_popup->{File}, Win32::GUI::GetCurs +orPos()); }
and it now works inasmuch as when I right-click the notification icon it display a menu with "Exit" in it. I also found that I could expand the menu by adding lines similar to the ">E&xit" one, so the code now displays the menu list that would appear under the "File" menu button.

So, my problem is resolved but the issue still exists. It may be that this is the way it's supposed to work and you cannot pass a Win32::GUI::Menu item to the TrackPopupMenu() function but other posts and examples suggest that this is exactly what you should pass to this function.

Ah well, it's working for now, thanks for looking, providing me with help on formatting and your suggestions for the solution. |\/|artin


In reply to Re: Win32::GUI won't display an NI menu properly by wardmw
in thread Win32::GUI won't display an NI menu properly by wardmw

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.