- Timestamp:
- Aug 23, 2012, 6:43:26 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UCommon.pas
r54 r55 7 7 uses 8 8 {$IFDEF Windows}Windows,{$ENDIF} 9 Classes, SysUtils, StrUtils, Dialogs, Process, 9 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 10 10 FileUtil; //, ShFolder, ShellAPI; 11 11 … … 404 404 Browser, Params: string; 405 405 begin 406 try 406 OpenURL(URL); 407 {try 407 408 Process := TProcess.Create(nil); 408 409 Browser := ''; … … 415 416 finally 416 417 Process.Free; 417 end; 418 end;} 418 419 end; 419 420 -
trunk/Packages/Common/ULastOpenedList.pas
r54 r55 23 23 destructor Destroy; override; 24 24 procedure LoadToMenuItem(MenuItem: TMenuItem; ClickAction: TNotifyEvent); 25 procedure LoadFromRegistry( Root: HKEY; Key: string);26 procedure SaveToRegistry( Root: HKEY; Key: string);25 procedure LoadFromRegistry(Context: TRegistryContext); 26 procedure SaveToRegistry(Context: TRegistryContext); 27 27 procedure AddItem(FileName: string); 28 28 published … … 87 87 end; 88 88 89 procedure TLastOpenedList.LoadFromRegistry( Root: HKEY; Key: string);89 procedure TLastOpenedList.LoadFromRegistry(Context: TRegistryContext); 90 90 var 91 91 I: Integer; … … 96 96 with Registry do 97 97 try 98 RootKey := Root;99 OpenKey( Key, True);98 RootKey := Context.RootKey; 99 OpenKey(Context.Key, True); 100 100 Items.Clear; 101 101 I := 0; … … 112 112 end; 113 113 114 procedure TLastOpenedList.SaveToRegistry( Root: HKEY; Key: string);114 procedure TLastOpenedList.SaveToRegistry(Context: TRegistryContext); 115 115 var 116 116 I: Integer; … … 120 120 with Registry do 121 121 try 122 RootKey := Root;123 OpenKey( Key, True);122 RootKey := Context.RootKey; 123 OpenKey(Context.Key, True); 124 124 for I := 0 to Items.Count - 1 do 125 125 WriteString('File' + IntToStr(I), UTF8Decode(Items[I])); -
trunk/Packages/Common/UMemory.pas
r54 r55 24 24 constructor Create; 25 25 destructor Destroy; override; 26 procedure WriteMemory(Position: Integer; Memory: TMemory); 27 procedure ReadMemory(Position: Integer; Memory: TMemory); 26 28 property Data: PByte read FData; 27 29 property Size: Integer read FSize write SetSize; … … 108 110 end; 109 111 112 procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory); 113 begin 114 Move(Memory.FData, PByte(@FData + Position)^, Memory.Size); 115 end; 116 117 procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory); 118 begin 119 Move(PByte(@FData + Position)^, Memory.FData, Memory.Size); 120 end; 121 110 122 end. 111 123 -
trunk/Packages/Common/URegistry.pas
r54 r55 17 17 rrKeyDynData = HKEY($80000006)); 18 18 19 TRegistryContext = record 20 RootKey: HKEY; 21 Key: string; 22 end; 23 19 24 { TRegistryEx } 20 25 … … 29 34 DefaultValue: Double): Double; 30 35 function DeleteKeyRecursive(const Key: string): Boolean; 36 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; 31 37 end; 32 38 39 function RegContext(RootKey: HKEY; Key: string): TRegistryContext; 40 41 33 42 implementation 43 44 function RegContext(RootKey: HKEY; Key: string): TRegistryContext; 45 begin 46 Result.RootKey := RootKey; 47 Result.Key := Key; 48 end; 34 49 35 50 { TRegistryEx } … … 83 98 end; 84 99 100 function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean; 101 begin 102 {$IFDEF Linux} 103 CloseKey; 104 {$ENDIF} 105 Result := inherited OpenKey(Key, CanCreate); 106 end; 107 85 108 function TRegistryEx.ReadBoolWithDefault(const Name: string; 86 109 DefaultValue: Boolean): Boolean; -
trunk/UCore.pas
r52 r55 74 74 Free; 75 75 end; 76 LastOpenedList.LoadFromRegistry(R oot, Key);76 LastOpenedList.LoadFromRegistry(RegContext(Root, Key)); 77 77 Targets.LoadFromRegistry(Root, Key); 78 78 end; … … 81 81 begin 82 82 Targets.SaveToRegistry(Root, Key); 83 LastOpenedList.SaveToRegistry(R oot, Key);83 LastOpenedList.SaveToRegistry(RegContext(Root, Key)); 84 84 with TRegistryEx.Create do 85 85 try
Note:
See TracChangeset
for help on using the changeset viewer.