How to open a program by a doubleklick on it's datafile! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to open a program by a doubleklick on it's datafile!

Xabbu_01Xabbu_01 Posts: 1Member
I'd like to open my selfwritten program by a doubleklick on one of it's datafiles, generated by this program. This should work like opening MS-Word by doubleclicking on a .doc-file.

Ho can I pass the datafile as an argument to my program by a doubleclick??

Thank you for your thoughts

Xabbu_01

Comments

  • GenjuroGenjuro Posts: 913Member
    : I'd like to open my selfwritten program by a doubleklick on one of it's datafiles, generated by this program. This should work like opening MS-Word by doubleclicking on a .doc-file.
    :
    : Ho can I pass the datafile as an argument to my program by a doubleclick??
    :
    : Thank you for your thoughts
    :
    : Xabbu_01
    :

    Windows, when double clicking on a datafile will check its OLE associations (more on this later), and then run a command line which consists of "program_file_name datafile"; for instance double clicking on a "readme.txt" will generate and run "notepad readme.txt". The same also goes for dragging a datafile over a program.

    VB, upon calling the Command() or Command$() functions, will return the command line as a string, so that you can easily get the name of the data file to open.

    For the OLE registration required for this process to happen, I can't remember these. But you can spot easily by searching for file extensions (ie ".txt") in the registry - and I'm sure that the topic has been replied over and over in this forum, so you might also check out the older posts.
  • elrayelray Posts: 1Member
    : : I'd like to open my selfwritten program by a doubleklick on one of it's datafiles, generated by this program. This should work like opening MS-Word by doubleclicking on a .doc-file.
    : :
    : : Ho can I pass the datafile as an argument to my program by a doubleclick??
    : :
    : : Thank you for your thoughts
    : :
    : : Xabbu_01
    : :
    :
    : Windows, when double clicking on a datafile will check its OLE associations (more on this later), and then run a command line which consists of "program_file_name datafile"; for instance double clicking on a "readme.txt" will generate and run "notepad readme.txt". The same also goes for dragging a datafile over a program.
    :
    : VB, upon calling the Command() or Command$() functions, will return the command line as a string, so that you can easily get the name of the data file to open.
    :
    : For the OLE registration required for this process to happen, I can't remember these. But you can spot easily by searching for file extensions (ie ".txt") in the registry - and I'm sure that the topic has been replied over and over in this forum, so you might also check out the older posts.
    :

    Xabbu_01, I'm trying to do very much the same thing as you are and I can't find much information on the subject, everbody keeps saying it's relatively easy but I can find any examples to study ..... Are you having any luck?? Would appreciate any help from anybody on this subject. Thanks


Sign In or Register to comment.