It's actually all being done in Visual Basic.  I kind of had the feeling that was the problem. 

No the trick is how do I call the defwindowproc when dealing with VB.  You've given me some idea's though thanks :)

Stewart

Reece Dunn <[EMAIL PROTECTED]> wrote:
Stewart Obert wrote:
>I'm having 2 problems with a couple of things I want to get into my
>scintilla control.
>
> First I wanted to detect mousedown in scintilla so I could pass an
>event to the control when the mouse was pressed. Whas I came up with was
>this:
>
> Case WM_LBUTTONDOWN
> lP = GetWindowCursorPos(sci)
> RaiseEvent MouseDown(1, 0, lP.x, lP.Y)
>
> This works as far as detecting the clicking of the mouse ! but left click
>will not longer let you move the cursor around. It's like I've trapped it
>and there by prevented scintilla from getting that it ever happened. Is
>there something fairly simple I'm doing wrong here?
>
> The other problem I'm having is with getting the key down. This is what
>I came up with:
>
> Case WM_KEYDOWN
> RaiseEvent KeyPress(wParam)
>
> Again it seems to work but disables a lot of keys in scintilla IE
>backspace and such.
>
> Thanks for any help you can offer.

These two problems are related. It essentially boils down to the message not
being passed on to the Scintilla window procedure.

If you are using ATL/WTL, you can process the message and if you want to
raise the event before the message is processed, use:

LRESULT OnKeyDown( ..., BOOL & handled )
{
RaiseEvent KeyPress( wParam );
! handled = FALSE;
return 0;
}

or after, use:

LRESULT OnKeyDown( ..., BOOL & handled )
{
LRESULT ret = DefWindowProc();
RaiseEvent KeyPress( wParam );
return 0;
}

If you are using C#, I am not sure how to do this, sorry :(.

- Reece


_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest


Yahoo! Photos
Got holiday prints? See all the ways to get quality prints in your hands ASAP.
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to