本帖最后由 s1t16 于 2010-08-02 17:04:10 编辑

解决方案 »

  1.   

     [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint="FindWindow")]
    public static extern  System.IntPtr FindWindow( string lpClassName,  string lpWindowName) ;[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint="MoveWindow")]
      
    public static extern  bool MoveWindow( System.IntPtr hWnd, int X, int Y, int nWidth, int nHeight,  bool bRepaint) ;
      

  2.   

    你要设置什么?你是不是希望调用exe执行后,那个exe的主窗口显示在制定的位置?   

  3.   

    调用windform窗口显示flash,设置窗体的位置Position
    引用AxShockwaveFlashObjects, ShockwaveFlashObjects 
      

  4.   

    谢谢大家了,在这里我写一下,用的是windows API
    CODE如下
    声明:
    [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "MoveWindow")]
    public static extern bool MoveWindow(System.IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
    调用
    System.Diagnostics.Process pf = System.Diagnostics.Process.Start(url);
    pf.WaitForInputIdle();
    MoveWindow(pf.MainWindowHandle, 100, 10, 300, 200, true);
    关闭(进程)
     System.Int16 i;
                System.String StrNameID;
                System.Diagnostics.Process[] ShowID = System.Diagnostics.Process.GetProcesses();
                for (i = 0; i < ShowID.Length; i++)
                    System.Console.WriteLine(ShowID[i].ProcessName + " " + ShowID[i].Id);
                System.Threading.Thread.Sleep(200);
                System.Console.Write("请输入你要关闭的进程名称: ");
                StrNameID = "欢迎引导窗体";
                System.Diagnostics.Process[] CloseID = System.Diagnostics.Process.GetProcessesByName(StrNameID);
                //
                if (CloseID.Length != 0)
                {
                    for (i = 0; i < CloseID.Length; i++)
                    {
                        if (CloseID[i].Responding && !CloseID[i].HasExited)
                        {
                            System.Console.WriteLine("指定进程存在而且正在响应中...正在关闭.");
                            CloseID[i].CloseMainWindow();
                            if (!CloseID[i].HasExited)
                            {
                                System.Console.WriteLine("由于特别原因无法关闭进程,现在强制关闭!!!");
                                CloseID[i].Kill();
                            }
                        }
                        else
                        {
                            System.Console.WriteLine("指定进程存在但无法响应...正在强制关闭!");
                            CloseID[i].Kill();
                        }
                    }
                }
                else
                    System.Console.WriteLine("指定进程不存在无法关闭!请确认输入正确.");
    呵呵,终于做出来了,希望对大家有帮助,也谢谢大家对我的帮助!