Interface: UIAccessor

new.gif NEW in 3ds Max 9: The UIAccessor interface provides methods to collect data and interact with dialogs and popups in the 3ds Max User Interface. It can be used in conjunction with the Interface: DialogMonitorOPS to perform automated UI handling using a callback function.

 

Methods:

<string>GetWindowText <HWND>hwnd

Returns the caption of the of the window with the given handle.

<string>GetWindowClassName <HWND>hwnd

Returns the window class name of the window with the given handle.

<integer>GetWindowResourceID <HWND>hwnd

Returns the window resource ID of the window with the given handle.

<HWND by value array>GetChildWindows <HWND>hwnd

Returns an array with the handles of all child windows of the window with the given handle. If a child window has child windows on its own, these will also be enumerated.

<HWND by value array>GetPopupDialogs()

Returns a handles array of the pop up dialogs.

<HWND>GetParentWindow <HWND>hwnd

Returns the parent window's handle of the window with the given handle.

<HWND>GetFirstChildWindow <HWND>hwnd

Returns the handle of the first child of the window with the given handle.

<HWND>GetPrevWindow <HWND>hwnd

Returns the handle of the previous sibling with the same parent as the window with the given handle.

<HWND>GetNextWindow <HWND>hwnd

Returns the handle of the next sibling with the same parent as the window with the given handle.

<bool>IsWindow <HWND>hwnd

Returns true if the UI element with the given handle is a window, false otherwise.

<string>GetWindowDllFileName <HWND>hwnd

Returns the DLL file name of the window with the given handle.

<string>GetWindowDllDescription <HWND>hwnd

Returns the DLL description string of the window with the given handle.

<void>CloseDialog <HWND>hwnd

Closes the dialog with the given window handle.

<void>PressDefaultButton()

Presses the default button in the dialog with the given handle.

<void>PressButton <HWND>hwnd

Presses the button with the given handle.

<bool>PressButtonByName <HWND>hwnd <string>name

Presses the button with the name equal to the second argument in the dialog with the handle given as the first argument.

<bool>SetWindowText <HWND>hwnd <string>text

Sets the title text of the dialog with the given handle.

<bool>SendMessageID <HWND>hwndDlg <enum>ID

ID enums: {#IDOK|#IDCANCEL|#IDABORT|#IDRETRY|#IDIGNORE|#IDYES|#IDNO|#IDCLOSE}

Sends the message ID given in the second argument to the window with the given handle.

<bool>SendMessage <HWND>hwndDlg <integer>MessageID <integer>wParam <integer>lParam

Sends the integer message ID, wParam and lParam given in the second, third and fourth arguments to the window with the handle given as the first argument.

For Example:

DialogMonitorOPS.unRegisterNotification id:#eyeInTheSky

 

fn dmnotification =

(

 WindowHandle = DialogMonitorOPS.GetWindowHandle()

 format "Dialog Window Handle: %\n" WindowHandle

 format "Dialog Name: %\n" (UIAccessor.GetWindowText WindowHandle)

 format "Window Class Name: %\n" (UIAccessor.GetWindowClassName WindowHandle)

 format "Window Resource ID: %\n" (UIAccessor.GetWindowResourceID WindowHandle)

 format "Is Window: %\n" (UIAccessor.isWindow WindowHandle)

 format "Window DLL Filename: %\n" (UIAccessor.GetWindowDllFileName WindowHandle)

 format "Window DLL Description: %\n" (UIAccessor.GetWindowDllDescription WindowHandle)

 UIAccessor.SetWindowText WindowHandle "All Your Windows Are Belong To Us"

 format "=====================\n"

 true

)

DialogMonitorOPS.RegisterNotification dmnotification id:#eyeInTheSky

DialogMonitorOPS.Enabled = true

DialogMonitorOPS.ShowNotification()

See also

Interface: DialogMonitorOPS