close

Problems with CloseMainWindow() to close a Windows Explorer window

Hello! I´m facing a problem when trying to close a Windows Explorer (not Internet Explorer) window through another application, using the "Process.CloseMainWindow()" method; because it doesn´t close the Explorer window, it tries to close the full Windows (Operative System), by the way, Windows XP. The code is as follows: [DllImport("u...

Javascript register window/tab closing event before window/tab close

This has / may have been asked before, but, as far as I remember, the question was not satisfactory answered at that time ^^ How can I register a window or tab closing event with Javascript? I have tried body.onclose and body.onunload, and dozens others whose names I made up myself and thought they might possibly exist, but none of it w...

Server doesn't notice when client closes socket (.NET CF & GPRS)

Client written in .NET Compact Framework. Client connects a socket to the server over a GPRS connection. The server accepts the connection. Client sends 62 bytes of data and then closes the socket. Server never detects that the client has closed the socket and is therefore not able to know that the transfer has completed. This code ...

How can I close a JFrame by click on a button?

I would like to have a button in my window such that if I click it (button) the window is closed. I found out that I can close a window in the following way: referenceToTheFrame.hide(); //hides the frame from view refToTheFrame.dispose(); //disposes the frame from memory But if I do this way, compiler complains: Note: myProgram.java...

How can I stop my application?

I have the main thread from which I start a window using invokeLater. I run my application from command line. So, when application is running I see the window and my command line is "blocked" by the application. I can stop the application either by closing the window (as a result the command line is unblocked) or by typing Ctrl-C in the...

Access 2000 will not Close from Form Close Button or Access Close "X" button

I use Access 2000 and I am having intermittant problems with Access not closing. I don't use any custome VBA and all forms are pretty vanilla. When I try to close using the command button "CLOSE" I have no result. I have the same result when I click the "X" Close button at the top right of the form. I can close by switching into "Des...

How do I check if output stream of a socket is closed?

I have this code: public void post(String message) { output.close(); final String mess = message; (new Thread() { public void run() { while (true) { try { output.println(mess); System.out.println("The following message was successfully sent:"); ...

close fails on database connections (managed connection cleanup fails) in websphere 7 but not in websphere 6.1

I have a simple method (used in a web application through servlets) that gets a connection from a JNDI name and issues a select statement (get connection, issue select, return result, close the connection etc. in finally). Due to other methods in the application the connection is set as autocommit=false. This method works normally in web...

Reason for not properly closed socket?

Here is what I am trying to do: The server sends message to connected clients when new messages are available. The client, on the other hand, when connected, tries to send a message to the server using send() and then receive message using recv(), right after that, the client calls close() to close the connection. Sometimes, after the c...

Can I force Apache 2.2 connection close from inside a C module?

Hello, We'd like to have a more fine-grained control on the connections we serve in a C++ Apache 2.2 module (on CentOS 5). One of the connections needs to stay alive for a few multiple requests, so we set "KeepAlive" to "On" and set a short keep-alive period. But for every such connection we have a few more connections from the browse...

How can I make a JavaScript alert before a page closes?

I want to write JavaScript code that would, when I close the current HTML page, display an alert message like "Are you sure?" I want to take the value of the button from the alert message, whatever the user pressed. How can I do this? ...

Truncate a HTML formatted text with SMARTY.

Hi there! I've got a variable which is formatted with random HTML code. I call it to {$text} and i truncate it. The value is for example: <div>Lorem <i>ipsum <b>dolor <span>sit </span>amet</b>, con</i> elit.</div> If i truncate the text's first ~30 letters, I'll get this: <div>Lorem <i>ipsum <b>dolor <span>sit The problem is, I ...

three out of five file streams wont open, i believe its a problem with my ifstreams.

#include<iostream> #include<fstream> #include<cstdlib> #include<iomanip> using namespace std; int main() { ifstream in_stream; // reads itemlist.txt ofstream out_stream1; // writes in items.txt ifstream in_stream2; // reads pricelist.txt ofstream out_stream3;// writes in plist.txt ifstream in_stream4;// read recipt.tx...

bad file descriptor with close() socket (c++)

hi everybody! I'm running out of file descriptors when my program can't connect another host. The close() system call doesn't work, the number of open sockets increases. I can se it with cat /proc/sys/fs/file-nr Print from console: connect: No route to host close: Bad file descriptor connect: No route to host c...

How to shutdown local tomcat server when closing browser window?

Hi, I hava a web app running on a local tomcat server. When the user starts the app (via desktop shortcut) the server starts and the app is opened in a browser window. But when the user just clicks on the close button to stop the application the server is still running in the background - that's annoying. I tried to utilize the "unonl...

Why is this simple Mobile Form not closed when using the player

Hi, I created this simple sample Form with the close button. Everything is working as expected when NOT using the Interop.WMPLib.dll I've seen other applications using this without problems but why isn't the Form process closed when I just add the line: SoundPlayer myPlayer = new SoundPlayer(); and of course dispose it: if (myPlay...

Close an eclipse RCP application when workbench is not ready yet?

How do I close an eclipse RCP application on startup, i.e. when the workbench is not yet available? Usually I would use PlatformUI.getWorkbench().close(); but this does not work on startup. I am doing some checks on startup in one of my plugins Activator classes and I would like to close the application in case the checks fail. ...

can an iphone app shut itself down programatically

I want the user to start the app and leave it running. At one point, the app will finish what it is doing and will shut itself down. How can I do that in Objectve C ...

jQuery: Dialog Close Event: Execute more than one command without having to call a function

I will be calling a jQuery dialog from various parts of a page. Each call is initiated by an onClick event of the calling object where I firstly call a function to create the dialog, write the close event binding to the dialog and then call the dialog. For the close event, I wish to have multiple commands to be performed, but different f...

Java Socket Disconnect Reporting vs. C# Disconnection

in C# when a sockets connection is terminated the other node is informed of this before terminating the link thus the remaning node can update the connection status. in Java when i terminate a communication link the other node keeps reporting the connection as valid. do i need to implement a read cycle (makes sense) that reports the co...