Skip to content

Instantly share code, notes, and snippets.

@stevechap416
Last active October 13, 2019 10:49
Show Gist options
  • Save stevechap416/c395be23ebf02ba5e67cac5c9a94303d to your computer and use it in GitHub Desktop.
Save stevechap416/c395be23ebf02ba5e67cac5c9a94303d to your computer and use it in GitHub Desktop.
Maxscript: Simple DialogMonitorOPS and uiAccessor Test
--Global Variables
global hwnd
fn checkDialogs = (
hwnd = dialogMonitorOps.getWindowHandle()
dialogTitle = uiAccessor.getWindowText hwnd
print(dialogTitle)
true
)
--Create test rollout
rollout CheckDialogTest "Check Dialog Test" width:200 height:95
(
button onButton "Dialog Monitor On" height:40
button offButton "Dialog Monitor Off" height: 40
on onButton pressed do (
--Add and start the dialog monitoring
dialogMonitorOps.interactive = false
dialogMonitorOps.unregisterNotification id:#test
dialogMonitorOps.registerNotification checkDialogs id:#test
dialogMonitorOps.enabled = true
)
on offButton pressed do (
dialogMonitorOps.enabled = false
dialogMonitorOps.unregisterNotification
)
on CheckDialogTest closed do (
dialogMonitorOps.enabled = false
dialogMonitorOps.unregisterNotification
)
)
createdialog CheckDialogTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment