GetMonitorsInfo - please help update the database lazarus / 39-Graphics ---------------------------------------------------------------------- domasz · 2022-11-12 12:27 With help from the forum users I created a small library to get PPI, resolutions and diameters of monitors. I created a Github repository for the library (MIT licence): https://github.com/PascalVault/GetMonitorsInfo Monitors also return a 3-letter manufacturer code. I used the list from: https://uefi.org/pnp_id_list which is supposed to be an official list of all 3-letter codes but I noticed it lacks many companies so I started adding them manually. If you have a few seconds please download the sample project: https://github.com/PascalVault/GetMonitorsInfo run it and paste here contents of Memo1 if: 1) returned values are not valid for you OR 2) instead of full manufacturer name you only see 3-letter code The library works only on Windows since it grabs EDID data from the Registry. ---------------------------------------------------------------------- kirchfritz · 2022-11-12 18:16 This is my HP-Notebook-Monitor: Monitor: #0 Resolution: 1920 x 1080 px Size: 34,40 x 19,30 cm Diag: 15,53 inch PPI: 141,86 Dot Pitch: 0,18 mm Aspect Ratio: 16:9 (1,78:1) Year: 2017 Manufacturer: DO NOT USE - AUO PNP: AUO38ED ----------- ---------------------------------------------------------------------- domasz · 2022-11-12 20:42 Quote from: kirchfritz on November 12, 2022, 07:16:04 pmManufacturer: DO NOT USE - AUO Thanks! That's a weird one. I updated the code. ---------------------------------------------------------------------- wp · 2022-11-12 22:44 Just cloned your repo and noticed that it does not compile due to missing closing string quotes in the company list at 'AUO'. ---------------------------------------------------------------------- sstvmaster · 2022-11-13 00:01 Laptop Lenovo: Monitor: #0 Resolution: 1920 x 1080 px Size: 34,40 x 19,40 cm Diag: 15,55 inch PPI: 141,68 Dot Pitch: 0,18 mm Aspect Ratio: 16:9 (1,77:1) Year: 2018 Manufacturer: BOE PNP: BOE0812 ----------- ---------------------------------------------------------------------- Martin_fr · 2022-11-13 00:05 Quote from: domasz on November 12, 2022, 01:27:51 pmMonitors also return a 3-letter manufacturer code. I used the list from: https://uefi.org/pnp_id_list which is supposed to be an official list of all 3-letter codes but I noticed it lacks many companies so I started adding them manually. There is another list (probably many...) https://github.com/linuxhw/EDID IT has the BOE08112 https://github.com/linuxhw/EDID/blob/master/Digita l/BOE/BOE0812/27B7A857515D ---------------------------------------------------------------------- KodeZwerg · 2022-11-13 02:29 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program MdTo; {$APPTYPE CONSOLE}{$R *.res} uses  Windows, SysUtils, Classes, uStreamIO; type  TInfo = packed record    Short,    Full: string;  end;  TInfos = array of TInfo; function AddRecord(var AInfos: TInfos; const AShort, AFull: string): Boolean;var  Len: Integer;  i: Integer;begin  Len := Length(AInfos);  Result := False;  for i := Low(AInfos) to High(AInfos) do    if ((AInfos[i].Short = AShort) and (AInfos[i].Full = AFull)) then      Exit;  SetLength(AInfos, Succ(Len));  AInfos[Len].Short := AShort;  AInfos[Len].Full := AFull;  Result := Len < Length(AInfos);end; function ConvertList(const AFilename: string; var AInfos: TInfos): Boolean;var  stream: TFileStream;  F: Textfile;  s: String;  i: Integer;  cnt: Integer;  GotData: Boolean;  b1: Boolean;  s1, s2: string;Begin  Result := False;  stream := TFilestream.Create(AFilename, fmOpenRead or fmShareDenyNone );  try    AssignStream(F, stream);    Reset(F);    try      repeat        ReadLn(F, s);        cnt := 0;        b1 := False;        s1 := '';        s2 := '';        GotData := False;      if (Pos('|', s) = 1) then          for i := 1 to Length(s) do          begin              if s[i] = '|' then                inc(cnt);            if ((not b1) and (s[i] <> '|')) then                s1 := s1 + s[i];              if cnt > 1 then                b1 := True;            if (b1 and (s[i] <> '|') and (Length(s2) <= 3)) then              s2 := s2 + s[i];              if cnt >= 3 then                begin                  GotData := ((s1 <> '') or (s2 <> ''));                Break;                end;            end;        if GotData then          begin            s1 := Trim(s1);            s2 := Trim(s2);            if ((s2 <> 'Mod') and (s2 <> '----')) then            AddRecord(AInfos, s2, s1);          end;      until EOF(F);    finally      CloseFile(F);    end;  finally    stream.Free;    Result := (Length(AInfos) > 0)  end;end; function WriteList(const AFilename: string; const AInfos: TInfos): Boolean;begin end; var  sl: TInfos;  fn: string;  i: Integer;begin  WriteLn('MonitorInfo extractor by KodeZwerg.');   SetLength(sl, 0);  fn := 'AnalogDisplay.md';  if ConvertList(ExtractFilePath(ParamStr(0)) + fn, sl) then    begin      WriteLn(fn, ' successful read ', Length(sl), ' entries.');      for i := Low(sl) to High(sl) do        WriteLn('[', sl[i].Short, '] - [', sl[i].Full, ']');      WriteLn(fn, ' successful read ', Length(sl), ' entries.');    end;   SetLength(sl, 0);  fn := 'DigitalDisplay.md';  if ConvertList(ExtractFilePath(ParamStr(0)) + fn, sl) then    begin    WriteLn(fn, ' successful read ', Length(sl), ' entries.');      for i := Low(sl) to High(sl) do        WriteLn('[', sl[i].Short, '] - [', sl[i].Full, ']');      WriteLn(fn, ' successful read ', Length(sl), ' entries.');    end;  ReadLn;end. Here is a template to convert the files from https://raw.githubusercontent.com/linuxhw/EDID/master/AnalogDisplay.md and https://raw.githubusercontent.com/linuxhw/EDID/master/DigitalDisplay.m d into the needed record format. A write-to-file is missing since I am not that happy with the results as you can see when you execute the app. (Basic Idea was to switch from internal usage to .inc file format for the class string definitions.) ---------------------------------------------------------------------- domasz · 2022-11-13 12:08 Quote from: Martin_fr on November 13, 2022, 01:05:22 amThere is another list (probably many...) https://github.com/linuxhw/EDID Thanks! I looked for other lists but they were just copies of the official one. I even e-mailed the guys behind the official one but I haven't heard from them yet. ---------------------------------------------------------------------- domasz · 2022-11-13 12:10 Quote from: KodeZwerg on November 13, 2022, 03:29:52 amHere is a template to convert the files from https://raw.githubusercontent.com/linuxhw/EDID/master/AnalogDisplay.md and https://raw.githubusercontent.com/linuxhw/EDID/master/DigitalDisplay.m d into the needed record format. Thank you! I updated the code and now there are 2674 companies. ---------------------------------------------------------------------- domasz · 2022-11-13 13:04 Quote from: wp on November 12, 2022, 11:44:44 pmJust cloned your repo and noticed that it does not compile due to missing closing string quotes in the company list at 'AUO'. Thanks, fixed. Quote from: sstvmaster on November 13, 2022, 01:01:23 amManufacturer: BOE PNP: BOE0812 ----------- Thank you! Added to the DB as "BOE Technology Group Co., Ltd" ---------------------------------------------------------------------- KodeZwerg · 2022-11-14 00:53 Updated, sorry I missed your manual changes, in attached archive you have all the important files. Whats changed: Renamed my tool into "MonitorListImport". Added support to add all above named sources to be converted. Added save/generate new "uMonitorInfo.inc" file feature. removed from original unit the complete string company 3 digit code stuff and replaced with a simple {$I} (now source is also better readable, less scrolling...) Now updates are more easy to handle is my thinking (outside of code, in its own file), I would like to add a 4th list called "Overwrite.txt", for manual changes that are not included in above "master"-files, to keep list updated after generated from scratch. Thanks domasz for inventing. ---------------------------------------------------------------------- domasz · 2022-11-14 08:37 Quote from: KodeZwerg on November 14, 2022, 01:53:07 amUpdated, sorry I missed your manual changes, in attached archive you have all the important files. Your database is not sorted so it won't work properly. There is a binary search function which requires sorted data. https://github.com/PascalVault/GetMonitorsInfo/blob/main/uMonitorInfo. pas Also syncing automatically with the Linux EDID repo makes little sense because the repo is of poor quality and I'm going to manually update everything from the repo. ---------------------------------------------------------------------- KodeZwerg · 2022-11-14 10:52 Quote from: domasz on November 14, 2022, 09:37:30 amYour database is not sorted so it won't work properly. There is a binary search function which requires sorted data. Updated again. Whats new? - output from all 3 supplier files are now sorted - fixed little string bugs that the original lists had (html text attributes) - fixed a small bug of me where my app created, for unknown reason, longer than 3 chars identifiers Quote from: domasz on November 14, 2022, 09:37:30 amAlso syncing automatically with the Linux EDID repo makes little sense because the repo is of poor quality and I'm going to manually update everything from the repo. More is better, no? And for your manual update, exact for that I told I would need a 4th file that can be loaded in as first file in the converter app... Okies, enjoy or delete, from my side its looking final now to me (the converter app) ---------------------------------------------------------------------- KodeZwerg · 2022-11-14 11:02 And a small note, your current list has exemplary as first entry: (Short: '"VQ'; Full: 'Vision Quest'), what is incorrect, it should be (Short: 'VQ@'; Full: 'Vision Quest'), (my current converter fix all errors like such.) ---------------------------------------------------------------------- howardpc · 2022-12-20 07:48 I attach a project which has some small changes and optimisations, removing redundant code, and cleaning up the Manufacturer database (removing some obvious typos, lowercase codes etc.) This is now recast as an enormous jump table, giving almost instantaneous lookup for the 3-character manufacturer code. Note that as in earlier offerings this is Windows-only code, dependent on Registry entries being correctly populated. ---------------------------------------------------------------------- KodeZwerg · 2022-12-20 09:04 Maybe it is useful to this project, here is another windows way of how to gather information: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  TDEVMODES = array of TDEVMODEW;  TCurrentMonitor = packed record    DRIVERVERSION,    TECHNOLOGY,    DT_PLOTTER,    DT_RASDISPLAY,    DT_RASPRINTER,    DT_RASCAMERA,    DT_CHARSTREAM,    DT_METAFILE,    DT_DISPFILE,    HORZSIZE,    VERTSIZE,    HORZRES,    VERTRES,    LOGPIXELSX,    LOGPIXELSY,    BITSPIXEL,    PLANES,    NUMBRUSHES,    NUMPENS,    NUMFONTS,    NUMCOLORS,    ASPECTX,    ASPECTY,    ASPECTXY,    PDEVICESIZE,    CLIPCAPS,    SIZEPALETTE,    NUMRESERVED,    COLORRES,    VREFRESH,    DESKTOPHORZRES,    DESKTOPVERTRES,    BLTALIGNMENT,    RASTERCAPS,    RC_BANDING,    RC_BITBLT,    RC_BITMAP64,    RC_DI_BITMAP,    RC_DIBTODEV,    RC_FLOODFILL,    RC_GDI20_OUTPUT,    RC_PALETTE,    RC_SCALING,    RC_STRETCHBLT,    RC_STRETCHDIB,    CURVECAPS,    CC_NONE,    CC_CIRCLES,    CC_PIE,    CC_CHORD,    CC_ELLIPSES,    CC_WIDE,    CC_STYLED,    CC_WIDESTYLED,    CC_INTERIORS,    CC_ROUNDRECT,    LINECAPS,    LC_NONE,    LC_POLYLINE,    LC_MARKER,    LC_POLYMARKER,    LC_WIDE,    LC_STYLED,    LC_WIDESTYLED,    LC_INTERIORS,    POLYGONALCAPS,    PC_NONE,    PC_POLYGON,    PC_RECTANGLE,    PC_WINDPOLYGON,    PC_SCANLINE,    PC_WIDE,    PC_STYLED,    PC_WIDESTYLED,    PC_INTERIORS,    TEXTCAPS,    TC_OP_CHARACTER,    TC_OP_STROKE,    TC_CP_STROKE,    TC_CR_90,    TC_CR_ANY,    TC_SF_X_YINDEP,    TC_SA_DOUBLE,    TC_SA_INTEGER,    TC_SA_CONTIN,  TC_EA_DOUBLE,    TC_IA_ABLE,    TC_UA_ABLE,    TC_SO_ABLE,    TC_RA_ABLE,    TC_VA_ABLE,    TC_RESERVED,    TC_SCROLLBLT,    PC_PATHS: LongInt;  end;Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetMonitorInfo(var DevModes: TDEVMODES; var CurMon: TCurrentMonitor): Boolean;var  DC: THandle;  ModeNum: DWORD;  DM: TDEVMODEW;begin  Result := False;  DC := GetDC(Handle);  if ((DC <> 0) and (DC <> INVALID_HANDLE_VALUE)) then    begin      CurMon.DRIVERVERSION := GetDeviceCaps(DC, DRIVERVERSION);      CurMon.TECHNOLOGY := GetDeviceCaps(DC, TECHNOLOGY);      CurMon.DT_PLOTTER := GetDeviceCaps(DC, DT_PLOTTER);      CurMon.DT_RASDISPLAY := GetDeviceCaps(DC, DT_RASDISPLAY);      CurMon.DT_RASPRINTER := GetDeviceCaps(DC, DT_RASPRINTER);      CurMon.DT_RASCAMERA := GetDeviceCaps(DC, DT_RASCAMERA);      CurMon.DT_CHARSTREAM := GetDeviceCaps(DC, DT_CHARSTREAM);      CurMon.DT_METAFILE := GetDeviceCaps(DC, DT_METAFILE);      CurMon.DT_DISPFILE := GetDeviceCaps(DC, DT_DISPFILE);      CurMon.HORZSIZE := GetDeviceCaps(DC, HORZSIZE);      CurMon.VERTSIZE := GetDeviceCaps(DC, VERTSIZE);      CurMon.HORZRES := GetDeviceCaps(DC, HORZRES);      CurMon.VERTRES := GetDeviceCaps(DC, VERTRES);      CurMon.LOGPIXELSX := GetDeviceCaps(DC, LOGPIXELSX);    CurMon.LOGPIXELSY := GetDeviceCaps(DC, LOGPIXELSY);      CurMon.BITSPIXEL := GetDeviceCaps(DC, BITSPIXEL);      CurMon.PLANES := GetDeviceCaps(DC, PLANES);      CurMon.NUMBRUSHES := GetDeviceCaps(DC, NUMBRUSHES);      CurMon.NUMPENS := GetDeviceCaps(DC, NUMPENS);      CurMon.NUMFONTS := GetDeviceCaps(DC, NUMFONTS);      CurMon.NUMCOLORS := GetDeviceCaps(DC, NUMCOLORS);    CurMon.ASPECTX := GetDeviceCaps(DC, ASPECTX);      CurMon.ASPECTY := GetDeviceCaps(DC, ASPECTY);      CurMon.ASPECTXY := GetDeviceCaps(DC, ASPECTXY);      CurMon.PDEVICESIZE := GetDeviceCaps(DC, PDEVICESIZE);      CurMon.CLIPCAPS := GetDeviceCaps(DC, CLIPCAPS);      CurMon.SIZEPALETTE := GetDeviceCaps(DC, SIZEPALETTE);      CurMon.NUMRESERVED := GetDeviceCaps(DC, NUMRESERVED);      CurMon.COLORRES := GetDeviceCaps(DC, COLORRES);      CurMon.VREFRESH := GetDeviceCaps(DC, VREFRESH);      CurMon.DESKTOPHORZRES := GetDeviceCaps(DC, DESKTOPHORZRES);      CurMon.DESKTOPVERTRES := GetDeviceCaps(DC, DESKTOPVERTRES);      CurMon.BLTALIGNMENT := GetDeviceCaps(DC, BLTALIGNMENT);      CurMon.RASTERCAPS := GetDeviceCaps(DC, RASTERCAPS);      CurMon.RC_BANDING := GetDeviceCaps(DC, RC_BANDING);      CurMon.RC_BITBLT := GetDeviceCaps(DC, RC_BITBLT);      CurMon.RC_BITMAP64 := GetDeviceCaps(DC, RC_BITMAP64);      CurMon.RC_DI_BITMAP := GetDeviceCaps(DC, RC_DI_BITMAP);      CurMon.RC_DIBTODEV := GetDeviceCaps(DC, RC_DIBTODEV);      CurMon.RC_FLOODFILL := GetDeviceCaps(DC, RC_FLOODFILL);      CurMon.RC_GDI20_OUTPUT := GetDeviceCaps(DC, RC_GDI20_OUTPUT);      CurMon.RC_PALETTE := GetDeviceCaps(DC, RC_PALETTE);      CurMon.RC_SCALING := GetDeviceCaps(DC, RC_SCALING);      CurMon.RC_STRETCHBLT := GetDeviceCaps(DC, RC_STRETCHBLT);      CurMon.RC_STRETCHDIB := GetDeviceCaps(DC, RC_STRETCHDIB);      CurMon.CURVECAPS := GetDeviceCaps(DC, CURVECAPS);      CurMon.CC_NONE := GetDeviceCaps(DC, CC_NONE);      CurMon.CC_CIRCLES := GetDeviceCaps(DC, CC_CIRCLES);    CurMon.CC_PIE := GetDeviceCaps(DC, CC_PIE);      CurMon.CC_CHORD := GetDeviceCaps(DC, CC_CHORD);      CurMon.CC_ELLIPSES := GetDeviceCaps(DC, CC_ELLIPSES);      CurMon.CC_WIDE := GetDeviceCaps(DC, CC_WIDE);      CurMon.CC_STYLED := GetDeviceCaps(DC, CC_STYLED);      CurMon.CC_WIDESTYLED := GetDeviceCaps(DC, CC_WIDESTYLED);      CurMon.CC_INTERIORS := GetDeviceCaps(DC, CC_INTERIORS);      CurMon.CC_ROUNDRECT := GetDeviceCaps(DC, CC_ROUNDRECT);      CurMon.LINECAPS := GetDeviceCaps(DC, LINECAPS);    CurMon.LC_NONE := GetDeviceCaps(DC, LC_NONE);      CurMon.LC_POLYLINE := GetDeviceCaps(DC, LC_POLYLINE);      CurMon.LC_MARKER := GetDeviceCaps(DC, LC_MARKER);      CurMon.LC_POLYMARKER := GetDeviceCaps(DC, LC_POLYMARKER);      CurMon.LC_WIDE := GetDeviceCaps(DC, LC_WIDE);      CurMon.LC_STYLED := GetDeviceCaps(DC, LC_STYLED);      CurMon.LC_WIDESTYLED := GetDeviceCaps(DC, LC_WIDESTYLED);      CurMon.LC_INTERIORS := GetDeviceCaps(DC, LC_INTERIORS);      CurMon.POLYGONALCAPS := GetDeviceCaps(DC, POLYGONALCAPS);      CurMon.PC_NONE := GetDeviceCaps(DC, PC_NONE);      CurMon.PC_POLYGON := GetDeviceCaps(DC, PC_POLYGON);      CurMon.PC_RECTANGLE := GetDeviceCaps(DC, PC_RECTANGLE);      CurMon.PC_WINDPOLYGON := GetDeviceCaps(DC, PC_WINDPOLYGON);      CurMon.PC_SCANLINE := GetDeviceCaps(DC, PC_SCANLINE);      CurMon.PC_WIDE := GetDeviceCaps(DC, PC_WIDE);      CurMon.PC_STYLED := GetDeviceCaps(DC, PC_STYLED);      CurMon.PC_WIDESTYLED := GetDeviceCaps(DC, PC_WIDESTYLED);      CurMon.PC_INTERIORS := GetDeviceCaps(DC, PC_INTERIORS);      CurMon.TEXTCAPS := GetDeviceCaps(DC, TEXTCAPS);    CurMon.TC_OP_CHARACTER := GetDeviceCaps(DC, TC_OP_CHARACTER);      CurMon.TC_OP_STROKE := GetDeviceCaps(DC, TC_OP_STROKE);      CurMon.TC_CP_STROKE := GetDeviceCaps(DC, TC_CP_STROKE);      CurMon.TC_CR_90 := GetDeviceCaps(DC, TC_CR_90);      CurMon.TC_CR_ANY := GetDeviceCaps(DC, TC_CR_ANY);      CurMon.TC_SF_X_YINDEP := GetDeviceCaps(DC, TC_SF_X_YINDEP);      CurMon.TC_SA_DOUBLE := GetDeviceCaps(DC, TC_SA_DOUBLE);      CurMon.TC_SA_INTEGER := GetDeviceCaps(DC, TC_SA_INTEGER);      CurMon.TC_SA_CONTIN := GetDeviceCaps(DC, TC_SA_CONTIN);      CurMon.TC_EA_DOUBLE := GetDeviceCaps(DC, TC_EA_DOUBLE);      CurMon.TC_IA_ABLE := GetDeviceCaps(DC, TC_IA_ABLE);      CurMon.TC_UA_ABLE := GetDeviceCaps(DC, TC_UA_ABLE);      CurMon.TC_SO_ABLE := GetDeviceCaps(DC, TC_SO_ABLE);      CurMon.TC_RA_ABLE := GetDeviceCaps(DC, TC_RA_ABLE);      CurMon.TC_VA_ABLE := GetDeviceCaps(DC, TC_VA_ABLE);      CurMon.TC_RESERVED := GetDeviceCaps(DC, TC_RESERVED);      CurMon.TC_SCROLLBLT := GetDeviceCaps(DC, TC_SCROLLBLT);      CurMon.PC_PATHS := GetDeviceCaps(DC, PC_PATHS);      ReleaseDC(Handle, DC);    end;  SetLength(DevModes, Pred(High(WORD)));  for ModeNum := 0 to Pred(High(WORD)) do    begin      if (not EnumDisplaySettingsW(nil, ModeNum, DM)) then        Break;      DevModes[ModeNum].dmBitsPerPel := DM.dmBitsPerPel;      DevModes[ModeNum].dmCollate := DM.dmCollate;      DevModes[ModeNum].dmColor := DM.dmColor;      DevModes[ModeNum].dmCopies := DM.dmCopies;      DevModes[ModeNum].dmDefaultSource := DM.dmDefaultSource;      DevModes[ModeNum].dmDeviceName := DM.dmDeviceName;      DevModes[ModeNum].dmDisplayFixedOutput := DM.dmDisplayFixedOutput;    DevModes[ModeNum].dmDisplayFlags := DM.dmDisplayFlags;      DevModes[ModeNum].dmDisplayFrequency := DM.dmDisplayFrequency;      DevModes[ModeNum].dmDisplayOrientation := DM.dmDisplayOrientation;    DevModes[ModeNum].dmDitherType := DM.dmDitherType;      DevModes[ModeNum].dmDriverExtra := DM.dmDriverExtra;      DevModes[ModeNum].dmDriverVersion := DM.dmDriverVersion;      DevModes[ModeNum].dmDuplex := DM.dmDuplex;      DevModes[ModeNum].dmFields := DM.dmFields;      DevModes[ModeNum].dmFormName := DM.dmFormName;      DevModes[ModeNum].dmICMIntent := DM.dmICMIntent;      DevModes[ModeNum].dmICMMethod := DM.dmICMMethod;      DevModes[ModeNum].dmLogPixels := DM.dmLogPixels;      DevModes[ModeNum].dmMediaType := DM.dmMediaType;      DevModes[ModeNum].dmOrientation := DM.dmOrientation;      DevModes[ModeNum].dmPanningHeight := DM.dmPanningHeight;      DevModes[ModeNum].dmPanningWidth := DM.dmPanningWidth;      DevModes[ModeNum].dmPaperLength := DM.dmPaperLength;      DevModes[ModeNum].dmPaperSize := DM.dmPaperSize;      DevModes[ModeNum].dmPaperWidth := DM.dmPaperWidth;      DevModes[ModeNum].dmPelsHeight := DM.dmPelsHeight;      DevModes[ModeNum].dmPelsWidth := DM.dmPelsWidth;      DevModes[ModeNum].dmPosition := DM.dmPosition;      DevModes[ModeNum].dmPrintQuality := DM.dmPrintQuality;      DevModes[ModeNum].dmReserved1 := DM.dmReserved1;      DevModes[ModeNum].dmReserved2 := DM.dmReserved2;      DevModes[ModeNum].dmSize := DM.dmSize;      DevModes[ModeNum].dmScale := DM.dmScale;      DevModes[ModeNum].dmSpecVersion := DM.dmSpecVersion;      DevModes[ModeNum].dmTTOption := DM.dmTTOption;      DevModes[ModeNum].dmYResolution := DM.dmYResolution;    end;  SetLength(DevModes, ModeNum);  Result := (Length(DevModes) > 0);end;Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  DevModes: TDEVMODES;  CurMon: TCurrentMonitor;  i: Integer;begin  if GetMonitorInfo(DevModes, CurMon) then    begin      Memo1.Lines.Add(Format('%d bit, %d x %d @ %d Hz', [curMon.BITSPIXEL, curMon.HORZRES, curMon.VERTRES, curMon.VREFRESH]));      for i := 0 to Pred(Length(DevModes)) do        Memo1.Lines.Add(Format('%d: %d bit, %d x %d @ %d Hz', [i, DevModes[i].dmBitsPerPel, DevModes[i].dmPelsWidth, DevModes[i].dmPelsHeight, DevModes[i].dmDisplayFrequency]));    end;end;curMon will hold up a set of informations about currently monitor while DvModes hold informations about all supported modes