Last active
October 13, 2019 10:49
-
-
Save stevechap416/c395be23ebf02ba5e67cac5c9a94303d to your computer and use it in GitHub Desktop.
Maxscript: Simple DialogMonitorOPS and uiAccessor Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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