Problem with registry key lazarus / 34-Windows ---------------------------------------------------------------------- Roman · 2019-11-12 14:16 I would like to control with Lazarus the screen resolution. I tried this code: 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   reg:=Tregistry.Create(KEY_READ);  reg.RootKey:=HKEY_LOCAL_MACHINE;  reg.OpenKeyReadOnly(key); If the key is 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 SYSTEM\CurrentControlSet\Control\GraphicsDrivers the key is opened successfully and key names and key values are obtained correctly. But if I try the key 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 SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration  (only 'Configuration' added) the OpenKeyReadOnly returns false. Putting backslash before 'SYSTEM' doesn’t help. What am I doing wrong? (W10, Lazarus 2.0.6) ---------------------------------------------------------------------- Remy Lebeau · 2019-11-12 17:47 TRegistry has LastError and LastErrorMsg properties.  What do they report when OpenKeyReadOnly() returns false?  Chances are, either the key really does not exist, or you simply don't have permission to access it. ---------------------------------------------------------------------- Roman · 2019-11-12 20:05 You are right, 5 - Access is denied. Running as administrator solves problem. Thank you.