1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

External application window position

Discussion in 'Visual Basic ( VB )' started by d_a_r_k, Nov 4, 2010.

  1. d_a_r_k

    d_a_r_k New Member

    Joined:
    Nov 4, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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 fire my external application "DXSETUP.exe" at center screen position using this code? Thanks.

    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
     

Share This Page