Friday, June 3, 2011

SystemUtil object:


a.    CloseProcessByHwnd Method: Closes a process that is the owner of a window with the specified handle.
hWnd = Window("Notepad").GetROProperty("hwnd")
SystemUtil.CloseProcessByHwnd (hWnd)
b.    CloseProcessById Method: Closes a process according to its Process ID (PID).
PID = Window("Notepad").GetROProperty("process id")
SystemUtil.CloseProcessById (PID)
c.     CloseProcessByName Method: Closes a process according to its name.
SystemUtil.Run "Notepad.exe"
MsgBox SystemUtil.CloseProcessByName("Notepad.exe")
d.     Run Method: Runs a file or application.
Syntax: SystemUtil.Run ( FileName, Parameters, Path, Operation )
FileName - The name of the file you want to run.
Parameters - If the specified FileName is an executable file, use the Parameters argument to specify any parameters to be passed to the application.
Path - The default directory of the application or file.
Operation - The action to be performed. If this argument is blank (""), the open operation is performed.
The following operations can be specified for the operation argument of the SystemUtil.Run method:
open - Opens the file specified by the FileName parameter. The file can be an executable file, a document file, or a folder. Non-executable files are open in the associated application.
edit - Launches an editor and opens the document for editing. If the FileName argument does not specify an editable document file, the statement fails.
explore - Explores the folder specified by the FileName argument.
find - Initiates a search starting from the specified folder path.
print - Prints the document file specified by the FileName argument. If the specified file is not a printable document file, the statement fails.
Example:SystemUtil.Run "D:\My Music\Breathe.mp3","","D:\My Music\Details","open"

No comments: