$winMain->Hook( WM_MEASUREITEM, sub { my($self, $wParam, $lParam, $type, $msgcode) = @_; return 1 unless $type == 0; return 1 unless $msgcode == WM_MEASUREITEM; my %measureitem; # Unpack data from structure @measureitem{qw(CtrlType CtrlID itemID itemWidth itemHeight itemData)} = unpack 'IIIIIL', unpack 'P24', pack 'L', $lParam; # Set the height of the items $measureitem{'itemHeight'} = 30; # Pack data back into structure my $struct = pack 'IIIIIL', @measureitem{qw(CtrlType CtrlID itemID itemWidth itemHeight itemData)}; $lParam = unpack 'L', pack 'P24', $struct; # or #$_[2] = unpack 'L', pack 'P24', $struct; return 1; }, ); #### case WM_MEASUREITEM: lpmis = (LPMEASUREITEMSTRUCT) lParam; // Set the height of the list box items. lpmis->itemHeight = 30; return true;