User32.dll Function 
Author Message
 User32.dll Function

I want to identify the current windows user using this
dll, just need the declaration to jog my feeble memory!

Thanks
Paul



Tue, 31 May 2005 00:00:55 GMT  
 User32.dll Function
The GetUserName() function, which returns the user name of the current
thread is in advapi32.dll. The following code might help you:

---
Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
( _
    ByVal lpBuffer As String, _
    nSize As Long) As Long

Function GetCurrentUser() As String
    Dim S As String
    Dim L As Long

    L = 512
    S = Space(L)
    GetUserName S, L
    S = Left(S, L)
    GetCurrentUser = S
End Function
---

- Chirag
  http://officerone.tripod.com/


Quote:
> I want to identify the current windows user using this
> dll, just need the declaration to jog my feeble memory!

> Thanks
> Paul



Tue, 31 May 2005 09:01:20 GMT  
 User32.dll Function
Thanks Chirag,  

That's the function I was after, was sure it was user32.

Paul

Quote:
>-----Original Message-----
>The GetUserName() function, which returns the user name
of the current
>thread is in advapi32.dll. The following code might help
you:

>---
>Public Declare Function GetUserName Lib "advapi32.dll"

Alias "GetUserNameA"
Quote:
>( _
>    ByVal lpBuffer As String, _
>    nSize As Long) As Long

>Function GetCurrentUser() As String
>    Dim S As String
>    Dim L As Long

>    L = 512
>    S = Space(L)
>    GetUserName S, L
>    S = Left(S, L)
>    GetCurrentUser = S
>End Function
>---

>- Chirag
>  http://officerone.tripod.com/


message

>> I want to identify the current windows user using this
>> dll, just need the declaration to jog my feeble memory!

>> Thanks
>> Paul

>.



Tue, 31 May 2005 18:04:50 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please Help - USER32.DLL function list.

2. Need help with ExitWindows function in user32 dll

3. Missing User32.dll API Function

4. SendInput Function in "user32.lib"

5. Declare Function WinHelp Lib "user32"

6. Accessing User32 DLL

7. I need some User32.dll declares for my VB .NET app

8. user32.dll and Visual basic 3 ??

9. How to Generate an Event out of user32.dll

10. Accessing user32.dll via VBS

11. user32.dll question

12. Can't find DLL Entry point ExitWindows in user32

 

 
Powered by phpBB® Forum Software