Stop before shutdown


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Stop before shutdown

  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Stop before shutdown

    Hi evebody,

    I need to stop the browser shutoff before close it (like when we close the Operating System and there is a modified document opened).
    Is there something like this?

    Thanks.
    Maurício S. Mudrik
    IT Director
    Intercomax - Your Office in Transit
    Cybertools - Tools for Cyber Spaces
    Aeroshopping.net - The (future) Brazilian Airports Portal Services
    55 11 6445-2399 / 2388 / 2622

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    I'm not quite sure what you mean. Do you mean "How can I run code before the browser window (Internet Explorer, Netscape Navigator) is closed?". If so, you can use Javascript.
    ArchAngel.
    O:-)

  3. #3
    Join Date
    Mar 2003
    Posts
    2
    Yes. Almost it. Actually I have two problens.

    I have a login window and I want to exec a script in the server if someone:

    1) close the browser window

    The first one is a problem only in the Netscape browser, because the event OnUnload in the Internet Explorer works when someone close or refresh the browser window, in the Netscape is only executed when someone refresh the browser window.

    2) turn off the computer

    This is a hard problem, because in both browsers the event OnUnload is not executed.

    Because of these two problens I´m asking if an Applet Java could do this.
    Maurício S. Mudrik
    IT Director
    Intercomax - Your Office in Transit
    Cybertools - Tools for Cyber Spaces
    Aeroshopping.net - The (future) Brazilian Airports Portal Services
    55 11 6445-2399 / 2388 / 2622

  4. #4
    Join Date
    Mar 2003
    Posts
    834
    For the first problem, that's basically what I was suggesting. I think it might be a good idea to put that post on a JavaScript forum. Someone might know the function name for navigator (this still wouldn't work if someone has JavaScript disabled, though).

    An applet might solve your problems by using the public void destory method as:

    "The destroy method is called when the browser exits. Your applet should implement this method to do final cleanup such as stop live threads."

    Give it a try.

    The second problem is really difficult. It would be really difficult to distinguish between your program simply being terminated and your computer shutting down. I can't think of a nice way of doing it.

    Hope this helps,

    ArchAngel.
    ArchAngel.
    O:-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center