Как определить установлена ли звуковая карта?
Falk0ner, вс, 06/07/2008 - 15:34.
{ ... }
if WaveOutGetNumDevs > 0 then
ShowMessage('Wave-Device present')
else
ShowMessage('No Wave-Device present');
{ ... }
if WaveOutGetNumDevs > 0 then
ShowMessage('Wave-Device present')
else
ShowMessage('No Wave-Device present');
{ ... }
function IsSoundCardInstalled: Boolean;
type
SCFunc = function: UInt; stdcall;
var
LibInst: LongInt;
EntryPoint: SCFunc;
begin
Result := False;
LibInst := LoadLibrary(PChar('winmm.dll'));
try
if LibInst <> 0 then
begin
EntryPoint := GetProcAddress(LibInst, 'waveOutGetNumDevs');
if (EntryPoint <> 0) then
Result := True;
end;
finally
if (LibInst <> 0) then
FreeLibrary(LibInst);
end;
end;
type
SCFunc = function: UInt; stdcall;
var
LibInst: LongInt;
EntryPoint: SCFunc;
begin
Result := False;
LibInst := LoadLibrary(PChar('winmm.dll'));
try
if LibInst <> 0 then
begin
EntryPoint := GetProcAddress(LibInst, 'waveOutGetNumDevs');
if (EntryPoint <> 0) then
Result := True;
end;
finally
if (LibInst <> 0) then
FreeLibrary(LibInst);
end;
end;
Взято с Delphi Knowledge Base: http://www.baltsoft.com/
Отправить комментарий