我已经记录到这一宏观情况,对我来说是一个进程。 现在,我想在我所重视的这一进程的窗口上打一个叫“Run”的纽子,但如何? 我记录了这一宏观:
Sub DebugNUnit()
DTE.ExecuteCommand("Tools.ExternalCommand6")
need a short delay for nunit process to appear in process list:
Threading.Thread.Sleep(200)
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(1) As EnvDTE80.Engine
dbgeng(0) = trans.Engines.Item("Managed (v4.0)")
Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "myPC").Item("nunit.exe")
proc2.Attach2(dbgeng)
Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Sub
<><>UPDATE: 我已经根据这种答案调整了文字。
Sub DebugNUnit()
DTE.ExecuteCommand("Tools.ExternalCommand6")
need a short delay for nunit process to appear in process list:
Threading.Thread.Sleep(200)
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(1) As EnvDTE80.Engine
dbgeng(0) = trans.Engines.Item("Managed (v4.0)")
Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "myPC").Item("nunit.exe")
proc2.Attach2(dbgeng)
added this because we may need a short delay for nunit gui to load
(would prefer to replace it with a wait on some loaded event or something)
Threading.Thread.Sleep(5000)
use Process.Handle or Process.MainWindowHandle? anyway, both do not seem to work.. are the parameters incorrect?
Dim ButtonHandle As IntPtr = FindWindowEx(System.Diagnostics.Process.GetProcessById(proc2.ProcessID).Handle, 0, "Button", "Run")
Dim ButtonHandle As IntPtr = FindWindowEx(System.Diagnostics.Process.GetProcessById(proc2.ProcessID).MainWindowHandle, 0, "Button", "Run")
SendMessage(ButtonHandle, &HF5, 0, 0)
Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Sub
但是,启动的努尼特用户界面上的“Run”纽特语区(通过工具)。 对外通商6号仍然未受到压力。 这一点是有意义的,因为纽特人似乎总是零。 有谁可以找到解决办法?
<><>UPDATE: 我已经根据编辑的回答对文字做了调整。
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Public Module RecordingModule
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
Sub DebugNUnit()
DTE.ExecuteCommand("Tools.ExternalCommand6")
need a short delay for nunit processes to appear in process list:
Threading.Thread.Sleep(1000)
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(1) As EnvDTE80.Engine
dbgeng(0) = trans.Engines.Item("Managed (v4.0)")
Dim proc2nunitagent As EnvDTE80.Process2 = dbg2.GetProcesses(trans, Environment.MachineName).Item("nunit-agent.exe")
Dim proc2nunit As EnvDTE80.Process2 = dbg2.GetProcesses(trans, Environment.MachineName).Item("nunit.exe")
proc2nunitagent.Attach2(dbgeng)
PostMessage(System.Diagnostics.Process.GetProcessById(proc2nunit.ProcessID).MainWindowHandle, &H100, Keys.Alt Or Keys.R, IntPtr.Zero)
Catch ex As System.Exception
MsgBox(ex.Message + Environment.NewLine + ex.StackTrace)
End Try
End Sub
End Module
我正在使用第2条第7款,并随附和伪造你需要的工作,以配合努尼特人手和按努尼特人编印的新闻,以了解你可以随附的努尼特人的最新版本。
以上文字使视力工作室的视像素分解能够使用简单的视觉演播室和显像仪。 你们都需要做的是,把努尼特作为外部工具(目前的项目作为参数),创造习惯工具,并在使用上述文字的该工具路障上添加一个子。 这将从努尼特开始,随附,开始进行试验,打破你的时间间隔。
另有一件事:在工具->中,不可分的“每个项目的太阳视觉状态”中;装置->树木显示器或核子吉将记住最后一次试验,如果这并非你想要的试样,那是一种痛苦。
可能的改进:在启动核心任务之前再接再厉。