⤷ Expand environment strings

If you have some environment variable (for example, '%WinDir%'), then you may use ExpandEnvironmentStrings function to get a real value of this variable.

procedure TForm1.Button1Click(Sender: TObject);
var
  Str: array [0..255] of Char;
begin
  if ExpandEnvironmentStrings(PChar(Edit1.Text), Str, 256)>0 then
    Label1.Caption:=Str;
end;
More for developers