Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine that the User has Admin privileges
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00824487
Message ID:
00953039
Vues:
30
>:( 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

Why does it say WinNT on Win XP?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform