0

我有另一个程序正在运行,它的进程名称是met2.exe. 如何让另一个程序最大化met2.exe并在开始栏中保持打开状态?

4

1 回答 1

6

尝试使用GetProcessesByName

Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer
Sub ShowAppWindow()
    Try
        Dim localByName As Process() = Process.GetProcessesByName("met2")
        For Each p As Process In localByName
            ShowWindow(p.MainWindowHandle, 3) ' SW_MAXIMIZE
        Next
    Catch ex As Exception
        ' do something
    End Try
End Sub
于 2013-03-17T00:11:03.487 回答