ph_playwinmsg PowerHome formula function
Description
Plays back Windows messages to multiple located handles.
Syntax
ph_playwinmsg ( parentexe, parentclass, parenttitle, parentinstance, parentflags, childinfo, messages )
Argument Description
parentexe String. A string representing the filename of the parent processes executable.
parentclass String. The class of the process that is the parent of the process to be located.
parenttitle String. The title of the window that is the parent of the process to be located.
parentinstance Integer. The instance of the parent whose child process you're locating. The first instance is 0.
parentflags Integer. Flags representing which of the previous parameters to use for locating the parent. Individual values should be added. 1 - Use parentexe, 2 - Use parentclass, 4 - Use parenttitle exact, 8 - Use parenttitle partial.
childinfo String. A string identifying the multiple child processes whose handles to have messages played to.
messages String. The string of Windows messages to be played.
Return value
Integer. Returns 0 if successful. 1 if the parent cannot be found, 2 if a child cannot be found, 3 if an index referenced in the message does not exist, 4 if childinfo is malformed on childtitle, 5 if childinfo is malformed on childinstance, 6 if childinfo is malformed on childflags, 7 if messages is malformed on msg, 8 if messages is malformed on wparam, 9 if messages is malformed on lparam
Usage
Use this function to playback complicated sequences of Windows messages to multiple dynamic Windows processes and handles. Use the PowerHome Object Spy window to assist in creating functions of this type.

The childinfo parameter contains 0 or more child process "indexes", each index entry containing class, title, instance, and flags all separated by tabs. The parent is considered index 1 with the first child entry considered index 2. See ph_locatehandle for an explanation of the childinfo entries. A typical childinfo entry containing two indexes may look like this: "Notepad~tUntitled - Notepad~t0~t7~tEdit~t~t0~t3~t".

The messages parameter consists of 1 or more messages to be sent to an index. Each individual message consists of 4 parameters separated by commas. These parameters are: index, msgnum, wparam, and lparam.