TWebBrowser静音

procedure TForm1.FormCreate(Sender: TObject);
var
  hDSound: Cardinal;
  pDirectSoundCreate: Pointer;
  hWinmm: Cardinal;
  pmidiStreamOpen: Pointer;
  pwaveOutWrite: Pointer;
  lp: Cardinal;
begin
  hDSound := LoadLibrary(‘DSound.dll‘);
  if hDSound > 0 then
    pDirectSoundCreate := GetProcAddress(hDSound, ‘DirectSoundCreate‘);
  if pDirectSoundCreate <> nil then
  begin
    VirtualProtect(pDirectSoundCreate, 3, PAGE_EXECUTE_READWRITE, lp);
    Move(#$C2#$0C#$00, pDirectSoundCreate^, 3);
  end;
 
  hWinmm := LoadLibrary(‘Winmm.dll‘);
  if hWinmm > 0 then
    pmidiStreamOpen := GetProcAddress(hWinmm, ‘midiStreamOpen‘);
  if pmidiStreamOpen <> nil then
  begin
    VirtualProtect(pmidiStreamOpen, 3, PAGE_EXECUTE_READWRITE, lp);
    Move(#$C2#$04#$00, pmidiStreamOpen^, 3);
  end;
 
  if hWinmm > 0 then
    pwaveOutWrite := GetProcAddress(hWinmm, ‘waveOutWrite‘);
  if pwaveOutWrite <> nil then
  begin
    VirtualProtect(pwaveOutWrite, 3, PAGE_EXECUTE_READWRITE, lp);
    Move(#$C2#$0C#$00, pwaveOutWrite^, 3);
  end;
end;

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。