English
Forum

Windows API

 
- Page 1 -



supernova
Hi,

i'm Beginner what XProfan concerns. means already time excuse
if The one or others stupid question comes. I have Forum already
search too any Aids, come simply not further.

I must whom currently eingeloggten User detect. I have with MSDN
nachgeschaut which API best in question comes and be then on
"WNetGetUser" from the mpr.dll bumped. the description standing too
in the win32.hlp. means in Profan umgesetzt but It's all right not.
I knows not any more moreover.

moreover have generally yet ask

1 The function means "WNetGetUser" becomes but with "WNetGetUserA"
called Why ?

2 The mpr.dll is as 32 and 64 bit Version in windows present.
Do I expliziet whom Dateipfad in the function to 32 bit Version
indicate or power the windows automatically ?

3 What is on my function wrong ? I have me bemueht and so far
It's all right Auskommentiert.

Download

2 kB
Kurzbeschreibung: User detect
Hochgeladen:12/07/13
Downloadcounter253
Download
 
12/07/13  
 



« this Posting watts as Solution marked. »


Julian
Schmidt
Hello Funkheld.

supernova (07.12.13)

1 The function means "WNetGetUser" becomes but with "WNetGetUserA"
called Why ?


usually becomes one Text always with a byte per characters zurückgegeben (ANSI). but there's too whom Unicode-Standart where two byte per characters needed go. Unicode contain plenty More characters. Unicode-functions go with a W hinten completed and ANSI-functions with a A. often there The functions twice, once results the return in ANSI and once in Unicode.

supernova (07.12.13)

2 The mpr.dll is as 32 and 64 bit Version in windows present.
Do I expliziet whom Dateipfad in the function to 32 bit Version
indicate or power the windows automatically ?


the power windows automatically, You must only whom right Filenames for your DLL present.

supernova (07.12.13)

3 What is on my function wrong ? I have me bemueht and so far
It's all right Auskommentiert.


have now not your code angeschaut. But if You times the Search ready would have, would already one code for you thereby been.
z.B. this here [...] 
Kürzer would against it yet:
CompileMarkSeparation
winexecWait("cmd.exe /c echo %username%>nfo.txt",0)
shell "notepad nfo.txt"e>

I recommend you this Workshop To API-Grundlagen.durchzulesen[...] 

Greeting

Julian
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
12/07/13  
 




Jörg
Sellmeyer
It's all right novh plenty plainer:
CompileMarkSeparation
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
12/08/13  
 




supernova
thanks for speedy Help,

though would so did i gladly know what on my PRG wrong is.
If I these function not ans walk get, I will
probably too no others ans walk get. I have
already many hours the Search and try spent but
come simply not further. the frustiert a little bit.
thereby suspect I the it How often right simply is.
 
12/08/13  
 




Andreas
Koch
Hello supernova,

here another others Version your Source code,
CompileMarkSeparation
' Beschreibung Funktion WNetGetUserA aus win32.hlp
'The WNetGetUser function retrieves the current default user name or the user name
'used to establish a network connection.
'
'DWORD WNetGetUser(
'
'    LPCTSTR lpName,	// pointer to local name to get user name for
'    LPTSTR lpUserName,	// pointer to buffer for user name
'    LPDWORD lpnLength 	// pointer to buffer size variable
'   );
' Variable fuer VZ C:\Windows\SysWOW64 defeninieren "32 Bit"
Declare WIN_SWow$
' Variable fuer fuer Funktion definieren
Declare Dll_Path$
' Variablen fuer MessageBox definieren
Declare AusgabeText$,TitelText$
' Variable WIN_SWow$ Wert zuweisen
WIN_SWow$=$WinPath + "\SysWOW64"
' Variable Dll_Path$ die mpr.dll fuer Funktion GetUserName zuweisen
Dll_Path$=WIN_SWow$ + "\mpr.dll"
'Funktion fuer API mpr.dll "WNetGetUserA" definieren
'Def GetUserName(3) ! Dll_Path$,"WNetGetUserA"
DEF GetUserName(2) !"ADVAPI32","GetUserNameA"
DECLARE USize#, UName#, User$
DIM USize#,4
DIM UName#,256
LONG Usize#,0=256
' Konstante fuer Fehler Abfrage
Def $NOERROR 0
GetUserName

Proc GetUserName

    ' Variablen fuer Funktion GetUserName definieren
    Declare lpName$,lpUserName$,lpnLength&,Status%
    'lpUserName$ mit Leerzeichen auffuellen
    'steht bei MSDN in Beschreibung ?
    lpUserName$ = @Space$(255)
    'Ermittelt den Namen der Angemeldeten Person, die den Rechner benutzt.
    'Status% gibt den Rueckgabewert der Funktion wieder Ok oder Fehler
    Status% = GetUserName(UName#, USize#, lpnLength&)
    ' Zeigt den Namen der Person, die an dem Computer angemeldet
    TitelText$ = "Rückgabe Funktion WNetGetUser"
    AusgabeText$= String$(UName#,0) + "   " + lpUserName$ + "   " + lpName$
    Messagebox(AusgabeText$,Titeltext$,4160)

ENDPROC


under one Pointer becomes The address one Bereichs understood, not a Stringvariable. Perhaps helps you the moreover.
Greeting Andreas
 
12/09/13  
 




supernova
Hello mr cook,

thanks for Tipp.
the was is. to lauter Search and try have I
so festgelaufen that I whom woods to lauter Trees not
More seen have.

Greeting Supernova
 
12/09/13  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

8.844 Views

Untitledvor 0 min.
RudiB.04/18/22
Pascal ter Haseborg01/15/19
MrZebulon08/05/18
Andreas Koch11/07/16
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie