苹果专栏

VisualBasic,dotNet相关资料

激活一个正在运行的程序

    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Integer

'这里SciCalc是计算器的窗口类名
        Dim hCalcWnd As Integer = FindWindow("SciCalc", "计算器")

        If hCalcWnd = 0 Then
            Shell("calc.exe", AppWinStyle.NormalFocus)
        Else
            BringWindowToTop(hCalcWnd)
        End If

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

激活一个正在运行的程序

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭