|
Post by Andrew Sheldon on Oct 12, 2004 7:55:14 GMT -5
Can someone help me to get the message box to display if a registry key exists.
Here is my code below: ------------------------------
var e:integer;
Procedure GetKey; begin if RegValueExists (HKLM, 'SOFTWARE\Focus\Attitude,Installed') then messagebox ('Hello','Hello',MB_OK); end;
procedure Button5OnClick(Sender: TObject); begin Form1.close; end;
procedure Button1OnClick(Sender: TObject); begin FileExec (RepConst('%SRCDIR%\Setup.exe'),True,False); Form1.show; end;
procedure Button3OnClick(Sender: TObject); begin ShellExec ('www.google.co.uk','','',0,e); end;
|
|
|
Post by Murariu Alexandru on Oct 14, 2004 14:16:49 GMT -5
//First of all download the new updated version of APB (APB 1.0.0.141 2nd Release) ;D //And this should work.
const VAL = 'Installed'; SUBK = 'SOFTWARE\Focus\Attitude';
function GetKey : string; var RES : string; begin if RegValueExists (HKLM, SUBK, VAL) then messagebox ('Hello','Hello',MB_OK); //RegQueryMultiStringValue(HKLM, SUBK, VAL, RES); //for REG_MULTI_SZ Value RegQueryStringValue(HKLM, SUBK, VAL, RES); //for REG_SZ or REG_EXPAND_SZ Value result := res; end;
procedure Form1OnCreate(Sender: TObject); var s:string; begin S := GetKey; if S<>'' then writeln(S); //Show value stored (if any) end;
{Look in "samples\Install_Uninstall.apb" for a more complicated example.}
|
|