I have seen the example GetCompName to obtain the name of the computer.
Is there a similar function to obtain the name of the current user?
Thanks.
Function GetUserName
Function GetUserName
Yes. It is the sample program:
yours PaPi
` example get Userneme by PaPi 15-04-2009
declare getUser_name as "GetUserNameA" of "advapi32.dll"
lpbuffer as string byaddress
nsize as integer byaddress
result as integer
end declare
getUser_name.nsize=255
getUser_name
showmessage field$(getUser_name.lpbuffer,chr$(0),1)
showmessage getUser_name.lpbuffer
yours PaPi
` example get Userneme by PaPi 15-04-2009
declare getUser_name as "GetUserNameA" of "advapi32.dll"
lpbuffer as string byaddress
nsize as integer byaddress
result as integer
end declare
getUser_name.nsize=255
getUser_name
showmessage field$(getUser_name.lpbuffer,chr$(0),1)
showmessage getUser_name.lpbuffer
-
- Posts: 2
- Joined: Tue Nov 08, 2005 3:00 pm
Function GetUserName
Thank you very much. :)