F-IN-BOX DLL Edition Help >> How to

Loading a movie from a resource

Using the control you can load any flash movie from memory directly. Just use the FPCM_LOADMOVIEFROMMEMORY and FPCM_PUTMOVIEFROMMEMORY messages. No temporary files! Load any movie on-the-fly from any supported source. For example, you can put one or more flash movies in the resource section of your application and then load it from the exe! That's the portability and power of F-IN-BOX!

Here's an example of how to load a flash movie from a resource:

[ C++ ]
HFPC hFPC = FPC_LoadRegisteredOCX();

if (NULL == hFPC)
    return;

HWND hwndFlashPlayerControl = 
   FPC_CreateWindow(hFPC, 
                    0, 
                    NULL, 
                    WS_CHILD | WS_VISIBLE, 
                    nLeft, 
                    nTop, 
                    nWidth, 
                    nHeight, 
                    hWnd, 
                    NULL, 
                    NULL, 
                    NULL)

HMODULE hModule = GetModuleHandle(NULL);
HRSRC hResInfo = FindResource(hModule, _T("EmbeddedMovie"), _T("FLASH"));
HGLOBAL hResData = LoadResource(hModule, hResInfo);
LPVOID lpMovieData = LockResource(hResData);
DWORD dwMovieSize = SizeofResource(hModule, hResInfo);

SFPCPutMovieFromMemory sFPCPutMovieFromMemory;

sFPCPutMovieFromMemory.lpData = lpMovieData;
sFPCPutMovieFromMemory.dwSize = dwMovieSize;

::SendMessage(hwndFlashPlayerControl, FPCM_PUTMOVIEFROMMEMORY, 0, (LPARAM)&sFPCPutMovieFromMemory);


Copyright © Softanics. All rights reserved.
F-IN-BOX is a trademark of Softanics.
Macromedia and Shockwave Flash are trademarks of Adobe