Hi

I want my users to be able to double click a document icon and let it be opened with my app in Windows.
Which way would you guys recommend?
I'm currently trying with the AssociateExtension method of the Windows Functionality Suite. But for some reason it crashes my app when it tries to create the folder (registryItem.addfolder)... RS tech support didn't answer my questions, nobody seems to be interested in the topic in this list, so guess I'll look for an alternate method.
Anyone??
In the remote case that anyone wants to take a look at the method I'm using, here is goes:


Sub AssociateExtension(theExtension as string, set as Boolean)

 dim theAppName as String

 theExtension = "." + theExtension
 theAppName = nthField( App.ExecutableFile.Name, ".", 1 )

 dim exten as new RegistryItem( "HKEY_CLASSES_ROOT" )

 if set then
   try
     exten = exten.Child( theExtension )
   catch
exten = exten.AddFolder( theExtension ) // <<<<< Here is the crash <<<<<
   end

   exten.DefaultValue = theAppName
   exten = new RegistryItem( "HKEY_CLASSES_ROOT" )
try
     exten = exten.Child( theAppName )
   catch
     exten = exten.AddFolder( theAppName )
   end
try
     exten = exten.Child( "Shell" )
   catch
     exten = exten.AddFolder( "Shell" )
   end
try
     exten = exten.Child( "open" )
   catch
     exten = exten.AddFolder( "open" )
   end
try
     exten = exten.Child( "command" )
   catch
     exten = exten.AddFolder( "command" )
   end
exten.DefaultValue = App.ExecutableFile.ShellPath + " ""%1""" else
   exten.Delete( theExtension )
 end

End Sub

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to