Click to See Complete Forum and Search --> : CB_INSERTSTRING...Please....


Carko Lee
May 14th, 1999, 03:03 AM
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...

Jason Teagle
May 14th, 1999, 03:24 AM
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?

Carko Lee
May 14th, 1999, 03:40 AM
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??

Jason Teagle
May 14th, 1999, 03:49 AM
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.