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

Top 5 Contributors of the Month
Post New Web Links

When i start a process and running an external program is there any way to set the program window po

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Windows Application

  private void View_Log_File_Click(object sender, EventArgs e)

            if (processNotePad == null || processNotePad.HasExited)
                processNotePad = System.Diagnostics.Process.Start("notepad.exe", "\"" + path_exe + "\\log\\logger.txt\"");


The problem is after the program the process started and i see the program when i click somewhere on the form1 the main application window the window of the process program is moving

View Complete Post

More Related Resource Links

IE Process Start and Window Height

Hi, I'm working on a tool for cross-browser testing: the idea being that a WinForms app will open a range of URLs over a range of browsers, and save each out as a screenshot. I have a problem with Internet Explorer though - namely that the opened window thinks it's a lot larger than it actually is... Background: I've got some javascript/jQuery, that happily reads a parameter from a URL, and scrolls a page down - so for example http://mypage/?scroll=1 will show the top part of a web page, http://mypage/?scroll=2 shows the second part, and so forth. The scrolling mechanism uses $(window).height() and $(document).height() - both of which are standard javascript methods that work happily.   $(document).ready(function () { var windowHeight = $(window).height(); var documentHeight = $(document).height(); alert("Window Height: " + windowHeight + "px, Document Height: " + documentHeight + "px" ); });   If I open my url in IE normally, it picks up (for example) a window height of 880px - which is correct since my screen is 1050px high, minus a bit for the IE toolbars/furniture. In my WinForms application, I can open IE happily with one of the scrollable urls - namely   process.StartInfo.CreateNoWindow = false ; process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized; process.StartInfo.FileName = "iexpl

How can I have my program access another program that is running on the same computer?

We use 5 different applications at work. There is a lot of copying and pasting and going back and forth between applications. It can be very draining. The main program that I want to interface with is a ticketing application. It was not designed to be manipulated by another program, only a person. One way would be to write a program which moves the mouse around and types things into the fields and navigates between the different windows. But the problem with that is the user (me) would not have the screen/mouse/keyboard free while this was happening as the program would be using it. How would you go about just getting the data straight from memory? If that is not an option could I move the program off screen and manipulate it there? I don't know what language the program was written in. Maybe I could decompile it? Is there a good way to monitor the information it sends across the network? If so I could just have my program make the same requests and then completely bypass the current program.   Do you have any ideas?

FAQ: How do I start another program from .NET?

How do I start another program from .NET?Please remember to mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

Get the Window Position from an external Process

Hi all, Well, this time I am pretending to get the size and the position of a windows process. In fact the size is not relevant to me cause it has always the same, but the position not. Showing the code Code Snippetprivate Process FindWindow(){    Process[] procesos = Process.GetProcesses();        for (int i = 0; i < procesos.Length; i++)    {        if (procesos[i].ToString().Contains("WindowTitle"))        {            return procesos[i];        }    }    return null;}I callProcess WindowA = FinWindow ();At this point i need to know how to get the windows position of that processThank,

Wish to launch any program and keep it confined to my program's window

I would like to divide the screen into three columns: Left 25%, Middle 50%, Right 25%. I would then like to launch programs such as IE in the middle portion and have it stay confined to this area. Is this possible? For example: Is there a version of the exec() functions that allows such a behavior? Or is it possible to somehow "trick" programs I launch into believing the screen consists of only that middle area? Thanks in advance.

Help with running external Process from button click

We need assistance with a portion of a major web application project scheduled to begin user testing within 10 days.  The troublesome part of the code calls an external application when a button is clicked in Web page.  When run from a command prompt or bat file, the external application, App.exe, runs perfectly producing the desired result.  We created a test page and a small console application, Con.exe, to test the button code with a known quantity.  The test application runs perfectly when the button in the Web page is clicked.  However when we change the code to run App.exe instead of Con.exe, the App.exe code will not execute.  We even tried creating a bat file to execute App.exe.  Like the exe, the bat file executes from the command prompt or when double-clicked, but fails to run when called as a process from the button click event.  Can anyone assist us?  Here is the C# code: (.Net 3.5 sp1) using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Diagnostics;   namespace WebButtonTest {     public partial class _Default : System.Web.UI.Page  &nbs

Pass Command to Running Program?


I have a Windows Form app written in C# and I would like a way to close the app from the command line without killing it.

Is there a recommended way to do this gracefully?

Perhaps I can pass a command to the running app to tell it to shutdown?




Running external 32 process from 64 bit OS


I am using System.Diagnostics.Process.Start() to run an external program.

I am seeking to find the best method to handle running an extrnal 32 bit application from my C# project whether it is being used on a 32 or 64 bit platform.

The path to the the external program is configured centrally for all workstations. So at the moment when I invoke the Process.Start("C:\Program Files\MyProgram\MyProgram.exe"), it works when invoked from a 32 bit OS, but not on a 64 bit.

I know I could programatically detect the OS type and alter the file path accordingly, however I thought that there was a method where this was handle automatically.

i.e. When "C:\Program Files\MyProgram\MyProgram.exe" is invoked on 64 bit OS, the system will know to execute it from "C:\Program Files\MyProgram (x86)" instead.


Running a program once every day uisng ASP.NET - job scheduling.


I have developed a workflow web based program using ASP.NET with VS 2005. The process is about renew the Medical Card for exiting employess and/or issue new Medical Cards for new Employess.

The user simply fills a PDF From (to complete his part of the work) and submits the form to the next user in the workflow process.

There are 3 levels in the workflow process:

1. Initiate Form by Staff,

2. Submit for Apprval from HR,

3. Submit for Approval from the Health Department.

4. Print the Medical Card.

The program is now near 90% completed. It sends email to target users asking them to complete their part of the process such as "Approve", "Reject" or "Submit for Approval", "Print Card" ... etc.

Mind you that I am not using WCF, I mean, I am not using the .NET Workflow Features. I am implementing the workflow and email notification using traditional programming.

I was requested to add a new feature to send Auto Notifications as follows:

1. If the users receives the form and he does not complete his part within 3 days, then it will send a reminder to the user.

2. Send a reminder to the staff that the Medical Card will be expired before one month of the "Valid Until".

I can do that by developing a program or a VB.NET function called "WorkflowScheduledJob()" which will loop

Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Can't get an Icon to show for Desktop shortcut and Program Menu



I've created a SetupWizard, but can't get it to show the Icon for the shortcut on desktop and program menu. The installation goes fine without any errors, the only problem is the icon.

I've made a shortcut of my exe file in the Application Folder and dragged the shortcut to the Desktop folder, then on the shortcut properties, I assigned it an icon picture located in Application Folder.

Any suggestions will be very much appreciated.


Access to report file denied. Another program may be using it.


Migrated from Windows 2000 ASP.NET 1.1 to Windows 2003, ASP.NET 2.0 and had this error. All the forums/MSDN/Blogs says to give Read/Write Access to C:\Windows\Temp folder. Why should we give Full Access to some folder in Production server?? In windows 2000, ASP.NET 2.0 development machine, no files are created when we run crystal reports from aspx pages. Then why in Windows 2003 servers, we need to give rights to temp folder?? It is a simple code


And the code is not storing anything on the disk. Then why should it store the GUID.rpt file in Temp file in Windows 2003 server?? Any alternative is there not to store anything on the disk when Crystal Reports are opened in aspx page??


Editor's Note: Does Your Program Smell Like Bacon?


When building your program, are you content with "good enough"? If so, your expectations are fatally low.

Keith Ward

MSDN Magazine August 2010

CLR Inside Out: Program Silverlight with the CoreCLR


The CoreCLR provides the perfect set of CLR classes and functionality for the Web.

Andrew Pardoe

MSDN Magazine August 2008

Virtual Server 2005: Program Customized Testing Environments Without Trashing Your Machine


Efficient testing can require many different machine and server configurations but the effort needed to manage these test environments can take a toll. Microsoft Virtual Server 2005 simplifies the provisioning and management of testing environments. This article demonstrates how the extensive Virtual Server COM API can be used to create an automated application testing environment to make your testing chores a whole lot easier.

Ben Waldron

MSDN Magazine August 2004

Design: Inspect and Optimize Your Program's Memory Usage with the .NET Profiler API


Developers using .NET often make memory leak tracking a low priority because the common language runtime takes care of garbage collection. What few developers realize, however, is that their objects' lifespans, along with their size and what other objects have been instantiated, all affect how they are cleaned up. Depending on the particular circumstances, these combinations can negatively affect performance, especially over the lifetime of an application. This article presents a way for developers to see memory usage and understand garbage collection using the .NET Profiler API. Along the way, a sample application to demonstrate these principles is built.

Jay Hilyard

MSDN Magazine January 2003

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