如题!!
解决方案 »
- progressbar和 scrollbar的问题。
- 哪个熟悉的帮我把以下过程写具体点
- 如何判断cxgrid中按某列分组所得到的组数?
- 欢迎大家加盟QQ群:Delphi高手突破(群号:1463857) 共同讨Delphi技术,共同交流,共同进步!
- 黄河在咆哮 黄河在咆哮
- 请问哪里有有关主要控件(如:BDE、ADO、Data Access等面板)主要属性和方法介绍???
- 急!急!哪位大侠有Windows Media Player9控件的使用说明,最好有demo,在线等待!
- 用TIdPOP3和TIdSMTP时如何做出发送和接收的进度条?
- 有关状态条的问题。各位请进!!
- 我是一个Delphi初学者,大家介绍几本Delphi的书好吗?
- 无法使用 dispose 怎么办??
- 如何查询指定文件夹下的Access数据库(数据库带密码)
在2K下和在XP或其它系统下可能都不一样的!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;const
RAS_MaxDeviceType = 16;
RAS_MaxDeviceName = 128; RASBASE = 600;
ERROR_BUFFER_TOO_SMALL = (RASBASE+3);type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;LpRasDevInfo = ^TRasDevInfo;
TRasDevInfo = record
dwSize : Longint;
szDeviceType : Array[0..RAS_MaxDeviceType] of AnsiChar;
szDeviceName : Array[0..RAS_MaxDeviceName] of AnsiChar;
end;function RasEnumDevices(lpRasDevInfo :LpRasDevInfo;
lpcb: LPDWORD;lpcdevices: LPDWORD): DWORD;
stdcall; external 'RASAPI32.dll' name 'RasEnumDevicesA';
var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
buffer: Pointer;
devices: LPRasDevInfo;
devSize, ndevs: Integer;
begin
devSize := 0;
ndevs := 0;
if RasEnumDevices(nil, @devSize, @ndevs) <> ERROR_BUFFER_TOO_SMALL then
ShowMessage('RasEnumDevices failed.'); buffer := AllocMem(devSize);
try
devices := buffer;
devices^.dwSize := SizeOf(TRasDevInfo);
if RasEnumDevices(buffer, @devSize, @ndevs) = 0 then
begin
while ndevs > 0 do
begin if string(devices^.szDeviceType)='modem' then
Memo1.Lines.Add(Format('%s=%s', [devices^.szDeviceName, devices^.szDeviceType])); Inc(devices);
Dec(ndevs);
end;
end
else
ShowMessage('RasEnumDevices failed.');
finally
FreeMem(buffer);
end;
end;
end.