| 2952 | |
| 2953 | |
| 2954 | void WinGetControlList(ResultToken &aResultToken, HWND aTargetWindow, bool aFetchHWNDs) |
| 2955 | // Caller must ensure that aTargetWindow is non-NULL and valid. |
| 2956 | // Every control is fetched rather than just a list of distinct class names (possibly with a |
| 2957 | // second script array containing the quantity of each class) because it's conceivable that the |
| 2958 | // z-order of the controls will be useful information to some script authors. |
| 2959 | { |
| 2960 | control_list_type cl; // A big struct containing room to store class names and counts for each. |
| 2961 | if ( !(cl.target_array = Array::Create()) ) |
| 2962 | _f_throw_oom; |
| 2963 | CL_INIT_CONTROL_LIST(cl) |
| 2964 | cl.fetch_hwnds = aFetchHWNDs; |
| 2965 | EnumChildWindows(aTargetWindow, EnumChildGetControlList, (LPARAM)&cl); |
| 2966 | _f_return(cl.target_array); |
| 2967 | } |
| 2968 | |
| 2969 | |
| 2970 | |