View Single Post
Old Feb 11th, 2008, 6:35 AM   #3
vishal
Newbie
 
Join Date: Feb 2008
Posts: 3
Rep Power: 0 vishal is on a distinguished road
Re: Problem with Vwindows Vista

Please refer this code. If i debug this code then it is working fine but when I execute the generated EXE its not working.

Thanks...

procedure TForm1.Button1Click(Sender: TObject);
var
HKR : HKEY;
str1,str2 : String;
begin
str1 := 'Fontname';
str2 := 'Font_FIle_Path';
REGOPENKEYEX(HKEY_LOCAL_MACHINE,'Software\Microsoft\Windows NT\CurrentVersion\Fonts',0,KEY_ALL_ACCESS,HKR);
if HKR = 0 then
exit;
if REGSETVALUEEX(HKR,@STR1[1],0,REG_SZ,@STR2[1],LENGTH(STR2)+1) = ERROR_SUCCESS then
showmessage('Registry updated');
end;
vishal is offline   Reply With Quote