Конференция "KOL" » Multi screen output
 
  • Jon © (07.02.08 17:05) [0]
    How can I force a KOL app to show on a second screen?
    Is there a feature such as TScreen as on the VCL?
  • lse (14.02.08 20:36) [1]
    Hi, use winapi to do this. or here's some code to start:

    unit UMultiMon;

    interface
    uses
         multimon,
         windows;
    type
      pmmlist = ^tmmlist;
      tmmlist = record
        mmlast : integer;
        hm : array[0..9] of hmonitor;
        rm : array[0..9] of trect;
      end;

    function MMGetMonitorCount : integer;
    function MMGetMonitorRect( n : integer ) : TRect;

    var
    MonitorCount : integer;

    implementation
    function MakeRect(left, top, width, height : integer ) : trect;
     begin
       Result.Left := left;
       Result.top := top;
       Result.Right := left + width;
       Result.bottom := top + height;
     end;

    var
    mm : tmmlist;

    function EnumMonitorsProc(hm: HMONITOR; dc: HDC; r: PRect; Data: Pointer): Boolean; stdcall;
     var
       m : pmmlist;
     begin
       m := pmmlist( Data );
       inc( m.mmlast );
       m.hm[m.mmlast] := hm;
       m.rm[m.mmlast] := r^;
       Result := True;
     end;

    function MMGetMonitorCount : integer;
      begin
        mm.mmlast := -1;
        EnumDisplayMonitors(0, nil, @EnumMonitorsProc, LongInt( @mm ));
        Result := mm.mmlast;
      end;
     
    function MMGetMonitorRect( n : integer ) : TRect;
      begin
       Result := MakeRect( 0, 0, 0, 0 );
       if (n > -1)and(n <= mm.mmlast ) then begin
            Result := mm.rm[n];
       end;
      end;
    initialization
     begin
      MonitorCount := MMGetMonitorCount;
     end;



    Use MMGetMonitorRect to get rect of other monitor and place your windows there.
  • Jon © (14.02.08 20:48) [2]
    Ah, the API's I was searching for, thank you very much indeed!
  • pibraady (02.03.08 09:02) [3]
    Today was a complete loss, but it's not important. I've just been letting everything wash over me lately. I haven't gotten much done these days.   Today was a loss, but that's how it is. I haven't gotten much done these days, but what can I say? I can't be bothered with anything recently. I've just been letting everything wash over me recently. Oh well. Pfft.   I haven't gotten anything done these days. I can't be bothered with anything recently, but what can I say? Today was a total loss. I just don't have anything to say lately. Eh.   Not much on my mind worth mentioning. I've basically been doing nothing. Today was a total loss. Whatever. I've just been staying at home doing nothing, but so it goes. Such is life.   Nothing exciting going on to speak of. Today was a complete loss, but shrug. I've just been staying at home not getting anything done. I've just been letting everything pass me by , but I don't care. I just don't have anything to say recently, but that's how it is. Such is life.  <a href=http://ireehiorendes.wizhoo.com/granny-slut.html> Granny Slut </a>
 
Конференция "KOL" » Multi screen output
Есть новые Нет новых   [134431   +15][b:0][p:0.001]