Registriert seit: 3. Jan 2007
Ort: Dresden
3.443 Beiträge
Delphi 7 Enterprise
|
Re: Wer weis was "Screen.MonitorFromPoint" macht ?
16. Jan 2008, 13:57
Hast du TScreen.findmonitor?
Edit:Quatsch brauchst du ja nicht.
Mit Unit MultiMon
Delphi-Quellcode:
Function IsDisplayEdge(curPoint: TPoint): boolean;
Var
ret1, ret2, ret3, ret4: boolean;
Begin
ret1 := (MonitorFromPoint(Point(curPoint.X - 1, curPoint.Y), MONITOR_DEFAULTTONULL) = 0);
ret2 := (MonitorFromPoint(Point(curPoint.X + 1, curPoint.Y), MONITOR_DEFAULTTONULL) = 0);
ret3 := (MonitorFromPoint(Point(curPoint.X, curPoint.Y + 1), MONITOR_DEFAULTTONULL) = 0);
ret4 := (MonitorFromPoint(Point(curPoint.X, curPoint.Y - 1), MONITOR_DEFAULTTONULL) = 0);
result := (ret1 Or ret2 Or ret3 Or ret4);
End;
Oder nur über WinAPI:
Delphi-Quellcode:
var MonitorFromPoint:function(pt:TPoint;Flags:Cardinal):THandle stdcall=nil;
Function IsDisplayEdge2(curPoint: TPoint): boolean;
const MONITOR_DEFAULTTONULL=0;
Begin
if not assigned(MonitorFromPoint) then begin
result:=false;
@MonitorfromPoint:=getprocaddress(getmodulehandle('user32.dll'),'MonitorFromPoint');
if not assigned(MonitorFromPoint) then exit; //oder Fehler
end;
result := (MonitorFromPoint(Point(curPoint.X - 1, curPoint.Y), MONITOR_DEFAULTTONULL) = 0)
or (MonitorFromPoint(Point(curPoint.X + 1, curPoint.Y), MONITOR_DEFAULTTONULL) = 0)
or (MonitorFromPoint(Point(curPoint.X, curPoint.Y + 1), MONITOR_DEFAULTTONULL) = 0)
or (MonitorFromPoint(Point(curPoint.X, curPoint.Y - 1), MONITOR_DEFAULTTONULL) = 0);
End;
Dieser Beitrag ist für Jugendliche unter 18 Jahren nicht geeignet.
|
|
Zitat
|