Excellent jop. kejohm Thank you very much :)

I managed to... These are my codes

use strict; use warnings; use Win32::API(); Win32::API->Import('user32', 'SetMenuItemInfo', 'LILP', 'L') or die; use Win32::GUI (); use Win32::GUI::DIBitmap(); sub MIIM_BITMAP() {0x00000080} my $menu = Win32::GUI::MakeMenu( 'Popup' => 'Popup', '>Item &1' => { -name => 'Item1', -onClick => sub { print "Item1\n +"; 0; }, }, '>-' => 'Seperator', '>Item &4' => { -name => 'Item4', -onClick => sub { print"Item4\n" +; 0; }, }, ); my $mw = Win32::GUI::Window->new( -size => [400,300], -menu => $menu, -name => "test", ); my $hbap = new Win32::GUI::Bitmap ('aon2.bmp'); my $hbmp = $hbap->{-handle}; my $hmenu = $menu->{Popup}->{-handle}; my $mii = pack( 'IIIIILLLLLIL', 12 * 4, # cbsize = sizeof(MENUITEMINFO) MIIM_BITMAP, # fMask = MIIM_BITMAP 0, # fType - unused 0, # fState - unused 0, # wID - unused 0, # hSubMenu - unused 0, # hbmpChecked - unused 0, # hbmpUnchecked - unused 0, # dwItemData - unused 0, # dwTypeData - unused 0, # cch - unused $hbmp, # hbmpItem ); SetMenuItemInfo($hmenu, 2, 1, $mii); $mw->Center(); $mw->Show(); Win32::GUI::Dialog();

use Win32::API(); Win32::API->Import('user32', 'SetMenuItemInfo', 'LILP', 'L') or die; Win32::API->Import('user32', 'SetMenuInfo', 'LP', 'L') or die; use Win32::GUI qw(CW_USEDEFAULT SM_CXMENUCHECK SM_CYMENUCHECK TRANSPAR +ENT); use Win32::GUI::DIBitmap(); sub MIIM_BITMAP() {0x00000080} sub MIM_STYLE() {0x00000010} sub MIM_BACKGROUND() {0x00000002} my $menu = Win32::GUI::MakeMenu( 'Popup' => 'Popup', '>Item &1' => { -name => 'Item1', -onClick => sub { print "Item1\n +"; 0; }, }, '>-' => 'Seperator', '>Item &4' => { -name => 'Item4', -onClick => sub { print"Item4\n" +; 0; }, }, ); $po = new Win32::GUI::Brush( -color => 000); my $mw = Win32::GUI::Window->new( -left => CW_USEDEFAULT, -size => [400,300], -menu => $menu, -name => "test", ); $hbap = new Win32::GUI::Bitmap ('aon2.bmp'); $hbmp = $hbap->{-handle}; $hmenu = $menu->{Popup}->{-handle}; my $mi = pack( 'LLLILLL', 12 * 4, # cbsize = sizeof(MENUITEMINFO) MIM_BACKGROUND, # fMask = MIM_STYLE 0, 0, # cyMax - unused $po, # hbrBack - unused 0, # dwContextHelpID - unused 0, # dwMenuData - unused ); SetMenuInfo($hmenu, $mi); my $mii = pack( 'IIIIILLLLLIL', 12 * 4, # cbsize = sizeof(MENUITEMINFO) MIIM_BITMAP, # fMask = MIIM_BITMAP 0, # fType - unused 0, # fState - unused 0, # wID - unused 0, # hSubMenu - unused 0, # hbmpChecked - unused 0, # hbmpUnchecked - unused 0, # dwItemData - unused 0, # dwTypeData - unused 0, # cch - unused $hbmp, # hbmpItem ); SetMenuItemInfo($hmenu, 2, 1, $mii); $mw->Center(); $mw->Show(); Win32::GUI::Dialog();

But now, not show the "Transparent" png images; i have looked transparent png images in a main window with "AddGraphic" and "AddLabel" modules !!... I changed my mind ! and write this code;
use Win32::API(); Win32::API->Import('user32', 'SetMenuItemInfo', 'LILP', 'L') or die; Win32::API->Import('user32', 'SetMenuInfo', 'LP', 'L') or die; use Win32::GUI qw(CW_USEDEFAULT SM_CXMENUCHECK SM_CYMENUCHECK TRANSPAR +ENT); use Win32::GUI::DIBitmap(); sub MIIM_BITMAP() {0x00000080} sub MIM_STYLE() {0x00000010} sub MIM_BACKGROUND() {0x00000002} my $menu = Win32::GUI::MakeMenu( 'Popup' => 'Popup', '>Item &1' => { -name => 'Item1', -onClick => sub { print "Item1\n +"; 0; }, }, '>-' => 'Seperator', '>Item &4' => { -name => 'Item4', -onClick => sub { print"Item4\n" +; 0; }, }, ); $po = new Win32::GUI::Brush( -color => 000); my $mw = Win32::GUI::Window->new( -left => CW_USEDEFAULT, -size => [400,300], -menu => $menu, -name => "test", ); $hbap = new Win32::GUI::Bitmap ('aon2.bmp'); $hbmp = $hbap->{-handle}; $hmenu = $menu->{Popup}->{-handle}; my $mi = pack( 'LLLILLL', 12 * 4, # cbsize = sizeof(MENUITEMINFO) MIM_BACKGROUND, # fMask = MIM_STYLE 0, 0, # cyMax - unused $po, # hbrBack - unused 0, # dwContextHelpID - unused 0, # dwMenuData - unused ); SetMenuInfo($hmenu, $mi); my $mii = pack( 'IIIIILLLLLIL', 12 * 4, # cbsize = sizeof(MENUITEMINFO) MIIM_BITMAP, # fMask = MIIM_BITMAP 0, # fType - unused 0, # fState - unused 0, # wID - unused 0, # hSubMenu - unused 0, # hbmpChecked - unused 0, # hbmpUnchecked - unused 0, # dwItemData - unused 0, # dwTypeData - unused 0, # cch - unused $hbmp, # hbmpItem ); SetMenuItemInfo($hmenu, 2, 1, $mii); $mw->Center(); $mw->Show(); Win32::GUI::Dialog();
Basically i change the popup menu "Color" and "Transparent" problem will be solved... This my idea but not change the popup menu color !!!

In reply to Re^2: Win32::GUI::Menu icon problem - I need help ! by Ahmet
in thread Win32::GUI::Menu icon problem - I need help ! by Ahmet

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.