Thread: File Types Automatically Open With My Program

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    73

    File Types Automatically Open With My Program

    How do I make it so that .txt files are automatically opened in my Notepad application instead of in the real Notepad?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    73
    One more question, how can I open more than one type of file.
    Here is my code.
    Code:
    strcat(filter,"Text Files"); \\ Want to open .txt and .npp (notepad plus files, the name of the program)
    int index = strlen(filter) + 1;
    filter[index++] = '*';
    filter[index++] = '.';
    filter[index++] = 't';
    filter[index++] = 'x';
    filter[index++] = 't';
    if(GetOpenFileName(&open_params))
    {
    .....
    }

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    MSDN example: Using Common Dialog Boxes

    OPENFILENAME Structure

    Seach these boards for even more examples.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 04:49 PM
  3. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  4. how to make certain file types open IN your program
    By DarkViper in forum Windows Programming
    Replies: 4
    Last Post: 02-06-2003, 11:37 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM