Jump to content

Recommended Posts

Posted

Hello, I'm creating a media player and wanted a way to get the music dir of the user... I think I've got it figured out by I don't have XP to check.. Please check:

$name = _GetMusicDir()
Msgbox(0, '', $name)

Func _GetMusicDir() 
    If @OSVersion = 'WIN_VISTA' then 
        Return @UserProfileDir & '\Music' 
    Else 
        Return @MyDocumentsDir & '\My Music' 
    EndIf 
EndFunc
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Posted

All good here.

Wouldn't the location be in the registry somewhere?

I found these in the registry...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

http://www.kellys-korner-xp.com/xp_shell_folders.htm

Not sure if there's anything else muttley

Posted

Thanks for that Bert, I hadn't thought of the registry. Please test this now, it works on Vista:

$name = _GetMusicDir()
Msgbox(0, '', $name)

Func _GetMusicDir() 
;~  If @OSVersion = 'WIN_VISTA' then 
;~      Return @UserProfileDir & '\Music' 
;~  Else 
;~      Return @MyDocumentsDir & '\My Music' 
;~  EndIf 
    Return RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'My Music')
EndFunc
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Posted

Thanks for that Bert, I hadn't thought of the registry. Please test this now, it works on Vista:

$name = _GetMusicDir()
Msgbox(0, '', $name)

Func _GetMusicDir() 
;~  If @OSVersion = 'WIN_VISTA' then 
;~      Return @UserProfileDir & '\Music' 
;~  Else 
;~      Return @MyDocumentsDir & '\My Music' 
;~  EndIf 
    Return RegRead('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'My Music')
EndFunc
XP Pro SP2 all good... muttley

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...