Open save in opened window from website

  • baizuo
    18th Oct 2012 Member 2 Permalink

    Example: https://powdertoy.co.uk/Browse/View.html?ID=974504

    Click open button will open multiple windows, sometimes that really hurts on low-end machine

     

    Suggestion:

    Click open button will open save in current opened window, if it's empty open save directly, if not, ask user to overwrite or open in new window or cancel. A check box "remember my choice (you can change it in the option)" is under the three button. An option related to this is also added in option window, or simply in the pref file, user can edit it manually.

  • boxmein
    18th Oct 2012 Former Staff 0 Permalink
    @baizuo (View Post)
    Yes, this should happen. Not sure how though.
    The thing is, application URL protocol links are passed onto the command line.
    http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx
    (Default) = "C:\Program Files\Alert\alert.exe" "%1"


    -Edit-
    I researched the topic.
    What does this is called an Asynchronous Pluggable Protocol. What this does is launch a program when a specific URL is clicked. Problem is, you don't want Powder Toy to launch. Windows doesn't do it otherwise so to look for a workaround.
    Obvious answer comes to you: Check if Powder Toy already exists before sending the ID to it, otherwise open it yourself.
    There's a problem with that. Two programs need to communicate via a inter-process communication medium. (Wikipedia that!)
    There are files, special messages, sockets, tickets, events, ....
    Implementing them seems like a chore.
  • baizuo
    20th Oct 2012 Member 0 Permalink

    @boxmein (View Post)

    Thanks for your reply, I don't know that handling, er, Asynchronous Pluggable Protocol is that complicated, I'd better simon spend his time on something more interesting.

    Could we hack? Like foobar2000, when foobar2000 application is running, an empty file named 'running' is added to the install folder.

    Similarly, when TPT is running, add a file 'running', when received the command line parameters, check existence of the 'running' file existing BEFORE initialize the main window. If it's already running, find a way to pass the parameter(s). And another check may be added, in case the 'running' file wasn't removed in the last process

     

  • boxmein
    20th Oct 2012 Former Staff 0 Permalink
    @baizuo (View Post)
    Um yes, that's one idea of inter-process communication, or two copies of the same program talking to each other. It can be done, but won't some people -want- two or more windows of TPT up at the same time? Guess that could be stored in powder.pref...