routine GetProcessChildWindows module = rad4sas minarg = 2 maxarg = 2 returns = long ; arg 1 input num byvalue format=pib4. ; arg 2 input num byvalue format=pib4. ; * * Special information: * * A process can own more than one window. A window can have zero or more child windows. * * arg 1 is the ADDRESS of a SAS data step temporary 2 dimensional array of dimension [N,2] * each element of this array is FOUR (4) bytes so as to hold a 32 bit value that is a * Win32 window handle (HWND). * An array of character type $4 ensures proper allocation and array layout. * The array elements will need to be processed as pib4. to extract the HWND value. * arg 2 is N, the number of rows in the temporary array * * Each row of the array contains the HWND of a top-level parent and one of its child windows * The [,1] element will contain the parent HWND and * the [,2] element will contain a child HWND * * The first encounter of a top-level window will indicate a child window zero (0). * This is handy for the cases in which a top-level window does not have child windows * * If the N passed in arg 2 is too large for the space allocated for the array addressed in arg 1 * then catastrophic system failure could occur when/if the .dll tries to write to a memory space * not part of the array * * When there are more windows than space for their information (as indicated in arg 2) the .dll * will NOT go out of bounds. Any windows information past the input bound (N) will be disregarded * * The function returns a long whose high byte is the number of top-level windows owned by the SAS session * and the low byte is the number of top-level plus the number of child windows owned by the SAS session * * The SAS data step should check the return code to ensure no window enumeration was missed * (e.g. the low byte of the return code is larger than the array size) *;