External application window position

application , vbnet , netframework4 Kota Kinabalu, Malaysia
  • 10 years ago

    Hello, I'm working on some project and I need your help guys. I'm just a beginner. I searched the forums for a related topic but couldn't found any resolved answer. So how can I make start my external application "DXSETUP.exe" at center screen position using this code? Thanks.

    Private Sub Panel3MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseClick Try Me.Hide() Threading.Thread.Sleep(2000) With dx.StartInfo .UseShellExecute = True .FileName = Application.StartupPath & "\redist\directxJun2010redist\DXSETUP.exe" End With dx.Start() dx.WaitForExit() dx.Close() Threading.Thread.Sleep(2000) Try Shell(Application.StartupPath & "\Setup.exe", vbNormalFocus) Catch ex As Exception guierror1.ShowDialog() End Try Application.Exit() Catch ex As Exception gui_error2.ShowDialog() End Try End Sub

  • 10 years ago

    Sorry this should be the code:

    Private Sub Panel3_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel3.MouseClick
    Try
      Me.Hide()
      Threading.Thread.Sleep(2000)
      With dx.StartInfo
        .UseShellExecute = True
        .FileName = Application.StartupPath & "\redist\directx_Jun2010_redist\DXSETUP.exe"
      End With
      dx.Start()
      dx.WaitForExit()
      dx.Close()
      Threading.Thread.Sleep(2000)
      Try
        Shell(Application.StartupPath & "\Setup.exe", vbNormalFocus)
      Catch ex As Exception
        gui_error1.ShowDialog()
      End Try
      Application.Exit()
    Catch ex As Exception
      gui_error2.ShowDialog()
    End Try
    End Sub
    
  • 10 years ago

    sorry for double post

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray