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

Re: SelComboItem command won't trigger CBN_SELCHANGE Notification

Expand Messages
  • pkaluski
    This should work (according to MSDN): DWORD SelComboString(hWnd, lpItem, start_idx = 0 ) HWND hWnd; char *lpItem; DWORD start_idx; CODE: int result = 0; result
    Message 1 of 3 , May 10, 2005
    • 0 Attachment
      This should work (according to MSDN):


      DWORD
      SelComboString(hWnd, lpItem, start_idx = 0 )
      HWND hWnd;
      char *lpItem;
      DWORD start_idx;
      CODE:
      int result = 0;
      result = SendMessage(hWnd,
      CB_SELECTSTRING,
      start_idx,
      LPARAM( lpItem ) );
      if( result == CB_ERR ){
      RETVAL = -1;
      }else{
      RETVAL = result;
      }
      OUTPUT:
      RETVAL


      It is a wrapper around CB_SELECTSTRING.
      Let me know if it works.
      It works for me but it would be good to make sure that it really sends
      all expected notifications.

      -Piotr



      --- In perlguitest@yahoogroups.com, "wenjie wang" <wenjie.wang@d...>
      wrote:
      >
      >
      > I'm having problem with the manipulation of combo item selection when
      > sending raw message(CB_SETCURSEL) or using the new
      > feature "SelComboItem" command added in the release 1.50.3-ad. Both
      > approaches don't behave the same as a real user selecting an item from
      > a combo box.
      >
      > When a real user make a selection from the combo box, a notification
      > (CBN_SELCHANGE) is sent, but the GUITEST32 will only make the change
      > to the current selected item, but won't be triggering the windows
      > notification message. I guess it works fine for most of the cases,
      > except mine;-) I have more than one combo boxes, the contents of 2nd
      > combo depending on the selected item of 1st combo. What I'm doing
      > inside the application is to handle the CBN_SELCHANGE notification of
      > 1st combo and depending on what's being selected, I'll populate the
      > contents of 2nd combo box. As the CBN_SELCHANGE is not sent, my
      > application behaved different when using GUITEST and failed my test
      > case;(
      >
      > Any suggestions?
    Your message has been successfully submitted and would be delivered to recipients shortly.