It gives me the following error:
main.pas(59,28) Error: Wrong number of parameters specified for call to "GetUserDir"
I tried this one as well last night and it didn't work- only I was trying to call from "ShellAPI", not "Windows". I tried Ctrl+Click the function to see in the source what it want's to pass to it- no luck there either.
The other one I tried was:
function GetCurrentUserName : string;
const
cnMaxUserNameLen = 254;
var
sUserName : string;
dwUserNameLen : DWord;
begin
dwUserNameLen := cnMaxUserNameLen-1;
SetLength( sUserName, cnMaxUserNameLen );
GetUserName(
PChar( sUserName ),
dwUserNameLen );
SetLength( sUserName, dwUserNameLen );
Result := sUserName;
end;
However, this one worked 100% this time- so I think it's safe to say that the main problem was the fact that I used ShellAPI instead of Windows.
Unfortunately this has now caused another annoying problem...everywhere I used the "Beep" procedure it gives me the following error:
main.pas(213,3) Error: Wrong number of parameters specified for call to "Beep"
I really don't know what the compiler's problem is...
![Smiley :)](/Smileys/ExcellentSmileys1/smile.gif)