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 に答える