Thread: how to make certain file types open IN your program

  1. #1
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    Posts
    343

    how to make certain file types open IN your program

    ok, i know there is a way to do this, since ive seen it done in...i dont know...EVERY program ive come across!

    ok, what i need to know, is the chunk of code i need to get into the windows registry and make the .drk extension open up my program and insert the opened file in it already.

    what i ahve right now, is if you click on the .drk file and open it in any other way besides going to file>open, the program starts up and the text isn;t inserted. anyway how i can make the open command work the way things like...notepad open files with its .txt extension?


    another thing is, anyway i can over-rule the basic popup commands when you right clcik on an edit field? like, when you right click in it, by default is windows popup menu witht the basic editing commands, ie. select all, paste, delete, etc...

    anyway i can take this menu out, as well as the keyboard shortcuts?

    i think this is clearly explained...if anything is unclear to anyone, please by all means ask...
    ~DJ DarkViper signing out
    ----------------------------------------
    My Site:
    Black Jaguar Studios

    Languages:
    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

  2. #2
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    Posts
    343
    ok, so obviously no one wants to help me with this. that or 1 one these 3 things:

    1. you dont want to help me
    2. you dont now how so your ovoiding
    3. you just dont care
    4. I broke the rules by bumping my post

    but please! i need help with this! why is it no file will open up INSIDE my program! it just runs the program and nothing is in the edit field!
    ~DJ DarkViper signing out
    ----------------------------------------
    My Site:
    Black Jaguar Studios

    Languages:
    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

  3. #3
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    If you want to over-rule anything that is standard in the control then you will need to subclass that control. Take a look at Petzold's book "Programming Windows" which contains many examples on how to do this. You can also try running a search for subclassing and you will probably find a tutorial on how to do it.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    for the file type association

    from MSDN
    http://msdn.microsoft.com/library/de.../fileassoc.asp

    As to avoiding the right click contex help menu.
    Try turning off the help (??)

    or
    try processing (in the parents callback) the WM_PARENTNOTIFY msg.

    Code:
    case	WM_PARENTNOTIFY:
     if(WM_RBUTTONDOWN==(WPARAM)wParam)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    The problem is your not asking a single focused question. You shoot off all these random questions and then expect a coherent reply? All I can tell you is that you should go a little deeper into the problem by reading specifications and documentation, and trying things out like you are. As quzah used to say - 'top secret files should be labeled "Faq" - noone would ever read them!'. How true.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  3. Basic program design, passing pointer to a function
    By heras in forum C Programming
    Replies: 14
    Last Post: 04-02-2008, 03:21 AM
  4. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  5. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM