转自:http://blog.csdn.net/genispan/article/details/4387764function IsUserAnAdmin(): boolean; const SHELL32 = 'shell32.dll'; PROCNAME = 'IsUserAnAdmin'; var hDll: HMODULE; func: function(): bool; stdcall; begin result := false; hDll := LoadLibrary(PChar(SHELL32)); if (hDll <> 0) then begin try func := GetProcAddress(hDll, PChar(PROCNAME)); if Assigned(func) then result := func(); finally FreeLibrary(hDll); end; end; end; |
|
来自: 昵称29079058 > 《DELPHI》