Page 1 of 1

How to delivery mouse events to flash?

Posted: Tue May 15, 2007 12:21 pm
by KwangSu
Hello,

I want to delivery mouse events to flash.

I am using the following create function because I have to get bitmap for frame in direct3d.

Code: Select all

   g_hwndFlashPlayerControl = 
      CreateWindow((LPCTSTR)FPC_GetClassAtom(g_hFPC),
                         NULL,
                         WS_CHILD | FPCS_TRANSPARENT, // WS_VISIBLE
                         0,
                         0,
                         DEF_WIDTH,
                         DEF_HEIGHT,
                         hWnd,
                         NULL,
                         NULL,
                         NULL);


And I use the following code to delivery mouse events.

Code: Select all

      case WM_LBUTTONDOWN:
      case WM_LBUTTONUP:
      case WM_LBUTTONDBLCLK:
      case WM_RBUTTONDOWN:
      case WM_RBUTTONUP:
      case WM_RBUTTONDBLCLK:
      case WM_MOUSEMOVE:
         {
    //3d->2d coordination translation is needed.
            ::SendMessage(g_hwndFlashPlayerControl, msg, wParam, lParam);
         }
         break;


I checked "WM_MOUSEMOVE" event is working in flash !!
But though "WM_LBUTTONDOWN" event is sent to flash window,
It is not working well. I try about 10 mouse click, then only 1 click is working.

I think my question is the same to http://www.f-in-box.com/forum/viewtopic ... highlight= (Help with Mouse/Keyboard to Flash Window when in Direct3d) in forum.

Now, do you have the way?

Thank you so much.

Posted: Tue May 15, 2007 1:29 pm
by Softanics
Thank you for your question.

Unfortunaly, we still haven't a stable solution to pass mouse events to f-in-box window.

Posted: Thu Aug 23, 2007 1:29 pm
by Flecks
We have found experimentally solution that seems to be stable

Code: Select all

      case WM_LBUTTONDOWN:
         {
            // there is some aX aY calculations
            // ...

            // refocus invisible window
            ::SendMessage(aFlashHWND, WM_MOUSEMOVE, 0, MAKELONG(aX-1,aY-1));
            ::SendMessage(aFlashHWND, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(aX,aY));
         }
         break;

Posted: Thu Jun 26, 2008 6:46 am
by tridemax
Flecks wrote:We have found experimentally solution that seems to be stable

Code: Select all

      case WM_LBUTTONDOWN:
         {
            // there is some aX aY calculations
            // ...

            // refocus invisible window
            ::SendMessage(aFlashHWND, WM_MOUSEMOVE, 0, MAKELONG(aX-1,aY-1));
            ::SendMessage(aFlashHWND, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(aX,aY));
         }
         break;


Even in this case buttons with click animation behaves weird. Any ideas why Flash is dropping internal hover flag?
Tbh, without this functionality f_in_box.dll value is very low for any game developer. But if it will work, it opens very interesting possibilities for in-game UI. Look at Crysis interface - it's brilliant. But they used Scaleform's solution and it's sucks badly from developer stand point.