Message 1 of 19
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How to open the mxs listener window from C++?
I tried 'actionMan.executeAction 1 "40472"' but it does not open..
Solved! Go to Solution.
How to open the mxs listener window from C++?
I tried 'actionMan.executeAction 1 "40472"' but it does not open..
Solved! Go to Solution.
No idea how to open the main MXS listener, but there is also the log mechanism - maybe that is useful?
Ok. But I still cannot open a window to the user.
If I had to do this myself, I would rather implement my own message handling.
My hope was to simply open the Listener.
So, something like this is not working:
ExecuteMAXScriptScript("actionMan.executeAction 1 40472", MAXScript::ScriptSource::NonEmbedded, TRUE, &res);
In 3ds max, when I use F11 this is printed in the Listener each time. Once it open the Listener, then it closes it.
actionMan.executeAction 0 "40472" -- MAX Script: Scripting Listener
There also is the WindowStream class - maybe that works for your needs?
Here is the code:
Value*
turnOnScriptingListener_cf(Value** arg_list, int count)
{
BOOL quietErrors = TRUE;
FPValue result = NULL;
ExecuteMAXScriptScript(_T("actionMan.executeAction 0 \"40472\""), MAXScript::ScriptSource::NonEmbedded, quietErrors);
return &undefined;
}
Yes, running
actionMan.executeAction 0 "40472"
in a new MAXScript also toggles the MXS Listener on and off, same what F11 does...
Yep. The:
actionMan.executeAction 1 "40472"
does nothing for me. It only prints FALSE in the Listener.
I think that this: actionMan.executeAction 0 "40472" is enough. There are ways to check if the Listener window is actually open, so if it is not the
ExecuteMAXScriptScript(_T("actionMan.executeAction 0 \"40472\"")
can be run to open it.
Wahhh this drives me crazy - it toggles the visibility. Thanks Miauu and Martin!
Now I need a function to find out if's already open..
Just FYI, this seems to work well:
w = newScript() -- create new text window
print "Hello world" to:w -- simple way to output to new window
-- replace text of new window
h = w.hwnd
txt = "Some new text, replacing the entire window text"
-- get IntPtr to txt
marshal = dotnetclass "System.Runtime.InteropServices.Marshal"
ptr = marshal.StringToHGlobalUni txt
-- set text of new window
res = windows.sendMessage h 0xc 0 ptr
deleted