const
{Windows Media Player API}
...
WMP_MEDIA_PLAY_PAUSE = $E0000;
procedure TForm1.Button1Click(Sender: TObject);
var
wnd: HWND;
begin
wnd := FindWindow('
TMainForm','
Test');
wnd := FindWindowEx(wnd, 0, '
TPanel',
nil);
wnd := FindWindowEx(wnd, 0, '
Shell Embedding',
nil);
wnd := FindWindowEx(wnd, 0, '
Shell DocObject View',
nil);
wnd := FindWindowEx(wnd, 0, '
Internet Explorer_Server',
nil);
wnd := FindWindowEx(wnd, 0, '
Internet Explorer_ActiveMovie',
nil);
wnd := FindWindowEx(wnd, 0, '
VideoRenderer',
nil);
if wnd <> 0
then
Sendmessage(wnd, WM_APPCOMMAND, 0, WMP_MEDIA_PLAY_PAUSE)
// umd das Video anzuhalten
else
ShowMessage('
Nicht gefunden');
end;
end.