close

Close browser/Exit from website Events

Hey, Nowadays I am creating browser game, using ASPX, CSS and AJAX. I need to know when the user close the browser or exit from website, because of these cases for example: if a player opens a game room and than close the browser or exit from the website, this room need to be deleted immediately. 2 players are playing in a room, and ...

How would you stop a thread when the Window is closing and...

...the class with the running thread is far away from the closing_event of the window. btw. we use composite application block from MS. ...

How can I close all the document windows in Visual Studio from an external script?

Hi, I'm creating the software for a course. What with exercise start points and worked solutions and both C# and VB I have about 100 VS2010 solutions. During development I reopen these as neccessary and they get a lot of tweaking. When I'm done I want to leave the solutions with NO documents open. That way when the student opens the...

Using close button in C#

I'm building an app in C# using VS 2008 - I've added a method of checking if a file has changed when it is closed, but this only works for the File>close menu. Is there any way to get the red X in the top right to actually do anything before shutting everything? If so, how? I've only been doing C# for a few days, and this is incredibly c...

Closing all TCP sockets on interface Down

Hi there, I need to close all ongoing Linux TCP sockets as soon as the Ethernet interface drops (ie cable is disconnected, interface is down'ed and so on). Hacking into /proc seems not to do the trick. Not found any valuable ioctl's. Doint it by hand at application level is not what I want, I'm really looking for a brutal and global wa...

C# close to tray (like msn messenger)

Hi guys, I have a c# .net app. So I created a notifyIcon that sits in the tray. What I want to do is when the user hits the "x" button on the form, I want it to close to the tray. They should only be able to exit program by using the context menu in the tray icon. So what I did was, on the form close event, I check whether the form is ...

How to close stdout/stderr window in python?

Hello, in my python app, I print some stuff during a cycle. After the cycle, I want to close the stdout/stderr window that the prints produced using python code. How can I do that? Thanks in advance ...

Cannot Drop Database after Unit Test

ANSWER: I wasn't clearing my ConnectionPools. The solved scenario is: SetUp: Check to see if the 'TEMP_NUnit' database (SQL Server 2005) exists on the local instance If it exists, drop it. Create a new blank database named 'TEMP_NUnit'. Test: Instantiate the 'Upgrade Database' component. Check that essential properties of compone...

How do I gracefully close another application?

I have a CLI/C++ based install application which needs to close another app I've written, replace the application's .exe and dlls and the re-run the executable. First of all I need to close that window along the following lines: HWND hwnd = FindWindow(NULL, windowTitle); if( hwnd != NULL ) { ::SendMessage(hwnd, (int)0x????, 0, NULL...

C# Winforms Threading: Closed Form Gets Invoked

The following code demonstrates my dilemma. The code creates a background thread which processes something, then Invokes the UI thread with the result. It may throw an exception if the background thread calls Invoke on the form after the form has closed. It checks IsHandleCreated before calling Invoke, but the form might close after the...

Best way to remove the close button on jQuery UI dialog box widget?

Hi, What's the best way to remove the close button on the jQuery UI dialog box? I do not wish people to be able to close the dialog box. I'm covering it on the code angle by handling: closeOnEscape: false, beforeclose: function (event, ui) { return false; } I'm trying not to need to write script to grap the class / id of the close bu...

Android onSaveInstance State not working (for me)

Hi people. I have an application that acts like a clapperboard, in which I use a variable i going to i++ every millisecond (I need milliseconds to display frames per second, and the chronometer updates only once per second), then I display it in the format HH:MM:SS:FF. I also have a quit button which goes by if (item.getTitle() == "Quit...

iPhone: is there a way to close an iAd bar?

I'm trying to add iAd to my app right now. I have it instantiated in my appDelegate, and would like to have a close button to allow the user to close Ad at any time. How should I go about doing this? ...

Can a socket be closed on local end without Close being called?

I'm having a problem where a socket appears to be closing by itself. Here's the (edited) network diagnostic trace: Exiting Socket#62696216::BeginSend() Exiting Socket#62696216::EndSend() Socket#62696216::BeginSend() Exception in the Socket#62696216::BeginSend - An established connection was aborted by the software in your host machi...

C# Socket.Close - Should I still call Dispose?

Should I still call Dispose() on my socket after closing it? For example: mySocket.Shutdown(SocketShutdown.Both); mySocket.Close(); mySocket.Dispose(); // Redundant? I was wondering because the MSDN documentation says the following: Closes the Socket connection and releases all associated resources. Thanks. ...

javascript window closing after 15mins

Now, I have script that works, but only if time interval for closing is small (5mins works), but when I try to set timeout to 15mins, it fails every time. The script I'm using is: function openClose(){ my_window = window.open('http://www.somesite.com', "mywindow","status=1,width=1010,height=740"); //this should execute closepop...

Creating an Android Service that cannot be killed

I am trying to write an app that cannot be killed by a user or another application. I understand this goes against what Android has designed for its platform, this is more of a proof of concept. The plan is two have two apps, app1 and app2. When app1 starts it will start app2 and then bind onto app2, when app2 starts it will make sure...

TCL hangs when trying to close TCL pipe

When launching tclsh and typing this: close [open "|tclsh" w] it works fine. But, when in ~/.tclshrc you have package require Tk, the same line makes tclsh to HANG! The same issue is with all GUI packages like Tk, Itk, Img, Iwidgets, however with not GUI packages like Itcl, it worsk fine. How can I fix this issue? The point is to m...

How to transfer the NativeApplication instance to another NativeWindow

Not sure if my title accurately describes what I'm trying to do, but basically I've created a new NativeWindow as follows (using an example from the Adobe NativeWindow documentation http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/NativeWindow.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air...

How do web servers avoid TIME_WAIT?

I'm writing a simple HTTP server and learning about TIME_WAIT. How do real web servers in heavy environments handle requests from thousands of users without all the sockets getting stuck in TIME_WAIT after a request is handled? (Not asking about keep-alive -- that would help for a single client, but not for thousands of different clien...