[PowerBuilder] Get Windows username - PowerBuilder 윈도우 유저
//Create a local external function
Function boolean GetUserName( ref string buffer, ref ulong buflen ) Library "advapi32.dll" Alias For "GetUserNameW"
//Write the below code to get the windows username//You can associate the code to MessageBox / single line edit's text
// Here I am displaying the winusername in text box
// Object :: button
// event clicked
// display username in sle_1
ULong lul_buffer=100
String ls_winusr
ls_winusr = Space(100)
IF NOT GetUserName(ls_winusr, lul_buffer) THEN
ls_winusr = "User unknown"
END IF
sle_1.text=ls_winusr
Function boolean GetUserName( ref string buffer, ref ulong buflen ) Library "advapi32.dll" Alias For "GetUserNameW"
//Write the below code to get the windows username//You can associate the code to MessageBox / single line edit's text
// Here I am displaying the winusername in text box
// Object :: button
// event clicked
// display username in sle_1
ULong lul_buffer=100
String ls_winusr
ls_winusr = Space(100)
IF NOT GetUserName(ls_winusr, lul_buffer) THEN
ls_winusr = "User unknown"
END IF
sle_1.text=ls_winusr