屏蔽WebBrowser页面中传出来的声音

procedure CloseSound;
var 
  hWinmm: Cardinal;
  pwaveOutWrite: Pointer;
  lp: Cardinal;
 begin
  hWinmm := LoadLibrary('Winmm.dll');
  if hWinmm > 0 then
    pwaveOutWrite := GetProcAddress(hWinmm, 'waveOutOpen');
  if pwaveOutWrite  <> nil then begin
    VirtualProtect(pwaveOutWrite, 3, PAGE_EXECUTE_READWRITE, lp);
    Move(#$C2#$18#$00, pwaveOutWrite^, 3);
  end;
end;

 

posted on 2012-02-13 11:38  jxgxy  阅读(631)  评论(0编辑  收藏  举报

导航