I've got what seems like a real bad keyboard problem. I have an MDI
environment with a tree docked in a window on the left and a webbrowser
hosted in OLEContainer which itself is hosted in an OLEContainer. Whenever I
load a new WebPage I immediately set the focus on the tree. If I try and
type in the tree I only get certain characters that work (left, right, up,
down and some other extended keys).
I read and tried every possibility on the
http://www.microsoft.com/mind/0499/faq/faq0499.asp. The strangest thing is
happening, the tree is getting WM_KEYDOWN and WM_KEYUP but the WM_CHAR is
never being sent. It's as if somebody is grabbing the WM_CHAR and swallowing
it. I can undo this behavior by clicking the webbrowser so it gets focus and
reclicking the tree. I've tried doing this in code but it doesn't work.
Tried IOleInPlaceActiveObject which does work except 90% of the time it will
just duplicate the message since the tree will already do a translatemessage
(which will shoot off the WM_CHAR). It's occurrence is completely random but
resolving it is always the same, click on the browser and then click on the
tree. The browser seems to be doing this to any control that can get a
keyboard focus (edit, grids, etc...).
Using the WH_GETMESSAGE hook I can see the keydown, keyup but I never see
the WM_CHAR. If I put a keyboard HOOK I can see everything but it doesn't
help since I get stuck with the same duplication problem.
All I want to do is tell the webbrowser that it can never get Keyboard
focus. Anybody have any idea how to do this or work around this?
Thanks,