views:

34

answers:

1

In my Windows desktop program, I want to be able to allow the user to select a text viewer that my program will use.

By default, I'll have it set to be the program (s)he uses to view .TXT files, and I can find that easily enough from the Registry. But he may want to change to use Notepad or Wordpad or some other program (e.g. UltraEdit).

This is what I came up with for the dialog box:

File Viewer Selection Dialog Box

Actually I have a two questions here:

  1. Is there a recommended user interface for this (i.e. some sort of dialog I should use)?

  2. Is there a simple way to check, once the user enters a program executable, that it is indeed capable of text viewing?

+2  A: 

Most applications just present you with an open file dialog, although that does seem a bit crude. You could provide a list using this article to query windows for a list of file associations. Also provide a function to pick a programme using a file dialog.

No there isn't a way to check the new exe can handle txt files. Once you hand the file off to that process you just have to hope it works.

stimms