Is there any Win32/MFC API to get the CSIDL_LOCAL_APPDATA
for any user that I want (not only the currently logged on one)? Let's say I have a list of users in the form "domain\user" and I want to get a list of their paths - is that possible?
相关问题
- the application was unable to start correctly 0xc0
- how to call a C++ dll from C# windows application
- efficiently calling unmanaged method taking unmana
- Handle button click in another application
- win32 Python - pythoncom error - ImportError: No m
相关文章
- Why windows 64 still makes use of user32.dll etc?
- Can WM_NEXTDLGCTL be used with non-dialog windows?
- Windows EventLog: How fast are operations with it?
- C++: Callback typedefs with __stdcall in MSVC
- Are resource files compiled as UNICODE or ANSI cod
- Is it possible to check whether you are building f
- Which VC++ redistributable package to choose (x86
- user32 and kernel method list for C# [closed]
You can get the SID for the user and then look it up under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and get the ProfileImagePath value.
Once you have this path, you can get CLSID_LOCAL_APPDATA for your user, convert the absolute path to a relative path to your profile and then append that relative path to the other user profile path.
However, keep in mind that this is relying on an undocumented registry key and can break in future versions of the OS. (Or, as Raymond Chan would say: "Now that you know how to do it, let me tell you why you shouldn't do it this way..." :-))
If you have a token representing the user, you can use the SHGetFolderPath or SHGetKnownFolderPath (on Vista and up). However, there are certain security restrictions and you should read up on MSDN for details.
SHGetFolderPath - http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx SHGetKnownFolderPath - http://msdn.microsoft.com/en-us/library/bb762188(VS.85).aspx