我认为这个问题已经被问到了,但我找不到适合我的解决方案.我在
Windows 7旗舰版,64位下使用Delphi 7.实际上我开始在32位操作系统下编写应用程序,但随后更改了PC,所以现在更改为64.在我的程序中,我使用注册过程,从Windows的PROGID值生成许可证ID.不幸的是,它没有读取值,似乎它正在寻找一个不同的文件夹,可能被Windows 64重定向到32位注册表.你能帮我吗?这是我使用的代码:
@H_301_11@Registry := TRegistry.Create(KEY_READ OR $0100);
try
Registry.Lazywrite := false;
Registry.RootKey := HKEY_LOCAL_MACHINE;
if CheckForWinNT = true then
Begin
if not Registry.OpenKeyReadOnly('\Software\Microsoft\Windows NT\CurrentVersion') then showmessagE('cant open');
end
else
Registry.OpenKeyReadOnly('\Software\Microsoft\Windows\CurrentVersion');
result := Registry.ReadString('ProductID');
Registry.CloseKey;
finally
Registry.Free;
end; // try..finally
另外,您知道如何在Delphi 7中查找程序是在64位还是32位计算机下运行?