アプリケーションのコンテナー内でプレゼンテーションを実行するために OleContainer は必要ありません。プレゼンテーションを実行するパネルコンテナーをフォームに配置し、次のルーチンを試してください。
procedure TForm2.Button3Click(Sender: TObject);
const
ppShowTypeSpeaker = 1;
ppShowTypeInWindow = 1000;
SHOW_FILE = 'C:\Users\jcastillo\Documents\test.pps';
var
oPPTApp: OleVariant;
oPPTPres: OleVariant;
screenClasshWnd: HWND;
pWidth, pHeight: Integer;
function PixelsToPoints(Val: Integer; Vert: Boolean): Integer;
begin
if Vert then
Result := Trunc(Val * 0.75)
else
Result := Trunc(Val * 0.75);
end;
begin
oPPTApp := CreateOleObject('PowerPoint.Application');
oPPTPres := oPPTApp.Presentations.Open(SHOW_FILE, True, True, False);
pWidth := PixelsToPoints(Panel1.Width, False);
pHeight := PixelsToPoints(Panel1.Height, True);
oPPTPres.SlideShowSettings.ShowType := ppShowTypeSpeaker;
oPPTPres.SlideShowSettings.Run.Width := pWidth;
oPPTPres.SlideShowSettings.Run.Height := pHeight;
screenClasshWnd := FindWindow('screenClass', nil);
Windows.SetParent(screenClasshWnd, Panel1.Handle);
end;
手元にドキュメントはありませんが、私の考えでは、Run.Width と Run.Height はピクセルではなくポイントで指定する必要があります。ピクセルをポイントに変換する私の貧弱な解決策はここにあります。ここでのテストではうまくいきます...あなたの環境で正しい変換方法を見つけるのはあなた次第です。
プロパティからプレゼンテーション ウィンドウのハンドルを取得できると思われますが、oPPTPres.SlideShowSettings.Run.HWND
ここでは機能しないため、FindWindow を呼び出します。