编辑: ZCYTheFirst 2012-12-15

2 SystemUtil.UnblockInput End Sub CloseDescendentProcesses Method Description Closes all processes opened by QuickTest. 关闭由 QuickTest 打开的所有进程. Syntax object.CloseDescendentProcesses Argument Description object A test object of type SystemUtil. SystemUtil 类型的测试对象. Return Value A Long value. The number of instances of the application that are closed when the statement runs. 一个长整型值.被CloseDescendentProcesses 方法语句关闭的程序实例数. Remarks Note: QuickTest initially tries to close the process by sending a WM_CLOSE message to the process window. If the process is still open after

5 seconds, QuickTest terminates the process. 注意:执行该语句时,QuickTest 首先向进程窗口发送一个 WM_CLOSE 信息,偿试关闭该进程;

如果该进程在

5 秒钟后存未 关闭,则QuickTest 强制结束进程. Example Close All Applications Opened By QuickTest 在本例中:假定在运行程序之初,Record and Run 对话框自动打开了某个窗口,然后通过 Run 语句打开了一个 NotePad 窗口, 那么该 CloseDscendentProcessed 方法的返回值就就该是 2,因此 Message 对话框显示的信息应该是

2 . Sub CloseDescendentProcesses_Example() SystemUtil.Run Notepad.exe MsgBox SystemUtil.CloseDescendentProcesses End Sub CloseProcessByHwnd Method Description Closes a process that is the owner of a window with the specified handle. 根据窗口的句柄找到相应的进程,并关闭该进程. Syntax object.CloseProcessByHwnd (hWnd) Argument Description object A test object of type SystemUtil. SystemUtil 类型的测试对象. hWnd Required. An ULong object. The handle of the window owned by the process you want to close. Tip: You can retrieve the window handle using the hwnd property. For example: Window( MyAppName ).GetROProperty( hwnd ) 必须.一个 ULong 对象. 你想要关闭的进程的窗口的句柄. Tip:你可以通过获取 Runtime 窗口对象的 hwnd 属性值来获得句柄信息.例如: Window( MyAppName ).GetRoProperty( hwnd ) Return Value A Boolean value. 一个 Boolean 值. ? True--The specified process was successfully closed. TrueDD指定的进程已被成功关闭. ? False--The specified process was not closed. FalseDD指定的进程未被关闭. Remarks Note: QuickTest initially tries to close the process by sending a WM_CLOSE message to the process window. If the process is still open after

5 seconds, QuickTest terminates the process. 注意:执行该语句时,QuickTest 首先向进程窗口发送一个 WM_CLOSE 信息,偿试关闭该进程;

如果该进程在

5 秒钟后存未 关闭,则QuickTest 强制结束进程. Example Close the Process that is an Owner of a Window with the Specified Handle 在本例中,首先通过 GetroProperty 方法获取 NotePad 窗口的句柄,然后使用 CloseProcessByHwnd 方法关闭 Notepad 程序. Sub CloseProcessByHwnd_Example() hWnd = Window( Notepad ).GetROProperty( hwnd ) SystemUtil.CloseProcessByHwnd (hWnd) End Sub CloseProcessById Method Description Closes a process according to its Process ID (PID). 根据进程的 Process ID(PID)关闭进程. Syntax object.CloseProcessById (wdProcessId) Argument Description object A test object of type SystemUtil. SystemUtil 类型的测试对象. wdProcessId Required. An ULong object. The Process ID (PID) of the process you want to close. Tip: You can find the PID of an application by viewing the value in the Processes tab of the Windows Task Manager, or you can retrieve the value using the process id property. For example: Window( MyAppName ).GetROProperty( process id ) 必须.一个 ULong 对象. 你想关闭的进程的 PID. Tip:在Windows 的任务窗口的进程标签页可以查看到程序的 PID 值,你也可以通 过获取 Runtime 窗口对象的 Process id 属性值来获得 PID 信息.例如: Window( MyAppName ).GetRoProperty( process id ) Return Value A Boolean value. 一个 Boolean 值. ? True--The specified process was successfully closed. TrueDD指定的进程已被正常关闭. ? False--The specified process was not closed. FalseDD指定的进程未被关闭. Remarks Note: QuickTest initially tries to close the process by sending a WM_CLOSE message to the process window. If the process is still open after

下载(注:源文件不在本站服务器,都将跳转到源网站下载)
备用下载
发帖评论
相关话题
发布一个新话题