你试试下面的步骤,我没有做过:
1. OpenDesktop( "default",... )
2. GetUserObjectInformation(...,UOI_USER_SID,...)
3. LookupAccountSidgood luck

解决方案 »

  1.   

    I look in MSDN
    GetUserObjectInformation ONLY support NT based system
    9X not support.
    No information about ME.hao to implement in 9X
      

  2.   

    and How to convert SID to UserName/DomainName pair in NT based System?
      

  3.   

    ft, 9x 有localsystem这个用户吗?LookupAccountSid
      

  4.   

    我的程序目前是运行在NT下,所以采用的是LocalSystem账号。
    意思是如果运行在9X下又该如何得到当前登陆账号?GetUserObjectInformation(hDesk,UOI_USER_SID,cbSID,128,&UserNameLen);
    得不到SID,返回的UserNameLen也是0
    是不是因为程序运行于LocalSystem账号下?
    那该怎么办啊。
    急求教!!!
      

  5.   

    to strip(阿飞) :
    你的方法不行,我只得到hDesktop句柄,但是获取句柄用户信息失败。试过通过注册表HKEY_LOCAL_MATHINE\......,还是不成功