AnsweredAssumed Answered

Get UserName

Question asked by VRFuser on Jun 2, 1998
From:                LYLE_CARNAHAN@HP-USA-om47.om.hp.com
Date sent:           Mon, 1 Jun 1998 08:44:52 -0400
Subject:             Re: VRF: Get UserName
To:                  gn-software@iname.com
Copies to:           CARNAHAN_LYLE/HP-USA_om47@i3125om5.atl.hp.com,
            hpvxd_xc@hpislsup.lvld.hp.com

> Item Subject: VRF: Get UserName
>      One way to do this is to make import a compiled function from the
>      ADVAPI32.DLL file that ships with Win95 and WinNT. Create a header
>      file with the following definition:
>     
>      int GetUserNameA(char* lpBuffer, int* nSize);
>     
>      then use the import library to load the file in the Windows system
>      directory with the file as ADVAPI32.DLL. I have used this in WinNT to
>      get the username currently logged in, this should apply to Win95 as
>      well.
     
Lyle,

Thank you for your answer. It works great. But I'm not quite shure with the input
variables. If I import this function I receive a function with 'lpbuffer' and 'nsize'
as input values. Are there any requirements for their content?

Secondly I would be very interested in a list of all useful functions
windows(95/NT) supplies in their DLLs. Is there a list anywhere?




Thanks,
    
Georg Nied
Software Development
51149 Koeln
Germany
gn-software@iname.com

Outcomes