oryaaaaa wrote:I am using droppyLib, but I need get AssociatingFiles infomation.
coz I didn't understand associate manage registory.
Could you tell me about AssociatingFiles infomation?
1. own app associate by ".mp3"
2.chose ".mp3"
3.get Program path, and programfiles before
4. launch before associated app "abc.mp3"
I am making new audio player. but not support all function.
then my app reject, and before app run
Thank you
Hello again, oryaaaaa. If I understand you correctly, this code should do
the trick. It
creates registry entries to associate
the desired
file type/
extension with your application, and even changes
the icons of
the associated files to match your application icon:
Code: Select all
;=======================================
;
; Creating registry entries for
; application file association &
; updating associated file icons
;
; by TI-994A - 6th April, 2012
;
;=======================================
#SHCNE_ASSOCCHANGED = $8000000
#SHCNF_IDLIST = $0
Define.s keyName, keyValue
Define.i result, keyPtr
;creates an entry for your application
keyName = "MyApp" ;short name of your app
keyValue = "My Application to do something" ;long description of your app
result = RegCreateKey_(#HKEY_CLASSES_ROOT, keyName, @keyPtr)
result = RegSetValue_(keyPtr, "", #REG_SZ, @keyValue, 0)
;creates instructions for command-line launch
keyValue = "c:\MyAppFileName.exe %1" ;replace with ProgramFilename() + " %1"
result = RegSetValue_(keyPtr, "Shell\Open\Command", #REG_SZ, @keyValue, #MAX_PATH)
;sets the associated file icons to match your application
;the icon keyValue can even be a direct icon, for eg: "c:\someIcon.ico"
keyValue = "c:\MyAppFileName.exe -1" ;replace with ProgramFilename() + ",-1"
result = RegSetValue_(keyPtr, "DefaultIcon", #REG_SZ, @keyValue, #MAX_PATH)
;creates the actual file association for the specified extension
keyName = ".myp" ;can be anything, for eg: ".mp3"
keyValue = "MyApp"
result = RegCreateKey_(#HKEY_CLASSES_ROOT, keyName, @keyPtr)
result = RegSetValue_(keyPtr, "", #REG_SZ, @keyValue, 0)
;effects a system-wide notification of the changes
SHChangeNotify_(#SHCNE_ASSOCCHANGED, #SHCNF_IDLIST, 0, 0)
End
Hope this is helpful
for you, and good luck on your audio player project!