Notifications
Clear all
[Closed] How to enumerate controls in [Common] page in Render Scene Dialog?
Jan 23, 2013 8:25 am
I tried DialogMonitorOPS and UIAccessor.
fn print_allctrl hwnd = (
-- [Common] page is not in the array
local h_array = UIAccessor.GetChildWindows(hWnd)
if (h_array != unefined) then (
format "===Control Count: [%]===
" (h_array.count)
for v=1 to h_array.count do (
local txt = (UIAccessor.GetWindowText(h_array[v]))
local cls = (UIAccessor.GetWindowClassName h_array[v])
format "Control: [%] [%]
" cls txt
)
)
)
fn print_rsdlg = (
local rs_dlg = "Render Setup:*"
local h = DialogMonitorOPS.GetWindowHandle()
local title = UIAccessor.GetWindowText(h)
format "Window Opened: [%]
" title
if title != undefined and (matchPattern title pattern:rs_dlg) then (
print_allctrl h
)
true
)
DialogMonitorOPS.RegisterNotification print_rsdlg id:#rsdlg
DialogMonitorOPS.enabled = true
When I execute the script and open RenderSceneDialog, I can’t find [Common] page.
How to enumerate controls in [Common] page ?
Thanks.
4 Replies
Jan 23, 2013 8:25 am
DialogMonitorOps is not very necessary here because it’s not a modal dialog. I try not to use it unless absolutely necessary, it’s a bit buggy.
I recommend you use WindowShopper to see the exact structure of the UI. Here’s a preview:
Jan 23, 2013 8:25 am
It works. Using windows.getChildrenHwnd can get the [Common] page, but UIAccessor.GetChildWindows can’t.
Thanks again.
Jan 23, 2013 8:25 am
This is because windows.getChildrenHwnd is recursive while uiaccessor is not. You can see from the image there are many levels between the main window and the common dialog