关闭进程音效

 hDSound: Cardinal;
  pDirectSoundCreate: Pointer;
  hWinmm: Cardinal;
  pmidiStreamOpen: Pointer;
  pwaveOutWrite: Pointer;
  lp: Cardinal;
begin
  Set8087CW(Default8087CW or $3F);
  hDSound := LoadLibrary('DSound.dll');
  if hDSound > 0 the
 hDSound: Cardinal;
  pDirectSoundCreate: Pointer;
  hWinmm: Cardinal;
  pmidiStreamOpen: Pointer;
  pwaveOutWrite: Pointer;
  lp: Cardinal;
begin
  Set8087CW(Default8087CW or $3F);
  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;
n 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;

转载于:https://www.cnblogs.com/univan/archive/2010/10/25/1860278.html

你可能感兴趣的:(关闭进程音效)