title: Compiler error when calling Windows API with correct parameters
body: <p>I am trying to run this elementary function but it will not work :</p>
  
  <pre><code>function GetWindowsUserName: String;
    const
      MAX_LENGTH = 256;
    var
      UserNameLength: DWord;
    begin
      UserNameLength := MAX_LENGTH - 1;
      SetLength(Result, MAX_LENGTH);
      if GetUserName(PChar(Result), UserNameLength) then
        SetLength(Result, UserNameLength - 1)
      else
        Result := '';
    end;
  </code></pre>
  
  <p>On formCreate I have :</p>
  
  <pre><code>AdvOfficeStatusBar1.Panels[0].Text := GetWindowsUserName;
  </code></pre>
  
  <p>I get :</p>
  
  <pre><code>[dcc32 Error] Unit1.pas(115): E2034 Too many actual parameters
  [dcc32 Error] Unit1.pas(115): E2012 Type of expression must be BOOLEAN
  </code></pre>
  
  <p>What am I missing here ? </p>
  
  <p>Edit : I am still getting the error :
  <img src="https://i.stack.imgur.com/Mp98i.jpg" alt="enter image description here"></p>