FPCPutMovieFromMemory

Syntax

BOOL WINAPI FPCPutMovieFromMemory(
  HWND hwndFlashPlayerControl,
  LPVOID lpData,
  DWORD dwSize);

Description

The FPCPutMovieFromMemory function loads a Flash movie directly from a memory buffer into the Flash Player control.

This method avoids using temporary files, making it ideal for scenarios where the SWF movie is embedded in the application’s resources or decrypted in memory before playback.

hwndFlashPlayerControl – handle to the Flash Player control window.

lpData – pointer to the memory buffer containing the SWF movie data.

dwSize – size of the memory buffer, in bytes.

The function returns TRUE on success or FALSE if loading fails.

Example

// Load SWF movie from resource into memory and play it
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);
 
if (!FPCPutMovieFromMemory(hwndFlashPlayerControl, lpMovieData, dwMovieSize))
{
    MessageBox(NULL, _T("Failed to put movie from memory"), _T("Error"), MB_OK);
}