ph_processfromhandle PowerHome formula function
Description
Returns the process that is associated with the specified handle 
Syntax
ph_processfromhandle ( al_handle )
Argument Description
al_handle Long. The handle you would like to get the process for
Return value
Long. Returns the process associated with the handle in al_handle 
Usage
Use this function to get the process for a handle. 

A handle is a numeric reference that identifies an object in the operating system. A window has a handle. A menu has a handle. Individual components on a window may also have a handle. The ph_handle( ) function returns the handle that is assigned to the PowerHome program. You can use the Window Spy screen under the PowerHome Maintenance menu to inspect the handles of various operating system objects. You can also use the ph_locatehandle( ) and ph_locatehandle1( ) functions to programmatically determine the handles of objects.

A process is a numeric reference that is assigned to an executing program. If you launch a notepad.exe window, the window will have a handle, the menu will have a different handle, the area where you type characters will have a handle. All of these handles are ultimately associated with the process that spawned their creation. By supplying any of the handles associated with a particular running instance of notepad.exe, this function will return the process. When you have a process, you can then use functions such as ph_killprocess( ) to terminate the execution of a process.

Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_processfromhandle(ph_findwindow("Untitled - Notepad",1)) - Returns the process associated with the handle of a running instance of notepad.exe