PDA

View Full Version : Monitoring dialog titles every 20sec


floopyb
12-01-2008, 03:25 AM
Is there a way to set a script to run every 20 seconds? I want to monitor the active dialog name to be able to report fumefx progress to deadline from a slave.
I have seen this code:
fn checkDialog = (
local hwnd = dialogMonitorOps.getWindowHandle()
local dialogTitle = uiAccessor.getWindowText hwnd
print dialogTitle
true
)
dialogMonitorOps.interactive = false
dialogMonitorOps.unregisterNotification id:#test
dialogMonitorOps.registerNotification checkDialog id:#test
dialogMonitorOps.enabled = true
but the fume dialog name changes and i cant get it to update when it does.
Cheers.

ZeBoxx2
12-01-2008, 11:23 AM
How To … Call a MAXScript Function Periodically using DotNet



theTimer = dotNetObject "System.Windows.Forms.Timer"
dotnet.addEventHandler theTimer "tick" checkDialog
theTimer.interval = 20000
theTimer.start()

floopyb
12-01-2008, 01:57 PM
ahhh, thankyou ZeBoxx2. I did check the max help but sometimes its hard to know what to search for!
Cheers again :)

CGTalk Moderation
12-01-2008, 01:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.