Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Fri, 5 Sep 2008 01:55:15 -0000,    group: microsoft.public.win32.programmer.ui        back       


Enumerating All users favourites...   
Hi all - sorry if this is not the best group - if unsuitable, please advice 
where i should post.

I have a situation where i need to scan the favourites folders for all users 
on a computer.

I can't find a consistent way of enumerate these folders.

I can get the favourites folder for the current user using SHGetFolderPath() 
but i don't no how to apply this to other users.  I want to make the whole 
process as automated as possible.

I know that on most machines these folders will always be in the same 
location but it can differ.

Any suggested would be great.

Mike C
date: Fri, 5 Sep 2008 01:55:15 -0000   author:   Mike Collins its@TheBottomOfThePost

Re: Enumerating All users favourites...   
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<sid>\ProfileImagePath:REG_EXPAND_SZ: profile dir for user;

Load user's hive from parameter above and check:

HKEY_USERS\<sid>\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Favorites:REG_EXPAND_SZ: favourites folder;

Then just bind your IShellFolder interface to it or use FindFirstFile/FindNext File.
Do not forget to unload user profile. You will need admin rights to run such program.

"Mike Collins" <its@TheBottomOfThePost> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ: news:OsIUBBvDJHA.5316@TK2MSFTNGP04.phx.gbl...
> Hi all - sorry if this is not the best group - if unsuitable, please advice 
> where i should post.
> 
> I have a situation where i need to scan the favourites folders for all users 
> on a computer.
> 
> I can't find a consistent way of enumerate these folders.
> 
> I can get the favourites folder for the current user using SHGetFolderPath() 
> but i don't no how to apply this to other users.  I want to make the whole 
> process as automated as possible.
> 
> I know that on most machines these folders will always be in the same 
> location but it can differ.
> 
> Any suggested would be great.
> 
> Mike C
date: Fri, 5 Sep 2008 12:49:34 +0700   author:   st ldomain

Re: Enumerating All users favourites...   
Mike Collins wrote:
> Hi all - sorry if this is not the best group - if unsuitable, please advice 
> where i should post.
> 
> I have a situation where i need to scan the favourites folders for all users 
> on a computer.
> 
> I can't find a consistent way of enumerate these folders.
> 
> I can get the favourites folder for the current user using SHGetFolderPath() 
> but i don't no how to apply this to other users.  I want to make the whole 
> process as automated as possible.

There is now safe way to access the data of any other user.
There is no guarantee that their profile is accessible by your user, or 
even on the same machine in the case of roaming profiles.

Further more, their HKEY_USERS branch won't be loaded unless they are 
currently logged in (or it failed to log out properly). You may be able 
to get around this using the ImpersonateUser APIs though.

This is by design in Windows.

-- 
Dean Earley (dean.earley@icode.co.uk)
i-Catcher Development Team

iCode Systems
date: Fri, 05 Sep 2008 08:46:59 +0100   author:   Dean Earley

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us