home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / MULTIMON.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  15KB  |  459 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 Multi-monitor support Unit                }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Inprise Corporation                 }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit MultiMon;
  14.  
  15. (*
  16.  * MultiMon unit provides access to the new MultiMonitor
  17.  * APIs provided in Win98 and NT5 and greater.  For
  18.  * backwards compatibility, the new APIs are stubbed out
  19.  * here for older Win32 OS systems.
  20.  *)
  21.  
  22. interface
  23.  
  24. uses Windows;
  25.  
  26. {$HPPEMIT '#include <multimon.h>' }
  27.  
  28. const
  29.   { GetSystemMetrics() codes }
  30.   SM_XVIRTUALSCREEN = 76;
  31.   {$EXTERNALSYM SM_XVIRTUALSCREEN}
  32.   SM_YVIRTUALSCREEN = 77;
  33.   {$EXTERNALSYM SM_YVIRTUALSCREEN}
  34.   SM_CXVIRTUALSCREEN = 78;
  35.   {$EXTERNALSYM SM_CXVIRTUALSCREEN}
  36.   SM_CYVIRTUALSCREEN = 79;
  37.   {$EXTERNALSYM SM_CYVIRTUALSCREEN}
  38.   SM_CMONITORS = 80;
  39.   {$EXTERNALSYM SM_CMONITORS}
  40.   SM_SAMEDISPLAYFORMAT = 81;
  41.   {$EXTERNALSYM SM_SAMEDISPLAYFORMAT}
  42.   SM_CMETRICS = 83;
  43.   {$EXTERNALSYM SM_CMETRICS}
  44.  
  45. type
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.   HMONITOR = type Integer;
  53.   {$EXTERNALSYM HMONITOR}
  54.  
  55. const
  56.   MONITOR_DEFAULTTONULL = $0;
  57.   {$EXTERNALSYM MONITOR_DEFAULTTONULL}
  58.   MONITOR_DEFAULTTOPRIMARY = $1;
  59.   {$EXTERNALSYM MONITOR_DEFAULTTOPRIMARY}
  60.   MONITOR_DEFAULTTONEAREST = $2;
  61.   {$EXTERNALSYM MONITOR_DEFAULTTONEAREST}
  62.   MONITORINFOF_PRIMARY = $1;
  63.   {$EXTERNALSYM MONITORINFOF_PRIMARY}
  64.  
  65. const
  66.   CCHDEVICENAME = 32;
  67.   {$EXTERNALSYM CCHDEVICENAME}
  68.  
  69. type
  70.   {$EXTERNALSYM tagMONITORINFOA}
  71.   tagMONITORINFOA = record
  72.     cbSize: DWORD;
  73.     rcMonitor: TRect;
  74.     rcWork: TRect;
  75.     dwFlags: DWORD;
  76.   end;
  77.   {$EXTERNALSYM tagMONITORINFOW}
  78.   tagMONITORINFOW = record
  79.     cbSize: DWORD;
  80.     rcMonitor: TRect;
  81.     rcWork: TRect;
  82.     dwFlags: DWORD;
  83.   end;
  84.   {$EXTERNALSYM tagMONITORINFO}
  85.   tagMONITORINFO = tagMONITORINFOA;
  86.   {$EXTERNALSYM MONITORINFOA}
  87.   MONITORINFOA = tagMONITORINFOA;
  88.   {$EXTERNALSYM MONITORINFOW}
  89.   MONITORINFOW = tagMONITORINFOW;
  90.   {$EXTERNALSYM MONITORINFO}
  91.   MONITORINFO = MONITORINFOA;
  92.   {$EXTERNALSYM LPMONITORINFOA}
  93.   LPMONITORINFOA = ^tagMONITORINFOA;
  94.   {$EXTERNALSYM LPMONITORINFOW}
  95.   LPMONITORINFOW = ^tagMONITORINFOW;
  96.   {$EXTERNALSYM LPMONITORINFO}
  97.   LPMONITORINFO = LPMONITORINFOA;
  98.   {$EXTERNALSYM PMonitorInfoA}
  99.   PMonitorInfoA = ^tagMONITORINFO;
  100.   {$EXTERNALSYM PMonitorInfoW}
  101.   PMonitorInfoW = ^tagMONITORINFO;
  102.   {$EXTERNALSYM PMonitorInfo}
  103.   PMonitorInfo = PMonitorInfoA;
  104.   {$EXTERNALSYM TMonitorInfoA}
  105.   TMonitorInfoA = tagMONITORINFO;
  106.   {$EXTERNALSYM TMonitorInfoW}
  107.   TMonitorInfoW = tagMONITORINFO;
  108.   {$EXTERNALSYM TMonitorInfo}
  109.   TMonitorInfo = TMonitorInfoA;
  110.  
  111.   {$EXTERNALSYM tagMONITORINFOEXA}
  112.   tagMONITORINFOEXA = record
  113.     cbSize: DWORD;
  114.     rcMonitor: TRect;
  115.     rcWork: TRect;
  116.     dwFlags: DWORD;
  117.     szDevice: array[0..CCHDEVICENAME] of AnsiChar;
  118.   end;
  119.   {$EXTERNALSYM tagMONITORINFOEXW}
  120.   tagMONITORINFOEXW = record
  121.     cbSize: DWORD;
  122.     rcMonitor: TRect;
  123.     rcWork: TRect;
  124.     dwFlags: DWORD;
  125.     szDevice: array[0..CCHDEVICENAME] of WideChar;
  126.   end;
  127.   {$EXTERNALSYM tagMONITORINFOEX}
  128.   tagMONITORINFOEX = tagMONITORINFOEXA;
  129.   {$EXTERNALSYM MONITORINFOEXA}
  130.   MONITORINFOEXA = tagMONITORINFOEXA;
  131.   {$EXTERNALSYM MONITORINFOEXW}
  132.   MONITORINFOEXW = tagMONITORINFOEXW;
  133.   {$EXTERNALSYM MONITORINFOEX}
  134.   MONITORINFOEX = MONITORINFOEXA;
  135.   {$EXTERNALSYM LPMONITORINFOEXA}
  136.   LPMONITORINFOEXA = ^tagMONITORINFOEXA;
  137.   {$EXTERNALSYM LPMONITORINFOEXW}
  138.   LPMONITORINFOEXW = ^tagMONITORINFOEXW;
  139.   {$EXTERNALSYM LPMONITORINFOEX}
  140.   LPMONITORINFOEX = LPMONITORINFOEXA;
  141.   {$EXTERNALSYM PMonitorInfoExA}
  142.   PMonitorInfoExA = ^tagMONITORINFOEX;
  143.   {$EXTERNALSYM PMonitorInfoExW}
  144.   PMonitorInfoExW = ^tagMONITORINFOEX;
  145.   {$EXTERNALSYM PMonitorInfoEx}
  146.   PMonitorInfoEx = PMonitorInfoExA;
  147.   {$EXTERNALSYM TMonitorInfoExA}
  148.   TMonitorInfoExA = tagMONITORINFOEX;
  149.   {$EXTERNALSYM TMonitorInfoExW}
  150.   TMonitorInfoExW = tagMONITORINFOEX;
  151.   {$EXTERNALSYM TMonitorInfoEx}
  152.   TMonitorInfoEx = TMonitorInfoExA;
  153.  
  154. {$EXTERNALSYM TMonitorEnumProc}
  155.   TMonitorEnumProc = function(hm: HMONITOR; dc: HDC; r: PRect; l: LPARAM): Boolean; stdcall;
  156. {$EXTERNALSYM TGetSystemMetrics}
  157.   TGetSystemMetrics = function(nIndex: Integer): Integer; stdcall;
  158. {$EXTERNALSYM TMonitorFromWindow}
  159.   TMonitorFromWindow = function(hWnd: HWND; dwFlags: DWORD): HMONITOR; stdcall;
  160. {$EXTERNALSYM TMonitorFromRect}
  161.   TMonitorFromRect = function(lprcScreenCoords: PRect; dwFlags: DWORD): HMONITOR; stdcall;
  162. {$EXTERNALSYM TMonitorFromPoint}
  163.   TMonitorFromPoint = function(ptScreenCoords: TPoint; dwFlags: DWORD): HMONITOR; stdcall;
  164. {$EXTERNALSYM TGetMonitorInfoA}
  165.   TGetMonitorInfoA = function(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfoA): Boolean; stdcall;
  166. {$EXTERNALSYM TGetMonitorInfoW}
  167.   TGetMonitorInfoW = function(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfoW): Boolean; stdcall;
  168.   {$EXTERNALSYM TGetMonitorInfo}
  169.   TGetMonitorInfo = TGetMonitorInfoA;
  170. {$EXTERNALSYM TEnumDisplayMonitors}
  171.   TEnumDisplayMonitors = function(hdc: HDC; lprcIntersect: PRect; lpfnEnumProc: TMonitorEnumProc;
  172.     lData: LPARAM): Boolean; stdcall;
  173.  
  174. var
  175.   {$EXTERNALSYM GetSystemMetrics}
  176.   GetSystemMetrics: TGetSystemMetrics;
  177.   {$EXTERNALSYM MonitorFromWindow}
  178.   MonitorFromWindow: TMonitorFromWindow; 
  179.   {$EXTERNALSYM MonitorFromRect}
  180.   MonitorFromRect: TMonitorFromRect; 
  181.   {$EXTERNALSYM MonitorFromPoint}
  182.   MonitorFromPoint: TMonitorFromPoint;
  183.   {$EXTERNALSYM GetMonitorInfoA}
  184.   {procedure}GetMonitorInfoA: TGetMonitorInfoA;
  185.   {$EXTERNALSYM GetMonitorInfoW}
  186.   {procedure}GetMonitorInfoW: TGetMonitorInfoW;
  187.   {$EXTERNALSYM GetMonitorInfo}
  188.   {procedure}GetMonitorInfo: TGetMonitorInfo;
  189.   {$EXTERNALSYM EnumDisplayMonitors}
  190.   EnumDisplayMonitors: TEnumDisplayMonitors;
  191.  
  192. implementation
  193.  
  194. type
  195.   TMultiMonApi = (mmGetSystemMetrics, mmMonitorFromWindow, mmMonitorFromRect,
  196.     mmMonitorFromPoint, mmGetMonitorInfo, mmGetMonitorInfoA, mmGetMonitorInfoW,
  197.     mmEnumDisplayMonitors);
  198.  
  199. const
  200.   xPRIMARY_MONITOR = HMONITOR($12340042);
  201.   sUser32 = 'USER32.DLL';
  202.  
  203. var
  204.   User32Dll: THandle;
  205.   InitApis: array [mmGetSystemMetrics..mmEnumDisplayMonitors] of Boolean;
  206.   MMAvailable: Boolean;
  207.  
  208. function InitAnApi(mmAPI: TMultiMonApi; ApiStub: Pointer; ApiName: string): Pointer;
  209. begin
  210.   Result := nil;
  211.   if not InitApis[mmApi] then
  212.   begin
  213.     if User32Dll <> 0 then
  214.     begin
  215.       if (mmAPI = mmGetSystemMetrics) and not MMAvailable then
  216.       begin
  217.         @GetMonitorInfo := InitAnApi(mmGetMonitorInfo, @GetMonitorInfo, 'GetMonitorInfoA');
  218.         if not MMAvailable then
  219.           ApiName := '';
  220.       end;
  221.       Result := GetProcAddress(User32Dll, PChar(ApiName))
  222.     end else Result := nil;
  223.     if not Assigned(Result) then
  224.       Result := ApiStub
  225.     else if (mmAPI <> mmGetSystemMetrics) then
  226.       MMAvailable := True;
  227.     InitApis[mmApi] := True;
  228.   end;
  229. end;
  230.  
  231. function _GetSystemMetrics(nIndex: Integer): Integer; stdcall;
  232. begin
  233.   if not InitApis[mmGetSystemMetrics] then
  234.   begin
  235.     @GetSystemMetrics := InitAnApi(mmGetSystemMetrics, @GetSystemMetrics, 'GetSystemMetrics');
  236.     Result := GetSystemMetrics(nIndex);
  237.     Exit;
  238.   end;
  239.  
  240.   Result := -1;
  241.   case nIndex of
  242.     SM_CMONITORS,
  243.     SM_SAMEDISPLAYFORMAT:
  244.       Result := 1;
  245.     SM_XVIRTUALSCREEN,
  246.     SM_YVIRTUALSCREEN:
  247.       Result := 0;
  248.     SM_CXVIRTUALSCREEN:
  249.       nIndex := SM_CXSCREEN;
  250.     SM_CYVIRTUALSCREEN:
  251.       nIndex := SM_CYSCREEN;
  252.   end;
  253.   if Result = -1 then
  254.     Result := Windows.GetSystemMetrics(nIndex);
  255. end;
  256.  
  257. function xMonitorFromRect(lprcScreenCoords: PRect; dwFlags: DWORD): HMONITOR; stdcall;
  258. begin
  259.   if not InitApis[mmMonitorFromRect] then
  260.   begin
  261.     @MonitorFromRect := InitAnApi(mmMonitorFromRect, @MonitorFromRect, 'MonitorFromRect');
  262.     Result := MonitorFromRect(lprcScreenCoords, dwFlags);
  263.     Exit;
  264.   end;
  265.  
  266.   Result := 0;
  267.   if Boolean(dwFlags and (MONITOR_DEFAULTTOPRIMARY or MONITOR_DEFAULTTONEAREST)) or
  268.     (lprcScreenCoords.Right > 0) and
  269.     (lprcScreenCoords.Bottom > 0) and
  270.     (lprcScreenCoords.Left < GetSystemMetrics(SM_CXSCREEN)) and
  271.     (lprcScreenCoords.Top < GetSystemMetrics(SM_CYSCREEN)) then
  272.       Result := xPRIMARY_MONITOR;
  273. end;
  274.  
  275. function xMonitorFromWindow(hWnd: HWND; dwFlags: DWORD): HMONITOR; stdcall;
  276. var
  277.   wp: TWindowPlacement;
  278. begin
  279.   if not InitApis[mmMonitorFromWindow] then
  280.   begin
  281.     @MonitorFromWindow := InitAnApi(mmMonitorFromWindow, @MonitorFromWindow, 'MonitorFromWindow');
  282.     Result := MonitorFromWindow(hWnd, dwFlags);
  283.     Exit;
  284.   end;
  285.  
  286.   if Boolean(dwFlags and (MONITOR_DEFAULTTOPRIMARY or MONITOR_DEFAULTTONEAREST)) then
  287.     Result := xPRIMARY_MONITOR
  288.   else
  289.   begin
  290.     if IsIconic(hWnd) then
  291.       GetWindowPlacement(hWnd, @wp)
  292.     else
  293.       GetWindowRect(hWnd, wp.rcNormalPosition);
  294.     Result := xMonitorFromRect(@wp.rcNormalPosition, dwFlags);
  295.   end
  296. end;
  297.  
  298. function xMonitorFromPoint(ptScreenCoords: TPoint; dwFlags: DWORD): HMONITOR; stdcall;
  299. begin
  300.   if not InitApis[mmMonitorFromPoint] then
  301.   begin
  302.     @MonitorFromPoint := InitAnApi(mmMonitorFromPoint, @MonitorFromPoint, 'MonitorFromPoint');
  303.     Result := MonitorFromPoint(ptScreenCoords, dwFlags);
  304.     Exit;
  305.   end;
  306.  
  307.   Result := 0;
  308.   if Boolean(dwFlags and (MONITOR_DEFAULTTOPRIMARY or MONITOR_DEFAULTTONEAREST)) or
  309.     (ptScreenCoords.X >= 0) and
  310.     (ptScreenCoords.X < GetSystemMetrics(SM_CXSCREEN)) and
  311.     (ptScreenCoords.Y >= 0 ) and
  312.     (ptScreenCoords.Y < GetSystemMetrics(SM_CYSCREEN)) then
  313.       Result := xPRIMARY_MONITOR;
  314. end;
  315.  
  316. function xGetMonitorInfoA(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfoA): Boolean; stdcall;
  317. var
  318.   rcWork: TRect;
  319. begin
  320.   if not InitApis[mmGetMonitorInfoA] then
  321.   begin
  322.     @GetMonitorInfoA := InitAnApi(mmGetMonitorInfoA, @GetMonitorInfoA, 'GetMonitorInfoA');
  323.     Result := GetMonitorInfoA(hMonitor, lpMonitorInfo);
  324.     Exit;
  325.   end;
  326.  
  327.   Result := False;
  328.   if (hMonitor = xPRIMARY_MONITOR) and (lpMonitorInfo <> nil) and
  329.     (lpMonitorInfo.cbSize >= DWORD(SizeOf(TMonitorInfo))) and
  330.     SystemParametersInfo (SPI_GETWORKAREA, 0, @rcWork, 0) then
  331.     begin
  332.       lpMonitorInfo.rcMonitor.Left := 0;
  333.       lpMonitorInfo.rcMonitor.Top := 0;
  334.       lpMonitorInfo.rcMonitor.Right := GetSystemMetrics(SM_CXSCREEN);
  335.       lpMonitorInfo.rcMonitor.Bottom := GetSystemMetrics(SM_CYSCREEN);
  336.       lpMonitorInfo.rcWork := rcWork;
  337.       lpMonitorInfo.dwFlags := MONITORINFOF_PRIMARY;
  338.       if (lpMonitorInfo.cbSize >= DWORD(SizeOf(TMonitorInfoEx))) then
  339.         lstrcpy(PMonitorInfoEx(lpMonitorInfo).szDevice, 'DISPLAY'); // do not localize
  340.       Result := True;
  341.     end;
  342. end;
  343. function xGetMonitorInfoW(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfoW): Boolean; stdcall;
  344. var
  345.   rcWork: TRect;
  346. begin
  347.   if not InitApis[mmGetMonitorInfoW] then
  348.   begin
  349.     @GetMonitorInfoW := InitAnApi(mmGetMonitorInfoW, @GetMonitorInfoW, 'GetMonitorInfoW');
  350.     Result := GetMonitorInfoW(hMonitor, lpMonitorInfo);
  351.     Exit;
  352.   end;
  353.  
  354.   Result := False;
  355.   if (hMonitor = xPRIMARY_MONITOR) and (lpMonitorInfo <> nil) and
  356.     (lpMonitorInfo.cbSize >= DWORD(SizeOf(TMonitorInfo))) and
  357.     SystemParametersInfo (SPI_GETWORKAREA, 0, @rcWork, 0) then
  358.     begin
  359.       lpMonitorInfo.rcMonitor.Left := 0;
  360.       lpMonitorInfo.rcMonitor.Top := 0;
  361.       lpMonitorInfo.rcMonitor.Right := GetSystemMetrics(SM_CXSCREEN);
  362.       lpMonitorInfo.rcMonitor.Bottom := GetSystemMetrics(SM_CYSCREEN);
  363.       lpMonitorInfo.rcWork := rcWork;
  364.       lpMonitorInfo.dwFlags := MONITORINFOF_PRIMARY;
  365.       if (lpMonitorInfo.cbSize >= DWORD(SizeOf(TMonitorInfoEx))) then
  366.         lstrcpy(PMonitorInfoEx(lpMonitorInfo).szDevice, 'DISPLAY'); // do not localize
  367.       Result := True;
  368.     end;
  369. end;
  370. function xGetMonitorInfo(hMonitor: HMONITOR; lpMonitorInfo: PMonitorInfo): Boolean; stdcall;
  371. var
  372.   rcWork: TRect;
  373. begin
  374.   if not InitApis[mmGetMonitorInfo] then
  375.   begin
  376.     @GetMonitorInfo := InitAnApi(mmGetMonitorInfo, @GetMonitorInfo, 'GetMonitorInfo');
  377.     Result := GetMonitorInfo(hMonitor, lpMonitorInfo);
  378.     Exit;
  379.   end;
  380.  
  381.   Result := False;
  382.   if (hMonitor = xPRIMARY_MONITOR) and (lpMonitorInfo <> nil) and
  383.     (lpMonitorInfo.cbSize >= DWORD(SizeOf(TMonitorInfo))) and
  384.     SystemParametersInfo (SPI_GETWORKAREA, 0, @rcWork, 0) then
  385.     begin
  386.       lpMonitorInfo.rcMonitor.Left := 0;
  387.       lpMonitorInfo.rcMonitor.Top := 0;
  388.       lpMonitorInfo.rcMonitor.Right := GetSystemMetrics(SM_CXSCREEN);
  389.       lpMonitorInfo.rcMonitor.Bottom := GetSystemMetrics(SM_CYSCREEN);
  390.       lpMonitorInfo.rcWork := rcWork;
  391.       lpMonitorInfo.dwFlags := MONITORINFOF_PRIMARY;
  392.       if (lpMonitorInfo.cbSize >= DWORD(SizeOf(TMonitorInfoEx))) then
  393.         lstrcpy(PMonitorInfoEx(lpMonitorInfo).szDevice, 'DISPLAY'); // do not localize
  394.       Result := True;
  395.     end;
  396. end;
  397.  
  398. function xEnumDisplayMonitors(hdcOptionalForPainting: HDC; lprcEnumMonitorsThatIntersect: PRect;
  399.     lpfnEnumProc: TMonitorEnumProc; dwData: LPARAM): Boolean; stdcall;
  400. var
  401.   rcLimit, rcClip: TRect;
  402.   ptOrg: TPoint;
  403.   ClipBox: Integer;
  404. begin
  405.   if not InitApis[mmEnumDisplayMonitors] then
  406.   begin
  407.     @EnumDisplayMonitors := InitAnApi(mmEnumDisplayMonitors, @EnumDisplayMonitors, 'EnumDisplayMonitors');
  408.     Result := EnumDisplayMonitors(hdcOptionalForPainting, lprcEnumMonitorsThatIntersect, lpfnEnumProc, dwData);
  409.     Exit;
  410.   end;
  411.  
  412.   Result := False;
  413.   if not Assigned(lpfnEnumProc) then Exit;
  414.  
  415.   rcLimit.Left := 0;
  416.   rcLimit.Top := 0;
  417.   rcLimit.Right := GetSystemMetrics(SM_CXSCREEN);
  418.   rcLimit.Bottom := GetSystemMetrics(SM_CYSCREEN);
  419.  
  420.   if hdcOptionalForPainting <> 0 then
  421.   begin
  422.     ClipBox := GetClipBox(hdcOptionalForPainting, rcClip);
  423.     if not GetDCOrgEx(hdcOptionalForPainting, ptOrg) then Exit;
  424.     OffsetRect(rcLimit, -ptOrg.x, -ptOrg.y);
  425.     if not (IntersectRect(rcLimit, rcLimit, rcClip) and
  426.       (lprcEnumMonitorsThatIntersect = nil) or
  427.       IntersectRect(rcLimit, rcLimit, lprcEnumMonitorsThatIntersect^)) then
  428.       begin
  429.         if ClipBox = NULLREGION then Result := True;
  430.         Exit;
  431.       end;
  432.    end else
  433.      if (lprcEnumMonitorsThatintersect <> nil) and
  434.        (not IntersectRect(rcLimit, rcLimit, lprcEnumMonitorsThatIntersect^)) then
  435.        begin
  436.          Result := True;
  437.          Exit;
  438.        end;
  439.    Result := lpfnEnumProc( xPRIMARY_MONITOR, hdcOptionalForPainting, @rcLimit, dwData);
  440. end;
  441.  
  442. procedure InitMultiMonStubs;
  443. begin
  444.   User32Dll := GetModuleHandle(sUser32);
  445.   @GetSystemMetrics := @_GetSystemMetrics;
  446.   @MonitorFromWindow := @xMonitorFromWindow;
  447.   @MonitorFromRect := @xMonitorFromRect;
  448.   @MonitorFromPoint := @xMonitorFromPoint;
  449.   {procedure}@GetMonitorInfoA := @xGetMonitorInfoA;
  450.   {procedure}@GetMonitorInfoW := @xGetMonitorInfoW;
  451.   {procedure}@GetMonitorInfo := @xGetMonitorInfo;
  452.   @EnumDisplayMonitors := @xEnumDisplayMonitors;
  453. end;
  454.  
  455. initialization
  456.   InitMultiMonStubs;
  457.  
  458. end.
  459.