Load Flash Movies from Memory Without Temporary Files

The control allows loading Flash movies directly from memory, without creating temporary files.
This is done by sending the messages FPCM_LOADMOVIEFROMMEMORY or FPCM_PUTMOVIEFROMMEMORY.

This approach is useful for embedding Flash movies into resources or memory blocks and running them directly, avoiding the need to save files to disk. It simplifies deployment and improves security by preventing unauthorized access to temporary files.

Example: Load a Flash movie from a resource

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);

With this method, movies can be embedded in your application's resources and executed entirely from memory, avoiding installation and file system dependencies.