Solo estaba dando la idea
, gracias por complicarme la existencia
(En serio, tengo este código por aquí de hace tiempo, compilable en delphi 6)
Código Delphi
[-]
procedure TForm1.Button1Click(Sender: TObject);
var m:Tmonitor;
i:Integer;
begin
Memo1.Clear;
for i:=0 to Screen.MonitorCount-1 do
begin
m := Screen.Monitors[i];
with Memo1.Lines do
begin
Add('Monitor Nº: '+IntToStr(m.MonitorNum)+ ' IsPrimary : '+ BoolToStr(m.Primary,True));
Add('Dimensiones estandard');
Add(' Left '+ IntToStr(m.Left));
Add(' Top '+ IntToStr(m.Top));
Add(' Width '+ IntToStr(m.width));
Add(' Height '+ IntToStr(m.height));
Add('BoundsRect');
Add(' Left '+ IntToStr(m.BoundsRect.Left));
Add(' Top '+ IntToStr(m.BoundsRect.Top));
Add(' Right '+ IntToStr(m.BoundsRect.Right));
Add(' Bottom '+ IntToStr(m.BoundsRect.Bottom));
Add('WorkareaRect');
Add(' Left '+ IntToStr(m.WorkareaRect.Left));
Add(' Top '+ IntToStr(m.WorkareaRect.Top));
Add(' Right '+ IntToStr(m.WorkareaRect.Right));
Add(' Bottom '+ IntToStr(m.WorkareaRect.Bottom));
Add('');
end;
end;
Teniendo el segundo monitor a la derecha del principal, ambos a 1024x768, obtengo estos resultados:
Código:
Monitor Nº: 0 IsPrimary : True
Dimensiones estandard
Left 0
Top 0
Width 1024
Height 768
BoundsRect
Left 0
Top 0
Right 1024
Bottom 768
WorkareaRect
Left 0
Top 0
Right 1024
Bottom 708 (mi barra de tareas tiene 60 pixels de alta,
la configuración estandar son 30 pixels de alta)
Monitor Nº: 1 IsPrimary : False
Dimensiones estandard
Left 1024 (claro, está a la derecha del monitor 0)
Top 0 (alineado horizontalmente con el monitor 0)
Width 1024 (resolución de esa pantalla)
Height 768 (resolución de esa pantalla)
BoundsRect
Left 1024 (Left considerando el monitor 0)
Top 0
Right 2048 (Right del monitor 1, considerando el ancho del monitor 0)
Bottom 768
WorkareaRect
Left 1024
Top 0
Right 2048
Bottom 768 (la barra de tareas solo está en el monitor 0, en el monitor 1 no hay)
Dobles Saludos