[Lazarus] Last diff for MonitorCount

Alexey aaa5500 at ya.ru
Sun Mar 19 18:57:37 CET 2017


diff has 3 places of same (almost) text:


-    Result := nil;
+  if (MonitorHandle = 0) and (MonitorDefault = mdNull) then
+    Result := nil
+  else
+  begin
+    // the user expects some monitor but handle wasn't found -> the 
monitor list has probably changed
+    UpdateMonitors;
+    for i := 0 to MonitorCount - 1 do
+      if Monitors[i].Handle = MonitorHandle then
+        Exit(Monitors[i]);
+    RaiseGDBException('TScreen.MonitorFromWindow'); // internal error
+  end;

This is good to put to procedure with AErrorMsg: string.


-- 
Regards,
Alexey



More information about the Lazarus mailing list