file-association

How to change file association without UAC confirmation?

故事扮演 提交于 2019-12-04 19:41:57
When I was working with file association in a .NET application I hadn't had found a way to set it without UAC popping up a confirmation dialog. Today, when I opened uTorrent and looked up for file association, I've found that you can enable (writing to registry) without any confirmation from the UAC. How is that possible? uTorrent is not running as an admin. Edit: Well, I have just discovered with Process Monitor (Sysinternals) that what uTorrent.exe does is to create a few keys ( uTorrent and .torrent ) but in HKCU ( HKEY_CURRENT_USER ), not in HKEY_CLASSES_ROOT . Anyways I also have those

Windows: Changing the name/icon of an application associated with a file type

我的未来我决定 提交于 2019-12-04 12:38:57
问题 I would like to associate a file type in Windows with a particular application, but I need to make it so when the user opens the "Open With" menu, the name and icon of the application in the list is customized for that file type (i.e., not simply the name and icon of the executable). This is because the binary is a general binary that runs many different apps, depending on its command-line arguments (similar to python.exe or javaws.exe ). I don't want the "Open With" menu to show "Python" or

Eclipse RCP: programmatically associate file type with Editor?

江枫思渺然 提交于 2019-12-04 12:13:45
How programmatically associate file type with Editor? That is what Eclipse-RCP Java code can do what is archived with the following UI interaction: Window -> Preferences General -> Editors -> File Associations Add... > File type: *.json Select *.json file type Add... (Associated editors) > JavaScript Editor Make it default Ralated to Q https://stackoverflow.com/questions/12429221/eclipse-file-associations-determine-which-editor-in-list-of-associated-editors Eclipse: associate an editor with a content type Get associated file extensions for an Eclipse editor Opening a default editor, on a

How to execute an event of already launched application with file association?

為{幸葍}努か 提交于 2019-12-04 11:44:53
After playing around with a new Windows Form project, I discovered that when you associate a file type with an executable in Windows, you can find the file path of the file that launched the application using args[0] from static void Main(string[] args) Is it possible to launch an event on your application when you double click a file if your application is already open? (As obviously Main(string[] args) won't be triggered). Example of an application with behavior I am attempting to replicate: User Opens GIMP(in Windows) User opens explorer and right clicks a .png file User selects open with

How to associate a Windows application with a particular file type but share that association with other applications?

对着背影说爱祢 提交于 2019-12-04 10:03:20
问题 If I create a new app, and associate with, say, the .xml file extension on a particular computer, when someone double clicks the .xml file, it will launch my app and pass the file as parameter. But Windows seems to know what other files have the ability to work with that file type. How is that set up? Also, when I save a Microsoft Word file as an .xml file, then later double-click on the file, it will launch Microsoft Word, even though the .xml file type is associated with something else,

How to bring up the “Windows cannot open this file” dialog?

江枫思渺然 提交于 2019-12-04 08:14:12
My users can attach documents to various entities in the application. Of course, if user A attaches a .TIFF file, user B may not have a viewer for that type of file. So I'd like to be able to bring up this dialog: alt text http://www.angryhacker.com/toys/cannotopen.png My application is C# with VS2005. Currently I do Process.Start and pass in the file name. If no association is found, it throws an exception. This should do it: System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "rundll32.exe"; p.StartInfo.Arguments = "shell32.dll,OpenAs_RunDLL " +

Get List of available Verbs (file association) to use with ProcessStartInfo in c#

99封情书 提交于 2019-12-04 05:47:05
I am trying to open and print files with the ProcessStartInfo class. (File can be anything but let`s assume it is a PDF File) ProcessStartInfo pi = new ProcessStartInfo(file); pi.Arguments = Path.GetFileName(file); pi.WorkingDirectory = Path.GetDirectoryName(file); pi.Verb = "OPEN"; Process.Start(pi); this works well for the pi.Verb = "OPEN"; . Some applications register themselves also with the verb "PRINT" but only some do. In my case (Windows PDF Viewer) I get an exception when trying to execute with the pi.Verb = "PRINT"; Is there a way to see all the verbs available for a specific type in

File associating on iOS - opening a plain-text file from Safari

喜欢而已 提交于 2019-12-04 05:30:45
问题 I want to associate a text-based custom file type with my app on iOS. When I open a link to the file which is behind some php script, Safari shows the "open in" option with my app in it, which is OK. However when I open a link which points directly to my file (running a web server for test purposes), Safari decides that it can read the file itself and displays the content by itself. Which is definitely not OK. On the side note, if I substitute any binary file (zip, ...) and use my extension,

What is the best .net alternative to dde for file associations?

孤者浪人 提交于 2019-12-04 05:17:14
问题 I have an MDI Windows Forms application (.net 2008) that allows the user to associate various file types with the application. I currently do this with a registry entry something like this, that causes the application to load and access the file name via the command line: Registry.SetValue(appKey & "\shell\open\command", "", """" & _ System.Windows.Forms.Application.ExecutablePath & """ ""%1""") In the pre-.net version of the application, I used DDE (ddeexec in the registry). If an instance

How can I programmatically check file that a file association exists before attempting to Process.Start() it?

☆樱花仙子☆ 提交于 2019-12-04 05:01:26
My .Net Windows Forms application generates a PDF report, which I want to show to the user. Instead of just assuming the client PC has a PDF viewer installed and blindly throwing the PDF at the Operating System to open, is there a way to check against the list of file associations on the client beforehand, then show a " you need a PDF viewer application installed - here's a couple of suggestions.. " dialog if PDF isn't a registered type? I've found a lot of questions and answers about changing or registering file associations, but I just want an easy way to query the list, not change it. I'd