Loading ...
Sorry, an error occurred while loading the content.

1704Re: List View header control

Expand Messages
  • brentje
    Mar 1, 2007
    • 0 Attachment
      Hi

      Try creating a pointer for $hdr_buf like you do $str_buf. Most of C
      works with pointers, so I think that may be the key.

      my $hdr_buf_ptr = pack( "l l l",
      LVN_COLUMNCLICK, #nmh.hdr.code Code
      $header, #nmh.hdr.hwndFrom hwnd
      0 #nmh.hdr.idFrom
      );

      my $hdr_buf = unpack( "l!", pack( 'P',$hdr_buf_ptr));

      my $str_buf_ptr = pack( "l l l l l l l l l",
      $hdr_buf, #nmh.hdr
      -1, #item
      0, #sub item
      0, #HDITEM, not relevant for this notification
      0, #newState
      0, #oldstate
      0, #changed
      0, #action
      0 #lparam
      );

      my $str_buf = unpack( "l!", pack( 'P',$str_buf_ptr));

      SendMessage( $keysList, WM_NOTIFY, 0, $str_buf);

      Brent

      --- In perlguitest@yahoogroups.com, "jonnyroberts1978"
      <jonnyroberts1978@...> wrote:
      >
      > Hi
      >
      > Thanks for your reply. I think one of my problems is setting up the
      > structure to send to the list box as the first member in the
      > NMLISTVIEW structure is a NMHDR structure, has anyone got any ideas
      > how I should structure this in perl, my failed attempt is below.
      >
      > my $hdr_buf = pack( "l l l",
      > LVN_COLUMNCLICK, #nmh.hdr.code Code
      > $header, #nmh.hdr.hwndFrom hwnd
      > 0 #nmh.hdr.idFrom
      > );
      >
      > my $str_buf_ptr = pack( "l l l l l l l l l",
      > $hdr_buf, #nmh.hdr
      > -1, #item
      > 0, #sub item
      > 0, #HDITEM, not relevant for this notification
      > 0, #newState
      > 0, #oldstate
      > 0, #changed
      > 0, #action
      > 0 #lparam
      > );
      >
      > my $str_buf = unpack( "l!", pack( 'P',$str_buf_ptr));
      >
      > SendMessage( $keysList, WM_NOTIFY, 0, $str_buf);
      >
    • Show all 15 messages in this topic