How to open user system "select program to open with" for given file?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: How to open user system "select program to open with" for given file?

  1. #1
    Join Date
    Feb 2009
    Posts
    2

    How to open user system "select program to open with" for given file?

    Hi,

    I'm trying to make file management application in Java.

    I already know how to open file in system preferred application. It's quite easy.

    The other issue I thinking about now is that I need to implement "Open With" functionality (like in Ubuntu: you right press on the file -> select "Open With" -> "Other" and system's default application selection window starts.

    I tried to manage that with some Java default classes, but I didn't found one.

    So, I'm working on solution, based on Runtime.getRuntime().exec("something");

    I already know what commands i should write in Mac and Windows to open "application selection" for file:
    1) Windows: RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL <file.ext>
    2) Mac: open <file.ext>

    How to do same on linux (Gnome/KDE)? I still not found easy solution for that.

    Or maybe I am digging in wrong direction? If so - prease correct me.

    P.S. I tried Desktop.getDesktop() and Java Desktop Integration Components (JDIC), but it seems, that both of them don't have a function for functionality i need.

    Thank you for your replies.

  2. #2
    Join Date
    Feb 2008
    Posts
    966

    Re: How to open user system "select program to open with" for given file?

    Before anybody here wastes their time, this has already been posted here.

  3. #3
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: How to open user system "select program to open with" for given file?

    Thanks ProgramThis - I suggest the OP refers to the replies to the same question in the other forum

    It is better to have an approximate answer to the right question than an exact answer to the wrong one...
    J. Tukey
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  4. #4
    Join Date
    Feb 2009
    Posts
    2

    Re: How to open user system "select program to open with" for given file?

    Quote Originally Posted by ProgramThis View Post
    Before anybody here wastes their time, this has already been posted here.
    Yeah, i posted it in several forums. Different people goes to different forums, so this approach helps to get attention from bigger audience.

    I don't see any problems in it - if I will get any solution anythere I will definitely post it to other, so others will be able to find it easier.

  5. #5
    Join Date
    May 2006
    Location
    UK
    Posts
    4,474

    Re: How to open user system "select program to open with" for given file?

    Yeah, i posted it in several forums. Different people goes to different forums, so this approach helps to get attention from bigger audience.

    I don't see any problems in it -
    The problem is the people in each forum who are giving their time and expertise for free are likely to duplicate answers written by others and hence waste their valuable time. And given that you are asking for free help the helpers time is way more valuable then yours.

    if I will get any solution anythere I will definitely post it to other, so others will be able to find it easier.
    The thing you should do is post a link to the other sites that you have posted the question in and then if anybody wants to answer the question they can check to see if it has already been answered before wasting their own time.

    Cross posting is frowned upon by every forum I've been involved with. The only time you should do it is if you don't get an answer to your question in a reasonable time (and by that I mean within a day or two and not within an hour).

  6. #6
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: How to open user system "select program to open with" for given file?

    Quote Originally Posted by asarturas View Post
    I don't see any problems in it
    As keang says, it annoys the people you're asking to help, so you run the risk of them putting you on their 'ignore' list, or the moderators may just ban you from the forum.

    Experience is a poor teacher: it gives its tests before it teaches its lessons...
    Anonymous
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center