.386
.MODEL FLAT,STDCALL
locals
jumps

UNICODE=0

include w32.inc

extrn GetUserNameA:proc

.DATA

;[--------==========================================================--------];

title1 db 'Get Computername by Max',0
msg_error db 'No Computername found', 0
Dummy1 DD ?



.data?
NameBuffer DB 70 DUP(?)
.CODE

;[--------==========================================================--------];

main:


GetUserName:

mov Dummy1, 70
call GetUserNameA, OFFSET NameBuffer, OFFSET Dummy1
or eax, eax
jz error_01

call MessageBox, 0, OFFSET NameBuffer, offset title1, 0
call ExitProcess,0

error_01:
call MessageBox, 0, OFFSET msg_error, offset title1, 0

call ExitProcess,0

ends
end main
Posted on 2001-12-18 07:15:38 by Max