|
Quick links:
F-IN-BOX DLL Edition Home Page
| Buy license
| Welcome to our forum!
| Ask your question
| Help on the Web
F-IN-BOX DLL Edition Help Usage
F-IN-BOX, DLL Edition is a window control to enhance Macromedia / Adobe Flash Player ActiveX features. It does not use its own engine to display movies but provide a wrapper around official swflash.ocx/flash.ocx code instead. Thus it is possible to avoid certain Macromedia / Adobe Flash Player ActiveX limitations. First of all, create a HFPC handle. If you want to use a flash ocx registered in the system, call FPC_LoadRegisteredOCX. If you want to load flash ocx from the memory, use FPC_LoadOCXCodeFromMemory. FPC_LoadRegisteredOCX / FPC_LoadOCXCodeFromMemory loads flash ocx code and registers a f-in-box window class. To obtain an atom of this class, use FPC_GetClassAtom. Pass this atom to CreateWindow / CreateWindowEx to create an f-in-box window. Also you can use FPC_CreateWindow. After destroying all f-in-box windows which are belong to a HFPC, call FPC_UnloadCode to unload flash ocx code. There are few types of f-in-box windows:
Examples: [ C++ ]
HFPC hFPC;
HWND hwndFPC1, hwndFPC2, hwndFPC3;
...
HFPC hFPC = FPC_LoadRegisteredOCX();
if (NULL == hFPC)
// Error
return;
hwndFPC1 =
FPC_CreateWindow(hFPC,
0,
NULL,
WS_CHILD | WS_VISIBLE,
nLeft,
nTop,
nWidth,
nHeight,
hWnd,
NULL,
NULL,
NULL)
hwndFPC2 =
CreateWindow((LPCTSTR)FPC_GetClassAtom(theApp.m_hFPC),
NULL,
WS_CHILD | WS_VISIBLE | FPCS_TRANSPARENT,
rc.left,
rc.top,
rc.right - rc.left,
rc.bottom - rc.top,
hWnd,
NULL,
NULL,
NULL);
hwndFPC3 =
CreateWindowEx(WS_EX_LAYERED,
(LPCTSTR)FPC_GetClassAtom(m_hFPC),
NULL,
WS_POPUP | WS_VISIBLE,
rc.left,
rc.top,
rc.right - rc.left,
rc.bottom - rc.top,
NULL,
NULL,
NULL,
NULL);
...
if (NULL != hFPC)
{
FPC_UnloadCode(hFPC);
hFPC = NULL;
}
You can load a movie from local file or URL, use FPC_LoadMovie or FPC_PutMovie. This functions call native flash interface. You can load a movie from any source. There are few options:
Examples: [ C++ ]
// Load movie from resource
FPCPutMovieFromResource(hwndFlashPlayerControl, NULL, _T("MOVIE"), _T("SWF"));
...
IStream* pStream;
FPCPutMovieUsingStream(hwndFlashPlayerControl, &pStream);
while (...)
if (S_OK != pStream->Write(...))
break;
pStream->Release();
...
IStream* pStream;
FPCPutMovieUsingStream(hwndFlashPlayerControl, &pStream);
IStream* pStreamForMarshalling;
CoMarshalInterThreadInterfaceInStream(IID_IStream, pStream, &pStreamForMarshalling);
pStream->Release();
pStream = NULL;
DWORD dwThreadId;
HANDLE hThread =
CreateThread(NULL,
0,
&FlashContentProviderThread,
(LPVOID)pStreamForMarshalling,
0,
&dwThreadId);
CloseHandle(hThread);
DWORD WINAPI FlashContentProviderThread(LPVOID lpParameter)
{
CoInitialize(NULL);
IStream* pStreamForMarshalling = (IStream*)lpParameter;
IStream* pStream;
CoUnmarshalInterface(pStreamForMarshalling, IID_IStream, (void**)&pStream);
while (...)
if (S_OK != pStream->Write(...))
break;
pStreamForMarshalling->Release();
pStream->Release();
CoUninitialize();
}
A movie can try to load external resources. You can intercept this event and provide content of a resource. A movie loads external resource by full path (i.e. beginning with http://). To provide data of the resource, you should set a handler (using FPC_AddOnLoadExternalResourceHandler). The handler is calling when such resource is loading. A movie was loaded from a stream, a memory block or a resource. The movie loads an external resource (*.swf, *.jpg, *.mp3, but except *.flv - flash video) by relative path (i.e. something like "images/image1.jpg"). To provide data of the resource, you should handle the notification FPCN_LOADEXTERNALRESOURCE or FPCN_LOADEXTERNALRESOURCEEX.
To enable / disable flash sounds call FPC_EnableAudio. To set volume call FPC_SetSoundVolume.
Copyright © 2004 - 2008 Softanics. All rights reserved. F-IN-BOX is a trademark of Softanics. Macromedia and Shockwave Flash are trademarks of Adobe
Quick links:
F-IN-BOX DLL Edition Home Page
| Buy license
| Welcome to our forum!
| Ask your question
| Help on the Web
|