Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to determine that the User has Admin privileges
Message
 
To
20/10/2004 01:03:27
Nitin Parulekar
New Zealand Software Corp Ltd
Hamilton, New Zealand
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00824487
Message ID:
00953001
Views:
14
:( That means shell32.dll version installed on your computer does not have this function implemented.

Check what version you have (should be at least 5.0; I have the 6th on WinXP). This is code to check Shell32 version:
#DEFINE DLLVER_PLATFORM_WINDOWS  1
#DEFINE DLLVER_PLATFORM_NT       2

DECLARE INTEGER DllGetVersion IN shell32 STRING @pdvi

LOCAL lcBuffer
lcBuffer = Chr(20) + Repli(Chr(0), 19)

IF DllGetVersion (@lcBuffer) = 0
	? "*** Shell32.dll"
	? "Major version:", buf2dword(SUBSTR(lcBuffer, 5,4))
	? "Minor version:", buf2dword(SUBSTR(lcBuffer, 9,4))
	? "Build number: ", buf2dword(SUBSTR(lcBuffer, 13,4))
	? "Platform:     ", Iif(buf2dword(SUBSTR(lcBuffer, 17,4))=1,;
		"Windows", "WinNT")
ENDIF

FUNCTION buf2dword(lcBuffer)
RETURN Asc(SUBSTR(lcBuffer, 1,1)) + ;
	BitLShift(Asc(SUBSTR(lcBuffer, 2,1)),  8) +;
	BitLShift(Asc(SUBSTR(lcBuffer, 3,1)), 16) +;
	BitLShift(Asc(SUBSTR(lcBuffer, 4,1)), 24)
This is MSDN link for IsUserAnAdmin function
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/isuseranadmin.asp
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform