The context in which i close the application i cannot maintain the instance. Thanks for the response. I found a solution. Check below: [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern IntPtr FindWindow(string sClassName, string sWindowTitle); [DllImport("user32.dll")] static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); uint processId; IntPtr hProgram = WebApp.FindWindow(null, "....."); GetWindowThreadProcessId(hProgram , out processId); System.Diagnostics.Process.GetProcessById((int)processId).Kill();
pranu_13
Posts
-
Kill a process in RDC session -
Kill a process in RDC sessionI launch application B from application A. When i close application A i need to close application B. I RDC to a remote server and launch application A and launch B from A. When i close A it looks for B and kills it. However it goes and kills application B in another RDC session. How do i differentiate the process launched in the session i logged into? Any help would be greatly appreciated.
-
Create a dsn programmatically in c#How to create a DSN programmatically in C#? I need to create a DSN for Oracle.
-
Unable to run web applications on my PC.That did not work. i just added a button and label in the application. No other code. Interesting is when i replaced localhost with IP address it works. It does not work with localhost.
-
Unable to run web applications on my PC.I am trying to run a simple web application and it does not run. Even view in browser does not work. The browser opens with the url ("http://localhost:3197/WebSite2/Default.aspx") and stays in a waiting state. Can some one help me?
-
Child processes that is started by a logon process ends when the parent process ends in Windows 2000I start a service on logon(written in C#.net). This service starts another process. My application has an interface with allows administrators to restart the service. However, when this service is restarted, it kills the child process launched from it. I want the child process to be alive even when the service is stopped on windows 2000. This issue exists only on windows 2000 by design. Can any one help me out in this?
-
know if logged in account is an administratorI have .Net 2.0 MSI. I installed this on Vista. To access few functionalities of the application installed, i check if the logged in account is an administrator as below: WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal; _IsAuthorized = principal.IsInRole(WindowsBuiltInRole.Administrator) || principal.IsInRole(WindowsBuiltInRole.PowerUser); This function detects the logged in account as administrator only for the user account with which i logged in to install the MSI. For other computer administrator accounts it does not recognize. How do i resolve this issue on Vista? Is there any other way to know if the logged in account is an administrator?
-
Floppy noise on windows 2000 when msinfo32 runsI am running msinfo32.exe programmatically in my application to output the system information. When this runs especially on windows 2000 sp4, it is scanning the floppy drive and resulting in some noise. How can i avoid it from scanning the floppy drive? Thanks.
-
Programmatically determine if Framework 2.0 Full trust is set or not?How to determine programmatically if Framework 2.0 Full trust is set in trusted sites or not?
-
Error code 2869 while uninstalling an MSI on vista PCI am trying a uninstall a program on a vista PC and it gave me the below error: The installer has encountered an unexpected error installing the package. This may indicate a problem with this package. The error code is 2869. When installing the program MSI it worked fine. However, when i try to uninstall it from Control panel, it raises the above error message.
-
Running .Net 1.1 application on windows vistaI know that. Can't i start it without using admin privilages?
-
Running .Net 1.1 application on windows vistaI have a windows application written in .net 1.1. I am unable to run the application on windows vista. Where ever i have used the System.Diagnostics.Process namespace it throws an exception. Also i have to start a windows service on vista from this application. It says admin access is needed to start the service. Security on vista has been changed a lot. Do i have to enable any properties on vista to make this application work? Any solution would be of great help. Thanks.
-
How to upload an image using a file browser from a basic clientI have an asp page on server. I call this page from a .net windows form in which i have a browser control. I need to upload an image on the client PC into the browser control containing the asp page fetched from server.
-
Print the scrolled content of a windows formI have a windows application in .net 2.0. I use a webbrowser control to display an asp page which is on server. Below the browser control i display an electronic signature. My requirement is to print this form. I tried to use the memorygraphics class and take the screenshot of the form and draw the image to printer. But this gives me only the part of the form visible on the client area. The part which is visible on scrolling the form is left. I need the complete form along with the scrolled part. How do i do this? Can any one help me?
-
Load a .net libraryAsp.
-
Load a .net libraryHow do add and use a .net class library in Asp?
-
Completion of Mousewheel eventIs there a way to indicate the completion of mouse wheel event in C#.net 2.0 windows application?
-
HashtableI added elements to hashtable but they are not in the order in which i added. The code is below: Hashtable table = new Hashtable(4); table[new Regex(@"^(-?)(\d*?)\.?(\d{0,1})?$")] = "$1$2.$3"; table[new Regex(@"^(\d*?)\.?(\d{0,1})?(-?)$")] = "$3$1.$2"; table[new Regex(@"^(-?)(\d{1,3}?)((?:,\d{3})*)\.?(\d{0,1})?$")] = "$1$2$3.$4"; table[new Regex(@"^(\d{1,3}?)((?:,\d{3})*)\.?(\d{0,1})?(-?)$")] = "$4$1$2.$3"; I want these elements in the same order. Some times it takes the same order and some times it does not. I know hashtable does not take elements in same order. But is there a way for this?
-
Paste file in new message of Outlook ExpressI copy a file and try to paste it in a new message of Microsoft Outlook, it adds the file as attachment. But when i try to paste the file in new message of Microsoft Outlook Express, it does not. What can be the reason? Does Outlook Express support pasting files?
-
Autohidden taskbarI autohide the taskbar and maximize a form in a .net 2.0 application. When i take the cursor to the bottom i am unable to see the taskbar. When i go to any other open application it is visible. But in my application it is not visible. Can any one tell me what can be done?