CiaranODonnell
Fri Apr 27 10:10:03 CDT 2007
It appears you are from a web dev background which is where your confusion
lies. In javascript, events 'bubble up' from the bottom so the control you
click on informs the parent about the click, that informs its parent etc etc.
In Windows, Windows itself finds the desktop window that contains the click
coordinates and gives it the message for the click, it is then that window
which finds the child control containing the coordinates and informs it of
the click, etc etc.
This is opposite to bubbling up and therefore it is impossible to handle an
event before the parent window as the parent window is what tells you about
it.
That is how forms can have the KeyPreview property where they fire their
keypress events before the children.
You would need to do something like handle the Ctrl+Enter keypress and get
the other internal team to let that through.
OR
Hook into all key events in windows with a top level windows hook and handle
the message directly from windows in that way. I know this is possible but
dont know that API call for getting the hook. You'll need to search for that.
HTH
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"groganrj" wrote:
> I am developing a set of controls that must function inside of an application
> that loads them through COM interop (I don't believe that makes a
> difference). The application is designed to always handled the "Enter" key.
> One of my controls is a text box which needs to allow the user multiline
> input and not being able to use the "Enter" key is borderline unacceptable.
>
> I have tried to override WndPRoc, PreProcessMessage, and a host of other
> behaviors, but I cannot get the application to stop catching the enter
> message.
>
> I have written all messages to a text file when I transition using enter
> versus using a mouse click, and I cannot even find a message that indicates
> my control received an "Enter" at all.
>
> All suggestions welcomed.