WinUser() or another way to get Windows User

WinUser() or another way to get Windows User

Postby sambomb » Fri Jan 23, 2015 4:49 pm

I try to use the WinUser() but I get : Error: Unresolved external '_HB_FUN_WINUSER' referenced from OBJ\MAIN.OBJ

http://wiki.fivetechsoft.com/doku.php?i ... on_winuser

If I include the SOURCE\WINAPI\MSGBOX.C I get:

C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c:
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 30: Call to function 'hb_parc' with no prototype in function _MsgBox
Warning W8069 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 30: Nonportable pointer conversion in function _MsgBox
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 32: Call to function 'hb_param' with no prototype in function _MsgBox
Error E2342 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 32: Type mismatch in parameter 'pVal' (wanted 'void *', got 'int') in function _MsgBox
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 35: Call to function 'hb_parc' with no prototype in function _MsgBox
Error E2342 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 35: Type mismatch in parameter 'lpText' (wanted 'const signed char *', got 'int') in function _MsgBox
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 42: Call to function 'hb_param' with no prototype in function MESSAGEBOX
Error E2342 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 42: Type mismatch in parameter 'pVal' (wanted 'void *', got 'int') in function MESSAGEBOX
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 43: Call to function 'hb_parnl' with no prototype in function MESSAGEBOX
Error E2342 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 43: Type mismatch in parameter 'lpText' (wanted 'const signed char *', got 'int') in function MESSAGEBOX
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 80: Call to function 'hb_parni' with no prototype in function MSGYESNO
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 90: Call to function 'hb_parni' with no prototype in function MSGNOYES
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 104: Call to function 'hb_parni' with no prototype in function MSGRETRYCANCEL
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 112: Call to function 'hb_parc' with no prototype in function MSGABOUT
Warning W8069 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 112: Nonportable pointer conversion in function MSGABOUT
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 115: Call to function 'hb_param' with no prototype in function MSGABOUT
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 117: Call to function 'hb_param' with no prototype in function MSGABOUT
Error E2342 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 117: Type mismatch in parameter 'pVal' (wanted 'void *', got 'int') in function MSGABOUT
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 118: Call to function 'hb_parc' with no prototype in function MSGABOUT
Warning W8069 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 118: Nonportable pointer conversion in function MSGABOUT
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 130: Call to function 'hb_parc' with no prototype in function SHELLABOUT
Error E2342 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 130: Type mismatch in parameter 'szApp' (wanted 'const signed char *', got 'int') in function SHELLABOUT
Error E2021 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 138: Array must have at least one element in function WINUSER
Warning W8065 C:\Compiladores\FWH(10.6)\source\winapi\msgbox.c 142: Call to function 'hb_retc' with no prototype in function WINUSER
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: WinUser() or another way to get Windows User

Postby cnavarro » Fri Jan 23, 2015 5:56 pm

Look WNetGetUser()
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: WinUser() or another way to get Windows User

Postby rhlawek » Fri Jan 23, 2015 8:07 pm

This may provide what you are looking for:

In xharbour you can use the netname() function. It takes one logical argument, which defaults to .t. and returns the user name. If set to false it returns the name of the device.

In harbour the function hb_UserName() will return the user and netname() with no arguments will return the name of the device.

Robb
User avatar
rhlawek
 
Posts: 193
Joined: Sun Jul 22, 2012 7:01 pm

Re: WinUser() or another way to get Windows User

Postby carlos vargas » Fri Jan 23, 2015 10:52 pm

Code: Select all  Expand view
?GetEnv("USERNAME")


salu2
carlos vargas
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1686
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: WinUser() or another way to get Windows User

Postby sambomb » Mon Jan 26, 2015 12:14 pm

Thanks!
I'll try all the options

I'm using NetName(.T.) but don't work as I want.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
sambomb
 
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 91 guests