其实它的接口函数在MultiMon.pas中,大家只要在use中加入该单元就可以了!打开
该文件就可以看到一些函数和使用的参数了

解决方案 »

  1.   

    唉!我还是无法列举出系统已经安装的显示器的名称和数量
    使用enumdisplaydevice 不知道返回的结果对应的是什么
      

  2.   

    EnumDisplayDevices 
      Allows you to determine the actual list of devices available on a given machine. You can enumerate the devices and get a DC for any monitor on the system that Windows supports. This allows an application to work with a dedicated display device without sharing the screen with other applications. (This is used, for example, by the Control Panel.)
      

  3.   

    可是我返回的结果是displayname:=\\.\DISPLAY1 devicestring=RAGE MOBILITY-M AGP 
    displayname:=\\.\DISPLAY3 devicestring=NetMeeting driver
    我不知道该怎么解释这个结果!
      

  4.   

    这个是我自己写的一段代码!可这个并不是我想要的结果!我要的是
    和楼主一样的效果!我要的是我能检测到系统安装了几个显示器,并且知道哪个可用
    还可以在可用的情况下将其打开或者关闭!最关键的是要实现:“将WINDOWS桌面扩展到该监视器上”这个功能,在这个基础之上在去修改各个显示器的分辨率!
     type disr=record
       w,h,c:integer;
      end;
    var
      Form1: TForm1;
      dis:_devicemodea;
      disr_a:array[0..120] of disr;
    implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
    dis.dmSize:=sizeof(dis);
    dis.dmPelsWidth:=disr_a[listbox1.ItemIndex].w;
    dis.dmPelsHeight:=disr_a[listbox1.ItemIndex].h;
    dis.dmBitsPerPel:=disr_a[listbox1.ItemIndex].c;
    dis.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT or DM_BITSPERPEL;
    ChangeDisplaySettingsa(dis,CDS_UPDATEREGISTRY);//设置当前的分辨率end;procedure TForm1.Button2Click(Sender: TObject);
    var pdis:_display_device;
        i:integer;
    begin
    combobox1.Clear;
    for i:=0 to 10 do
     begin
     pdis.cb:=sizeof(pdis);
     if enumdisplaydevices(nil,i,pdis,0)=false then break
     combobox1.Items.Add(pdis.DeviceName);;//在这里列举出来的好象是显  卡的名称。而不是我想要的显示器的名称
    end;
    combobox1.Text:=combobox1.Items[0];
    form1.ComboBox1Change(sender);
    end;
    procedure TForm1.ComboBox1Change(Sender: TObject);
    var i:integer;
    begin
    for i:=1 to 120 do
     begin
      disr_a[i].w:=0;
      disr_a[i].h:=0;
      disr_a[i].c:=0;
     end;
    listbox1.Items.Clear;
    i:=0;
    dis.dmSize:=sizeof(dis);
    while EnumDisplaySettings(pchar(combobox1.Text),i,dis)<>false do
    if ChangeDisplaySettingsa(dis,CDS_test)<>DISP_CHANGE_BADMODE//检测是否可用 then
     begin
      inc(i);
      disr_a[i].w:=dis.dmPelsWidth;
      disr_a[i].h:=dis.dmPelsHeight;
      disr_a[i].c:=dis.dmBitsPerPel;
      listbox1.Items.Add('宽:='+inttostr(dis.dmPelsWidth)+'高='+inttostr(dis.dmPelsHeight)+'色彩:='+inttostr(dis.dmBitsPerPel)+‘刷新率='+inttostr(dis.dmDisplayFrequency));
      if i>120 then break;
     end;
    end;