判断当前用户是否为管理员组

来源:互联网 发布:儿童练功服 淘宝 编辑:程序博客网 时间:2024/06/05 00:15
function 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;
==================================
WINXP下编译通过-- genispan
原创粉丝点击