CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    5

    CB_INSERTSTRING...Please....

    Can't recive Message CB_INSERTSTRING...
    What the......

    LRESULT CALLBACK GetMsgProc (int nCode, WPARAM wParam, LPARAM lParam )
    {
    if(nCode>=0)
    {
    if(((MSG*)lParam)->message==(long)CB_INSERTSTRING)
    AfxMessageBox("CB_INSERTSTRING");
    }
    :



    Please....help me....
    Please...

  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: CB_INSERTSTRING...Please....

    Why are you trying to 'catch' CB_INSERTSTRING? Are you aware that this is a message that YOU send to the combo box? When you call the InsertString() method, this is the Windows message it sends. Are you trying to prevent this message from being sent to the combo box? For what reason?

    I see a few possible reasons for it not working: (1) As it is a hook, and the message goes to the combo box directly, are you setting the hook into the combo box's WndProc? If you try to insert the hook anywhere else, such as the combo box's parent window, it will not work as the message never goes via that route. (2) Perhaps this message is never being used? Can you guarantee that CB_INSERTSTRING is being sent? (3) Perhaps (child) controls don't allow hooks to be placed. In that case, how about deriving your own class from CComboBox, subclassing the control to your derived class, and trapping WM_COMMAND and filtering out that message? (4) Perhaps, somehow, the parent window's PreTranslateMessage() is filtering this message out, although I can't think of a valid reason why.

    Does this help at all?



    --
    Jason Teagle
    [email protected]

  3. #3
    Join Date
    May 1999
    Posts
    5

    Re: CB_INSERTSTRING...Please....

    Yes...I use a Hook....

    So I just want to catch a CB_INSERTSTRING Message from another application(IE or Netscape....)

    There is no way to hook combo message?? (I just need to hook CB_INSERTSTRING message)

    Is there another tip??



  4. #4
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: CB_INSERTSTRING...Please....

    Oh. I don't know if hooks work on child controls, and I DEFINITELY don't know if they work by hooking into another application. I'm afraid you need someone more knowledgeable to help you with this. Sorry.



    --
    Jason Teagle
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured