如何通过程序控制在一台电脑上接两个显示器,并且显示不同内容(100分)

  • 主题发起人 主题发起人 ztmail
  • 开始时间 开始时间
Z

ztmail

Unregistered / Unconfirmed
GUEST, unregistred user!
比如:一台显示器显示数据,另一台显示图形或视频.
谢谢了.
 
请教各位大侠,有没有好办法!
 
做一个虚拟桌面的东东
 
用双头显示卡。
 
做一个虚拟桌面的东东
---------------------
请问关键思路在那里啊
 
话题168435的标题是: 在第二显示器上开一个窗口(win98支持的双显示器) (160分)
分类:系统相关 老莫 (1999-12-14 17:11:00)
我在做一个东西,for windows98插双显卡,主程序执行后,想在第二显示器
上开一个窗口。而且不能用拖拽方式把窗口拖过去,不知道有没有什么好办法?
我只有160分了,全部加上。



www (1999-12-14 17:22:00)
>>

o*o (1999-12-14 17:30:00)
看看帮助。

TScreen.Monitors
TMonitor
TCustomForm.DefaultMonitor

o*o (1999-12-14 17:35:00)
哦,对不起,你一定知道这些。

menxin (1999-12-14 21:44:00)
应该挺简单的,可以没条件试啊。

ZRY (1999-12-14 23:29:00)
以下代码是从VCL中找到的,我没条件试,你可以试看看:
// from ".../Source/VCL/Forms.pas"

procedure TCustomForm.SetWindowToMonitor;
var
AppMon, WinMon: HMONITOR;
I, J: Integer;
ALeft, ATop: Integer;
begin
if (FDefaultMonitor <> dmDesktop) and (Application.MainForm <> nil) then
begin
AppMon := 0;
if FDefaultMonitor = dmMainForm then
AppMon := Application.MainForm.Monitor.Handle
else if (FDefaultMonitor = dmActiveForm) and (Screen.ActiveCustomForm <> nil) then
AppMon := Screen.ActiveCustomForm.Monitor.Handle
else if FDefaultMonitor = dmPrimary then
AppMon := Screen.Monitors[0].Handle;
WinMon := Monitor.Handle;
for I := 0 to Screen.MonitorCount - 1 do
if (Screen.Monitors.Handle = AppMon) then
if (AppMon <> WinMon) then
for J := 0 to Screen.MonitorCount - 1 do
if (Screen.Monitors[J].Handle = WinMon) then
begin
if FPosition = poScreenCenter then
SetBounds(Screen.Monitors.Left + ((Screen.Monitors.Width - Width) div 2),
Screen.Monitors.Top + ((Screen.Monitors.Height - Height) div 2),
Width, Height)
else
begin
ALeft := Screen.Monitors.Left + Left - Screen.Monitors[J].Left;
if ALeft + Width > Screen.Monitors.Left + Screen.Monitors.Width then
ALeft := Screen.Monitors.Left + Screen.Monitors.Width - Width;
ATop := Screen.Monitors.Top + Top - Screen.Monitors[J].Top;
if ATop + Height > Screen.Monitors.Top + Screen.Monitors.Height then
ATop := Screen.Monitors.Top + Screen.Monitors.Height - Height;
SetBounds(ALeft, ATop, Width, Height);
end;
end;
end;
end;


ZRY (1999-12-15 1:29:00)
简化一下:
//将一个窗体显示到指定的显示器上
procedure SetWindowToMonitor(Form: TCustomForm; //你想操作的窗体
MonitorIndex, //你想要显示窗体的显示
// 器索引, 0为主显示
// 器,1为第二显示器
Left, Top: Integer //窗体在显示器上的位置
);
begin
if not Assigned(Form) then Exit;
if MonitorIndex >= Screen.MonitorCount then Exit;
with Screen do
begin
Inc(Left, Monitors[MonitorIndex].Left);
Inc(Top, Monitors[MonitorIndex].Top);
end;
Form.SetBounds(Left, Top, Form.Width, Form.Height);
end;

<B>以上代码未测试过(我没条件,真羡慕你),希望能正常工作。</B>


老莫 (1999-12-16 17:39:00)
接受答案了.

老莫 (1999-12-16 17:42:00)
ZRY:我的环境也一般,只不过做管理员,设备调度起来方便些。
你的代码正确,多谢


ZRY的回答最终被接受。



来自:weiliu, 时间:2006-6-17 12:17:13, ID:3473767 | 编辑
话题287462的标题是: 双显卡.双显示器编程技术 (200分)
分类:非技术问题 力力 (2000-07-20 10:34:00)
本人最近用DELPHI5.0编写程序,其中需运用到一个技术,用一台主机加双显卡和双显示器
进行编程.需要实现在同一个程序中分屏显示,例如,在一个屏幕上显示一个FROM,同时在另一
个屏幕上显示另一个FROM.不知DELPHI是否支持此技术,若能,请问如何实现?谢谢!加急!!...
MY E-MAIL:LEIZL2000@YEAH.NET

www (2000-07-20 10:44:00)
为什么要编程???
win98已经可以做到了.
1.装好两个显卡,1个为主,一个为副
2.平时窗口只显示在主中,把其中一个窗口拖到主的右边缘,这个窗口会自动到副窗口中


中原问鼎 (2000-07-20 13:50:00)
win98支持双显卡,
在有双显卡时
如果monitor1 800*600
monitor2 800*600
monitor1 --main

form.left:>800就可以在monitor2显示了

wjiachun (2000-09-23 13:05:00)
多人接受答案了。
 
后退
顶部