diredit.jpg
Code:
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;
groupedit.jpg
Code:
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;