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

Top 5 Contributors of the Month
Post New Web Links

IE Process Start and Window Height

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :Windows Application
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

View Complete Post

More Related Resource Links

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


  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

process.start with UseShellExecute = False

Hi Please help here im stuck with this issue where i am trying the fire the cmd.exe to perform a task but the cmd.exe file needs to be started with with admin rights and i wnt the file to be hidden and even if i set the process properties ProcessWindowStyle.Hidden. How can i run the process with admin right and also hide the window because the minute i set UseShellExecute = True and comment out the user name and password than it hides the window. From what i can gather is that once you set UseShellExecute = false the code does not hide the window. See my code example below and it would really help if some could show me how to start the processs with admin right and keep the window hidden. Dim myProcess As New Process ' Declare new instance of the process class myProcess.StartInfo.FileName = "cmd.exe" ' myProcess.StartInfo.Arguments = "My Arguments here" myProcess.StartInfo.UseShellExecute = False myProcess.StartInfo.Verb = "runas" myProcess.StartInfo.UserName = Username myProcess.StartInfo.Password = password myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden myProcess.Start() ' Start the process myProcess.WaitForExit() ' Wait for it to exit.

Process.Start - arguments length restriction to 2080 characters

Hi, I'm wondering why is there a limit to "The sum of the length of the arguments and the length of the full path to the process " to 2080? I see that the documentation says that a Win32Exception is thrown if this exceeds 2080 characters. Can someone please explain to me this limit? I'm trying to start a process and I have a lot of arguments to pass, and of course ... I exceed the limit of 2080.   Thanks, Ionut.

Process Start

I have the following code: Private Sub StartCSVParse(ByVal CSVParse As String) Dim process As New Diagnostics.Process With process With .StartInfo .FileName = "ExcelConverter.exe" .Arguments = "" .WorkingDirectory = "C:\Program Files\Infrahealth Inc\CSVParser\" End With ' .Start() 'This Try is to catch if the application throws any kinds of errors' Try Catch Exc As Exception message2.Text = Exc.Message End Try End With End Sub and the rest of my code before this works, but this won't start the process referenced. The process will run on it's own as an executable. I've verified that the right permissions are in place to execute the program and it wont start. Can anyone offer any reason why it may not be working?Thank youDoug

Calling SlSvcUtil with Process.Start()

Our application relies on SlSvcUtil (the equivalient of SvcUtil) to generate our WCF service client dynamically. It has always worked in the past but for some reason, when I call the command line to run this utility the application just stoped. The code is: Process process = new Process(); process.StartInfo.FileName = SvcUtilPath; process.StartInfo.Arguments = arguments; process.StartInfo.ErrorDialog = true; process.StartInfo.UseShellExecute = true; process.Start(); process.WaitForExit(); The variables: SvcUtilPath = C:\Program Files\Microsoft SDKs\Silverlight\v4.0\Tools\SlSvcUtil.exe arguments = http://localhost/XivicServicesNPDev/SecurityService.svc /out:c:\GeneratedSourceXivicNPDev\WCFReference\Silverlight\\SilverlightSecurityService.cs  /ct:System.Collections.ObjectModel.ObservableCollection`1  /ser:Auto  /n:*,Adapt.WCF.Reference  /r:"c:\GeneratedSourceXivicNPDev\FrameworkBin\Silverlight\Adapt.Model.Common - Silverlight.dll" /r:"C:\Program Files\Microsoft Silverlight\4.0.50524.0\\System.Windows.dll" /r:"c:\GeneratedSourceXivicNPDev\FrameworkBin\\Silverlight\Adapt.Model.Security - Silverlight.dll" /r:"c:\GeneratedSourceXivicNPDev\FrameworkBin\\Silverlight\Adapt.Model.CodeGeneration - Silverlight.dll" /r:"c:\GeneratedSourceXivicNPDev\FrameworkBin\\Silverlight\Adapt.Model.DataTransformation - Silverlight.d

Process.Start return value confusion

MSDN documentation for Process.Start return value says: A new Process component that is associated with the process resource, or null if no process resource is started (for example, if an existing process is reused). What does "existing process is reused" mean? When can it happen?

System.Diagnostics.Process.Start not work with IIS, but on ASP.NET Development Server

System.Diagnostics.Process.Start not work with IIS, but on ASP.NET Development Server 

How to create a wpf-dialog window with constant height?

Good afternoon. I need to create a dialog wpf-window with the constant height. One can see a window height in wpf-editor, and set this value to MinHeight and MaxHeight properties. Here's a simple XAML-code: <Window x:Class="ClassName" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Height="94" Width="243" MaxHeight="94" MinHeight="94"> <Grid> <Button Content="Button" Height="23" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="75" /> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="146,32,0,0" Name="button2" VerticalAlignment="Top" Width="75" /> </Grid> </Window> However, when running the application, one sees the window has a larger height. What's the bug? Tell me please, how to make a dialog wpf-window with the constant height?

When a Task Expired step in a Start Custom Task Process action is not fired?!

When a Task Expired step is not fired?! I created a simple Workflow using the SharePoint Designer. Added one step to which I added the Start Custom Task Process and set the Due Date "2 minutes after now". For the When a task Expired step of the custom Task I added a Log to History List action, which doesn't seems to be fired. What good be wrong??? All the steps I did to create the workflow: Started SP Designer 2010 and created a reusalbe WF. Added Start Custom Task Process action to step 1. Changed the behavior of the When a task Expired stepof the custom task (added a Log to History List action). Changed the behavior of the Before Task is Assigned by adding a Set Field action which set the Due Date of the task to "Now + 2 minutes". Published the WF and started the WF for a simple list item. Unfortunately the Log to History List actionof the When a task Expired step is never called.

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,


Hi, I tried to open a word document using System.Diagnostics. It works fine when the docuement name doesn't have any blank spaces in it. But word doesn't open the document when the document name has blanks in it. My code snippet: Process process = new Process(); process.StartInfo.FileName = "winword";process.StartInfo.Arguments = @"C:\\Karthick files\\Test.doc";process.Start(); It says winword cannot find the file, but the file actually exist. When I tried to remove the blank space in the folder, it opened correctly. I tried to open using Process.Start static method and it worked fine, but I need to create the instance of the process because I'm maintaining the processes which are opened this way. Please anyone of you help me out? Thanks in advance, Karthick.

is possible to pass some data to a wpf started with Process.start?

is possible to pass some data to a wpf application started with     Process.start?

Unable to start debugging on the web server. The IIS worker process for the launched URL is not curr


Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running.

I'm running Windows 7 64 bit, VS 2008 sp1.

When I first try to debug I get the error msg above.  I wait a few minutes (presumably some service is starting) and debugging will start but no breakpoints are recognized.

Some of the things I've tried:

Changing the binding of my site from a static IP to "*".

Enabled windows authentication.

made sure localhost = in the hosts file.

The website was built under windows xp and whatever version of IIS ships with xp.  My web config has no errors that I know of but might be missing something required for iis 7 (??)



Wrong window height when running the WPF App



I have the XAML code below with a fixed width and height but when I run the application it is changing the height automatically. How can I fix this?

Here's the code:

<Window x:Class="Vodia.Clinica.LoginWindow"
    Title="Clínica - Login" Height="225" Width="388" Topmost="True" WindowStartupLocation="CenterScreen" WindowStyle="None" ResizeMode="NoResize">
    <Border BorderBrush="Black" BorderThickness="1">
          <ColumnDefinition Width="70" />
          <ColumnDefinition Width="*" />

        <Border Grid.Column="0" Grid.Row="1" Background="LightGray"></Border>

        <Image Height="32" HorizontalAlignment="Left" Margin="21,26,0,0" Name="imgCadeado" VerticalAlignment="Top" Width="32" Source="/Vodia.Clinica;component/Images/base_key_32.png" />
        <Label Content="Usuário" Grid.Column="1" 

Process.Start & Win32Exception


Hi together,

I'm currently facing a very strange problem. I would like to open the Sticky Notes program of Windows 7 (x64), which should be the easiest thing in the world:


This throws a Win32Exception (The system cannot find the file specified, Native Error 2). I tried the fully qualified path (C:\Windows\System32\StikyNot.exe), which didn't work either. Well ... if I copy the path string out of the watch of my debugger, I'm able to run the application via the run dialog.

So I added a batch file which should call the application for me:

start C:\System32\StikyNot.exe

If I run this batch via the explorer, the application pops up correctly. If I start this batch file from my application (which is in the same folder), I'll get an error (Windows cannot find ...).

I can call the calc.exe, which is in the same folder, without any problems. The application is not started from a network share nor has it the same name like the target app (StikyNot or StickyNotes).

What the ____ is going on here?

Thanks in advance,
Andreas Nägeli

Animate window height


Hi, All:


I have a storyboard which reduce my window height to 40. See below:


            <Storyboard x:Key="StoryBoard_Collapse">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="me" Storyboard.TargetProperty="Height">
                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="40">
                            <KeySpline ControlPoint1="0.175,0" ControlPoint2="1,1"/>

Database mail process does not start, no error generated, for only one maintenance plan

I have three maintenance plans:

1. Application DBs - 2am (checks integrity, full backup, log backup)
2. System DBs - 3am (checks integrity, updates statistics, full backup)
3. Backup and log file cleanup - 3:30am (removes backup history, .bak and .trn files)

For items 1 and 3 above, I see the database mail process start up and receive emails that the jobs completed.  For item 2, no email....the database mail process does not start and there are no errors in the event log.  The job history shows that the job completed successfully.

I'm having the same problem on a different server, except that items 2 and 3 email me their results, but item 1 does not.  Same exact job steps and times of execution.  None of the jobs are set to notify the operator, the notification is coming from the maintenance plan.

Obviously I've gone through the basics:

Configured an operator
Created a default, public profile
Enabled mail profile in SQL Server agent
Tested mail delivery

How do I diagnose the database mail process just not starting?  Has anyone seen this before?

SQL Server 2005 SP3, with KB 970892 applied.
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