一样的,只要你shell的时候注意一下参数就可以了。。。。。。。:
Dim s1 As Long
Dim t1 As Long
Dim pid As Long
pid = Shell("F:\Trancoor.exe", vbNormalNoFocus)
s1 = FindWindow("ThunderRT6FormDC", "坐标转换")
If s1 = 0 Then
MsgBox "错误"
Else
lWnd = GetWindowLong(s1, GWL_EXSTYLE)
lWnd = lWnd Or (WS_EX_APPWINDOW)
SetWindowLong s1, GWL_EXSTYLE, lWnd
AppActivate "坐标转换"
最简单的方法就是用appactivate激活它:
Private Sub Command1_Click()
Dim s1 As Long
Dim t1 As Long
s1 = FindWindow("ThunderRT6FormDC", "坐标转换")
If s1 = 0 Then
MsgBox "错误"
Else
lWnd = GetWindowLong(s1, GWL_EXSTYLE)
lWnd = lWnd Or (WS_EX_APPWINDOW)
SetWindowLong s1, GWL_EXSTYLE, lWnd
AppActivate "坐标转换"
End If
End Sub
试试:
s1 = FindWindow("窗体名",vbNullString)
if s1=0 then
msgbox "错误"
else
lWnd = GetWindowLong(s1,GWL_EXSTYLE)
lWnd = lWnd not (WS_EX_TOOLWINDOW)
lWnd = lWnd or (WS_EX_APPWINDOW)
SetWindowLong s1, GWL_EXSTYLE, lWnd
end if
未经测试。。。。。。