Compare commits
3 Commits
b779a0e6af
...
23b69058ab
Author | SHA1 | Date |
---|---|---|
Jan Middelburg | 23b69058ab | |
Jan Middelburg | 2d17084724 | |
Jan Middelburg | c0ca278638 |
54
X2UtApp.pas
54
X2UtApp.pas
|
@ -418,33 +418,43 @@ procedure TX2App.GetPath();
|
|||
(APath);
|
||||
end;
|
||||
|
||||
var
|
||||
ifMalloc: IMalloc;
|
||||
pIDL: PItemIDList;
|
||||
cPath: array[0..MAX_PATH] of Char;
|
||||
{$IFNDEF DXE2PLUS}
|
||||
procedure GetPaths;
|
||||
var
|
||||
ifMalloc: IMalloc;
|
||||
pIDL: PItemIDList;
|
||||
cPath: array[0..MAX_PATH] of Char;
|
||||
begin
|
||||
SHGetMalloc(ifMalloc);
|
||||
try
|
||||
FillChar(cPath, SizeOf(cPath), #0);
|
||||
SHGetSpecialFolderLocation(0, CSIDL_APPDATA, pIDL);
|
||||
SHGetPathFromIDList(pIDL, @cPath);
|
||||
|
||||
FUserPath := FixPath(cPath);
|
||||
|
||||
cPath := '';
|
||||
FillChar(cPath, SizeOf(cPath), #0);
|
||||
SHGetSpecialFolderLocation(0, CSIDL_COMMON_APPDATA, pIDL);
|
||||
SHGetPathFromIDList(pIDL, @cPath);
|
||||
|
||||
FProgramDataPath := FixPath(cPath);
|
||||
finally
|
||||
ifMalloc := nil;
|
||||
end;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
begin
|
||||
FFileName := GetModule(SysInit.HInstance);
|
||||
FPath := FixPath(ExtractFilePath(FFileName));
|
||||
FMainPath := FixPath(ExtractFilePath(GetModule(0)));
|
||||
|
||||
SHGetMalloc(ifMalloc);
|
||||
try
|
||||
FillChar(cPath, SizeOf(cPath), #0);
|
||||
SHGetSpecialFolderLocation(0, CSIDL_APPDATA, pIDL);
|
||||
SHGetPathFromIDList(pIDL, @cPath);
|
||||
|
||||
FUserPath := FixPath(cPath);
|
||||
|
||||
|
||||
FillChar(cPath, SizeOf(cPath), #0);
|
||||
SHGetSpecialFolderLocation(0, CSIDL_COMMON_APPDATA, pIDL);
|
||||
SHGetPathFromIDList(pIDL, @cPath);
|
||||
|
||||
FProgramDataPath := FixPath(cPath);
|
||||
finally
|
||||
ifMalloc := nil;
|
||||
end;
|
||||
{$IFDEF DXE2PLUS}
|
||||
FUserPath := FixPath(System.IOUtils.TPath.GetHomePath);
|
||||
FProgramDataPath := FixPath(System.IOUtils.TPath.GetPublicPath);
|
||||
{$ELSE}
|
||||
GetPaths;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
||||
|
|
|
@ -17,6 +17,26 @@
|
|||
{$UNDEF D2}
|
||||
{$UNDEF D1}
|
||||
|
||||
{$IFDEF VER320}
|
||||
{$DEFINE DXE2}
|
||||
{$DEFINE DXE2PLUS}
|
||||
{$DEFINE DXEPLUS}
|
||||
{$DEFINE D2010PLUS}
|
||||
{$DEFINE D2009PLUS}
|
||||
{$DEFINE D2007PLUS}
|
||||
{$DEFINE D2006PLUS}
|
||||
{$DEFINE D2005PLUS}
|
||||
{$DEFINE D8PLUS}
|
||||
{$DEFINE D7PLUS}
|
||||
{$DEFINE D6PLUS}
|
||||
{$DEFINE D5PLUS}
|
||||
{$DEFINE D4PLUS}
|
||||
{$DEFINE D3PLUS}
|
||||
{$DEFINE D2PLUS}
|
||||
{$DEFINE D1PLUS}
|
||||
{$UNDEF DUNKNOWN}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF VER230}
|
||||
{$DEFINE DXE2}
|
||||
{$DEFINE DXE2PLUS}
|
||||
|
|
|
@ -38,7 +38,6 @@ type
|
|||
FServiceThread: TThread;
|
||||
FAllowClose: Boolean;
|
||||
protected
|
||||
destructor Destroy; override;
|
||||
procedure DoShow; override;
|
||||
|
||||
procedure UpdatePredefinedControlCodes; virtual;
|
||||
|
@ -48,6 +47,8 @@ type
|
|||
|
||||
property ServiceThread: TThread read FServiceThread;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
property Context: IX2ServiceContext read FContext write FContext;
|
||||
property Service: IX2Service read FService write FService;
|
||||
end;
|
||||
|
|
Loading…
Reference in New Issue