Function GetUserName

In this category you can exchange your programming questions and solutions.
Post Reply
mjbarranco
Posts: 2
Joined: Tue Nov 08, 2005 3:00 pm

Function GetUserName

Post: # 419Post mjbarranco
Mon Apr 13, 2009 3:24 pm

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.

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

Function GetUserName

Post: # 420Post PaPi
Wed Apr 15, 2009 11:37 am

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

mjbarranco
Posts: 2
Joined: Tue Nov 08, 2005 3:00 pm

Function GetUserName

Post: # 421Post mjbarranco
Mon Apr 20, 2009 3:30 pm

Thank you very much. :)

Post Reply