delphi multi monitor

Pagina: 1
Acties:
  • 221 views sinds 30-01-2008
  • Reageer

  • erwink
  • Registratie: December 2000
  • Laatst online: 08-01 22:26
Hoi,

ik ben al even aan het googlen geweest maar ben er nog steeds niet uit.

Ik heb in mijn pc 2 video kaarten zitten.

Het programma dat ik aan het maken ben veresit dat 1 form op monitor 1 word weergegeven en form2 op moitor 2.

Na lang en veel zoeken ben ik er nog steeds niet uit hoe dit kan.

Heeft iemand een idee waar ik dit kan vinden? of het al kan en of er eventueel example's zijn?

Ik ben dit alles niet tegen gekomen en heb het tscreen component doorgenomen zonder suc6.

  • Erkens
  • Registratie: December 2001
  • Niet online

Erkens

Fotograaf

Na een paar seconden @ google kwam ik op de volgende pagina: http://www.elists.org/pip.../2002-January/018478.html
...and from the MS SDK help (http://msdn.microsoft.com/downloads/ and look under "Software development kits" for the Microsoft Platform SDK - warning, very very big download!) I'd say you may want to look into the following API calls:

EnumDisplayMonitors - Enumerates display monitors that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context.

This should be the one! Should give you a callback to the handle of each monitor when used as so:

EnumDisplayMonitors(nil, nil, MyInfoEnumProc, 0);

GetMonitorInfo - Retrieves information about a display monitor.
MonitorEnumProc - An application-defined callback function that is called by the EnumDisplayMonitors function.
MonitorFromPoint - Retrieves a handle to the display monitor that contains a specified point.
MonitorFromRect - Retrieves a handle to the display monitor that has the largest area of intersection with a specified rectangle.
MonitorFromWindow - Retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.

Hopefully that'll point you in the right direction :)
Misschien heb je er wat aan ;)

  • LordLarry
  • Registratie: Juli 2001
  • Niet online

LordLarry

Aut disce aut discede

Je kan de informatie over de verschillende monitoren achterhalen dmv Screen.Monitors[] en Screen.MonitorCount. Daar kun je vinden waar de monitoren beginnen en eindigen binnen de desktop. De locaties van je forms kun je daar op aanpassen. Vergeet ook niet de Position property van je Form om een scherm centraal op je desktop of scherm te zetten. En natuurlijk de DefaultMonitor property van je Form.

We adore chaos because we like to restore order - M.C. Escher


  • erwink
  • Registratie: December 2000
  • Laatst online: 08-01 22:26
Hoi alle,

bedankt het is gelukt

if Screen.MonitorCount>1 then
begin
Main.Position := poScreenCenter;
TKaraokeVieuwer(myform).Position := poScreenCenter;
Main.Top :=0;
Main.left :=0;
TKaraokeVieuwer(myform).top:=0;
TKaraokeVieuwer(myform).left:=main.width+1;
end
else
begin
Main.Position := poScreenCenter;
TKaraokeVieuwer(myform).Position := poScreenCenter;
Main.Top :=0;
Main.left :=0;
TKaraokeVieuwer(myform).top:=0;
TKaraokeVieuwer(myform).left:=0;
end;