PDA

View Full Version : Example DirEdit and GroupEdit to text


by_pbh
10-11-2014, 12:06
10444


code
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
MAX_PATH = 260;
MAX_PATH_LEN = 55;

var
PathLabel: TLabel;

function PathCompactPathEx(pszOut: String; pszSrc: String; cchMax: UINT; dwFlags: DWORD): BOOL; external 'PathCompactPathEx{#A}@shlwapi.dll stdcall';

function ShortPath(Input: String; Length: Integer): String;
begin
Result := StringOfChar(#32, MAX_PATH);
PathCompactPathEx(Result, Input, Length, 0);
end;

procedure DirEditOnChange(Sender: TObject);
begin
PathLabel.Caption := ShortPath('Install Path:' + #32 + TEdit(Sender).Text, MAX_PATH_LEN);
end;

procedure InitializeWizard();
begin
with WizardForm do
begin
PathLabel := TLabel.Create(WizardForm)
with PathLabel do
begin
Parent := DirEdit.Parent;
Caption := ShortPath('Install Path:' + #32 + DirEdit.Text, MAX_PATH_LEN);
Transparent := True;
Font.Size := 10;
Left := DirEdit.Left;
Top := DirEdit.Top + Round((DirEdit.Height - Height) div 2);
end;
DirEdit.OnChange := @DirEditOnChange;
DirEdit.Hide;
end;
end;


10443


code
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

const
MAX_PATH = 260;
MAX_PATH_LEN = 55;

var
PathLabel: TLabel;

function PathCompactPathEx(pszOut: String; pszSrc: String; cchMax: UINT; dwFlags: DWORD): BOOL; external 'PathCompactPathEx{#A}@shlwapi.dll stdcall';

function ShortPath(Input: String; Length: Integer): String;
begin
Result := StringOfChar(#32, 260);
PathCompactPathEx(Result, Input, Length, 0);
end;

procedure GroupEditOnChange(Sender: TObject);
begin
PathLabel.Caption := ShortPath(#32 + TEdit(Sender).Text, 55);
end;

procedure InitializeWizard();
begin
PathLabel := TLabel.Create(nil);
with PathLabel do
begin
Parent:= WizardForm.SelectProgramGroupPage;
Caption := ShortPath(#32 + WizardForm.GroupEdit.Text, 55);
Transparent := True;
Font.Size := 9;
Left := WizardForm.GroupEdit.Left;
Top := WizardForm.GroupEdit.Top + Round((WizardForm.GroupEdit.Height - Height) div 2);
end;
WizardForm.GroupEdit.OnChange := @GroupEditOnChange;
WizardForm.GroupEdit.Hide;
end;

Dante1995
11-11-2014, 00:36
path edit (http://forum.oszone.net/post-2074787-1586.html)

zaniyah
08-05-2016, 09:21
I use. Masked Compression with this its not working. i use optimal on arc.ini

Razor12911
08-05-2016, 12:00
you need to get back to the drawing board, in order to use the compressor you used, you need a specific script to make it unpack.

buttignol
08-06-2016, 16:58
Games with long names like leaving the letter of the installation site

Example C: \ Program Files (x86) \ Rockstar Games \ NARUTO SHIPPUDEN Ultimate Ninja STORM 3 Full Burst