How to delivery mouse events to flash?

DLL Edition of the F-IN-BOX
KwangSu
Posts: 2
Joined: Tue May 15, 2007 7:34 am

How to delivery mouse events to flash?

Postby KwangSu » Tue May 15, 2007 12:21 pm

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.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue May 15, 2007 1:29 pm

Thank you for your question.

Unfortunaly, we still haven't a stable solution to pass mouse events to f-in-box window.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

Flecks
Posts: 4
Joined: Thu Aug 23, 2007 1:18 pm
Location: Ukraine, Dnepropetrovsk

Postby Flecks » Thu Aug 23, 2007 1:29 pm

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;

tridemax
Posts: 1
Joined: Thu Jun 26, 2008 6:18 am

Postby tridemax » Thu Jun 26, 2008 6:46 am

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.


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 13 guests