HOW TO:Activate Process.Start打开的程序

我用如下代码打开帮助文档
Dim HChm As Process’模块级变量

HChm = Process.Start(Application.StartupPath & "\help.chm")‘过程中

当帮助文档为非活动状态时,如何实现像窗体一样Activate方法
---------------------------------------------------------------

eg.
Public Declare Function SetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As IntPtr) As Integer

If Not HChm Is Nothing Then
If Not HChm.HasExited Then
SetForegroundWindow(HChm.MainWindowHandle)
Else
HChm = Process.Start(Application.StartupPath & "\help.chm")
End If
Else
HChm = Process.Start(Application.StartupPath & "\help.chm")
End If

Published At
Categories with Web编程
Tagged with
comments powered by Disqus