2
I tested on a Windows 8 machine the following: I entered a Windows registry key for startup. On Windows XP and Windows 7 which were 32 bits worked but on Windows 8 which is 64 bits didn’t work. Can I get a little help? How to enter a registry key in Windows 8 - 64 bit? Below is the code I tried.
var
Reg: TRegistry;
S: string;
begin
Reg := TRegistry.Create;
S:= variavelcontendocaminhoearqv;
Reg.rootkey:=HKEY_CURRENT_USER;
Reg.Openkey('software\microsoft\windows\currentversion\run\',true);
Reg.WriteString('programtest',S);
Reg.closekey;
Reg.Free;
end;
I just tested now and unfortunately it didn’t work and in this part here Reg := Tregistry.Create(KEY_WRITE OR KEY_WOW64_64KEY); from the error not letting compile :p ... ta fod# I tried everything...
– maycon silva
Which error appears? Another thing, as you called the Procedure
inicializarPrograma
?– stderr
Yes I called correctly... when compiling error: undeclared Identifier: KEY_WOW64_64KEY
– maycon silva
I updated the answer again, test like that and see if the program is put on startup, go to Run (Windows key +
R
and type:msconfig
)– stderr
now was :( was testing on my sister’s machine she was now gone chipped kkk ... if anyone can give a test force and see if it works and say would be very grateful ...
– maycon silva
Well, at least in Windows 7 it worked. In theory it was to work also in Windows 8, one thing you should remember is the WOW! One thing out of context: You can vote for questions and answers who have been helpful to you, your vote is very important to our community.
– stderr
the Win7 you tested is 64bits? ... ok I will vote for yours for sure!
– maycon silva
OK thank you very much friend, in case you can test in the 8 let us know here or if I get warning you so we stay ahead and informed of the things that work rsrs.
– maycon silva
qmechanik do a test so take the code I was using that I mentioned above and use to see if it was able to insert in your 64 bit Win7
– maycon silva
The problem is there’s no
KEY_WOW64_64KEY
in your code, this is required in 64-bit.. Idea: Why not test in a virtual machine?– stderr
Well if that Cod doesn’t work already is 80% sure that code works in Win8 rsrs, unfortunately I don’t have 64 bit pc
– maycon silva
Maycon, when you can test to confirm, give a feedback!
– stderr