FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   Example DirEdit and GroupEdit to text (https://fileforums.com/showthread.php?t=96442)

by_pbh 10-11-2014 12:06

Example DirEdit and GroupEdit to text
 
2 Attachment(s)
Attachment 10444

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;

Attachment 10443

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;


Dante1995 11-11-2014 00:36

path edit

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

1 Attachment(s)
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


All times are GMT -7. The time now is 20:13.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com