Thread: Get NT Username
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Get NT Username

That's odd, David became Steven in the reply<VBG

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steven Pugh" wrote in message
...
Fantastic cheers

Steven



"Bob Phillips" wrote in message
...
David,

The If statement is serving two purposes. It is issuing and checking the
call to the API in one statement. If GeteUserName is not successful, it
returns a 0, which will resolve to false in that statement. If it is
successful, it retunes 1, and the following statement strips off the

null
terminator which is a common need when working with APIs.

To get more details about APIs, I suggest checking out www.allapi.net,
and/or getting Dan Appleman's guide to the Win32 API.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"David Fixemer" wrote in message
...
Bob,

Cool trick & works great! However, I'm confused as to
what the if statement is doing? When does it do the Left$
and when doesn't it? Is there information about the
various librarys/Controls such as advapi32.dll?

David