.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

C# application.exit not working when e.cancel is true

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :WPF

Hi All,

I have create a application "Windows Keylogger Tool". What I am doing is when someone click on close button of applicaiton what I do is

and hide the applicaiton

works fine.

But from application's exit button. When someone click on that application should exit.


I did this. Application suppose to exit. But when I see in task manager application still running.

And when I try to run exe again. It will give error.

The same window 7 error dailog box.

Check online for solution
Close the program
Debug the program

Help me.

View Complete Post

More Related Resource Links

replacing ok and cancel button of an alert message with YES an NO button in asp.net web application.


i want to replace ok and cancel button of an alert message with YES an NO button in asp.net web application.When a user will click yes the data will be saved in the database and if user clicks that will act as a reset button and do not save the data in database and the control will move with as usual to the redirect page.Any pointers will be highly appreciated.I am usin g C# language.

New off line application working with sdf file. Need advice


Hey Folks

I am working on a project currently where I need to get data out of a 3rd party vendor's software that uses a .sdf file I looked this up and its a SQL CE file. I was hoping to just link to with with access but thats apparently not going to happen. I need to link to the database extract data from it to a csv file for later use. I also and most important I need to get the data from it and create a report that can be printed while on a customers site that my or may not have web access so I need for this program to be on and off line. I had my webapplication that I have been working on open and was able to bring up the sdf file under the server exploere however I can't seem to get anything out of it when I try to do grid views or detail views errors out.

Can I use one of Visual Studio projects to create this sort of applicaiton if so what would be the best approach. I would love to get an access odbc driver since office is allready installed on the employee's laptop's



MaintainScrollPositionOnPostback = true is not working in IIS 6 with virtual directory is running A

Hi All, virtual directory is running ASP.NET 2.0.50727 Environment details: IIS 6 on Win Server 2003 The virtual directory is running ASP.NET 2.0.50727 I have set maintainScrollPositionOnPostBack="True" in the page directive Any ideas? Do I need to install any service packs? also the app is not working well with firefox in some scenarios

Displaying a Messagebox with Ok / Cancel button using C# in web application

 Hi all, I would like to get the user's confirmation by displaying a message box with ok cancel options, when you press ok it has to invoke a member function, otherwise other function. thanks. ssm.

Windows Forms application Stopped Working message in Windows Vista



A Windows Forms application developed with VB2008 Express that has been successfully run on two Windows XP systems and a Windows 7 system fails to run on two of two Windows Vista systems tried so far.


Attempting to run the app on a Windows Vista system results in a system dialog box titled, Microsoft Windows, with the message, A problem caused the program to stop working correctly.  Windows will close the program and notify you if a solution is available.  A single button at the lower right of the dialog contains the text, Close Program.
The initial form of the application never displayed and the dialog above appeared with little delay after attempting to start the program.

The program uses an SQL Server Compact Edition 3.5 database and the program is compiled to include the following .DLL files so the user does not need to install SQL ServerCE.

The Load event of the initial form causes a DataSet to be filled from the SQL CE DB.

I have the System Informa

Ajax AutoComplete is not working when Cookieless is true


Hi All,

I have a web page that using AutoComplete Asp.net Ajax Control.

It was working find when the Cookieless is not "True".

I have no idea my it is not working when I set cookieless to "true".



CLR Profiler is not working.Unhandled exception has occured in your application.


For me CLR Profiler is not working.

When i choose profile application and browser to the executable file.It show's up an message box

"waiting for application to start Common language runtime" .

the message box stays for long time and when i click on "Show Heap now" button even as above message box is displayed i get the following error

Unhandled exception has occured in your application. If you click Continue,the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Object reference not set to an instance of an object.

Application.Current.MainWindow.InvalidateVisual(); not working


Hello all,


I am now working on the application which needs to get screenshots of WPF applications, the approach I use is injecting into target WPF application code and hooking Direct3D functions to intercept EndScene events and grab backbuffer.


The issue I have is that since the moment I inject into the application code, there is no change in visual representation of its windows then EndScene is not called, but I need to get a first screenshot as soon as possible. For that purpose I would like to force redraw of entire main window of the application. For this pupose in the injected code I call


Response.Redirect not working on an UpdatePanel if redirecting to a ClickOnce application (in some c



I have a strange issue. I am using the AjaxControlToolkit 3.0.30930 (the most recent). I have a very simple page with an UpdatePanel. A button on the UpdatePanel invokes Response.Redirect and passes the URL of a Click Once application on the same server. This works well if I run the website on my local system (Windows 7, IIS 7.5).

If I run the website on a remote system (Windows Server 2008, IIS 7.5, same settings) the redirect simply does not work when invoking the page from remote (using the IP address). Instead a postback is executed. Even if I use the IP address of the webserver to invoke the website locally on the webserver, the redirect does not work. Using http://localhost on the webserver the redirect works well.

I tried another test page with no UpdatePanel: The redirect works well in all scenarios.

I tried out to invoke the ClickOnce application using a link instead of Response.Redirect: The redirect works well in all scenarios, even with an UpdatePanel.

Does anyone have a clue what the problem might be?


Here is the ASPX:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestWithUpdatePanel.aspx.cs" Inherits="TestWithUpdatePanel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E

Custom Web Application URL is not working.

I have created a web application on port 80 and have created a site collection for it. I have assigned the web app a custom URL.  SharePoint by default tries to insert the server name as the URL. For some reason, when I use a custom URL, the site is not accessible. However, when I leave the default server name, the site is suddenly accessible. Why is this the case and how can I make it so I can use custom URLs? Thanks.

Serial Port Application Leaks Handle After Exit Forcing Reboot to Clear


The application (C# .Net 3.5) available at www.redondowa.com/porttest demonstrates a problem encountered with a Sony VAIO multimedia laptop related to use of its serial modem port.  A discussion with MS support is included in a doc with the VS solution.

If the base stream or port is not closed before nulling the port, the port cannot be recreated and the application leaves the port inaccessible.  The machine requires a reboot to clear the error.  Other machines clear the error without requiring a reboot.

<!-- /* Font Definitions */ @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:"Arial Unicode MS"; mso-font-charset:134; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:1 135135232 16 0 262144 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:"\@SimSun"; panose-1:0 0 0 0 0 0 0 0 0 0; mso-font-charset:134; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch

WPF(Speech to Text Application) has stopped Working


This is an application(for converting the Speech to text) created in WPF (C# .net) in Windows Server 2008 Enterprise R2. It is buiding properly and while running it is showing the error WPF application has stopped working and it needs to close the program.

The Error details

Problem signature:

Problem Event Name: APPCRASH

Application Name: WPFSpeechToText.exe

Application Version:

Application Timestamp: 4cc2aeaa

Fault Module Name: KERNELBASE.dll

Fault Module Version: 6.1.7600.16385

Fault Module Timestamp: 4a5bdfe0

Exception Code: c000041d

Exception Offset: 000000000000aa7d

OS Version: 6.1.7600.

Locale ID: 1033

Additional Information 1: af5f

Additional Information 2: af5f87ebdae7965d2b41e6339144a33c

Additional Information 3: bdb6

Additional Information 4: bdb62151460fc71dea0ef6a609bbf67a

Read our privacy statement online:


If the online privacy statement is not available, p

SPItemEventReceiver, properties.Cancel not working


I'm attempting to do some custom validation (which should be REALLY easy, but apparently is not).  I cannot use a column-level validation since I need to reference mulitple columns and I cannot do the List-level validation since I need to do multiple tests and the validation for the entire List only handles one test.

So I thought I'd try to capture the "ing" events for the list (Adding, Updating) and see if the old aspx standby of "e.cancel", etc. would work.  From what I found it should, sort of.  I've seen blogs that say I can do the following (My actual code):

      public override void ItemUpdating(SPItemEventProperties properties)

           DateTime sd = Convert.ToDateTime(properties.AfterProperties["StartDate"].ToString());
           DateTime ed = Convert.ToDateTime(properties.AfterProperties["_EndDate"].ToString());

           if (sd.Date >= ed.Date)

e.cancel not working


I have a text box that I am reading mulitple employee names into.  If the user enters a name that does not belong to an employee I want to cancel the item_updating function.  Here is my code:


        Dim RECIPIENTS() As String
        RECIPIENTS = RLIST.Split(";")
        Dim NAME As String
        For Each NAME In RECIPIENTS

            NAME = NAME.Trim

            If (EMPINFO.checkFULLNAME(NAME) = False) Then               

                e.Cancel = True
                lblerror.Text = "NOT NAME" & NAME

Search not working for one web application but is working for two others


I have three web apps: sp2010, teams and projects. I can use the search box to search the scopes of All, This Site and People in the sp2010 and the teams web applications. However, I can only search This Site in the projects web app. The other searches - All and People send me to an error page

I have noticed that the url in the teams web app is http://teams/_layouts/OSSSearchResults.aspx?k=hudson&s=All%20Sites after the search completes and the url in the projects web app is http://projects/Search/Results.aspx?k=hudson&s=All%20Sites.

I have checked and all three web apps have the same settings for Site Actions > Site Collection Administration > Search settings.

One other thing I noticed is that the teams and sp2010 web apps do not have the FAST configuration links under the Site Collection Administration but the projects web apps do. Could it be that search is not working for this web app due to the type of site collection it is? It is using the Team Site Template.





this application is not working in FF


it is working ie,crome,safari . but it is not working Firefox.

i think that the problem is here.lstMultipleValues.Attributes.Add("onclick", "FindSelectedItems(this," + txtSelectedMLValues.ClientID + ");");

can i write this code for firefox in different type?

<script type="text/javascript" language="javascript">            
        var timoutID;
        function ShowMList()
            var divRef = document.getElementById("divCheckBoxList");
            divRef.style.display = "block";
            var divRefC = document.getElementById("divCheckBoxListClose");
            divRefC.style.display = "block";
        function HideMList()

cannot exit OLE DB Editor even though "DelayValidation" is set to true

I am trying to work with a #temp file. I am able to set up a SQL task to write the file but when I try to create an OLE DB Source to read the file I can not exit the editor because the editor complains that the file does not exist. I have "Delay Validation" set to true. Can anyone tell me what is happening? I have even successfully downloaded an example from the net that works, but when I try and edit the Source I get the same error that the file does not exist.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend