Page 1 of 1

Help with Mouse/Keyboard to Flash Window when in Direct3d

Posted: Mon Feb 20, 2006 12:39 pm
by Jim W.
We're using FlashPlayerControl to put flash in a Direct3d world. So far things are working, but I'm having problems getting keystrokes and mouse messages to the flash app. Any ideas? I get the mouse and keyboard in the app (WM_LBUTTON*, WM_MOUSEMOVE WM_KEYUP, WM_KEYDOWN) forward them to the hidden window, (I'm using your example), but I get erratic results. The coordinate are being translated correctly.

About 50% of the mouse clicks work, and none of the keys work. I looked at the FPC code and see you're doing quite a bit of stuff with message maps. I commented out some areas that had to do with focus, but that didn't help. Could you update your DirectX sample to pass in a click and key strokes? That would be great. Using Spy++, I see the messages getting to the hidden window, but nothing happens, as if the FlashPlayerControl window is eating them.

Re: Help with Mouse/Keyboard to Flash Window when in Direct3

Posted: Mon Feb 20, 2006 4:09 pm
by Softanics
Thank you for your question.
I haven't example but I think you should try to use IOleInPlaceObjectWindowless::OnWindowMessage. Get a pointer to IOleInPlaceObjectWindowless using the message FPCM_QUERYINTERFACE.

Posted: Fri Feb 24, 2006 7:19 pm
by Jim W.
I did this and it works just as poorly, with only some clicks and no keyboard getting through

SFPCQueryInterface FPCQueryInterface;
FPCQueryInterface.pvObject = NULL;
FPCQueryInterface.iid = __uuidof(IOleInPlaceObjectWindowless);
::SendMessage(m_hwndFlashPlayerControl, FPCM_QUERYINTERFACE, 0, (LPARAM)&FPCQueryInterface);

VERIFY( FPCQueryInterface.pvObject != NULL );

pWindowless.Attach((IOleInPlaceObjectWindowless*)FPCQueryInterface.pvObject);

...

HRESULT result;
HRESULT hr = pWindowless->OnWindowMessage( msgId, wp, lp, &result );
ASSERT( SUCCEEDED( hr ) );

Any ideas?