View Full Version : Just thinkin outloud, Low level interfacing with LW

01-09-2008, 03:32 AM
Does anyone know if LW allows for a low level interface to say Layout so it is possible to run command via a third party application, say using a function using something like ::SendMessage(w,WM_COPYDATA, (UINT)m_hWnd,(long)&cds); to send a message to the Layout window?

Just thinking outloud, before i focus my programming lessons on a useless subject i rather poll if my time is better spend.

01-09-2008, 01:08 PM
For inter-Lw plugin communication, I sometimes use files. You could do this with 3rd party app, write to a file, LW checks for the file (or a changeID, which is random everytime its written... if changeID!=oldChangeID) and process.

BUT-- I don't know if LW will check for events unless a user drives it. MasterHandler?

01-09-2008, 05:47 PM

Some thought of the top...

Should work. I once wrote a VB app that communicated that way - and I think most keystroke recorders work that way.

But I also think there are inherent dangers in doing that since it can be impossible to know if a command has actually finished. That's why commands are usually send via a LW.dll that "cooperates" with LW internally.

But I think you can use the LW Ring to externally communicate.
If so, you could send commands that are internally executed by a native LW.dll.
that way commands could be internally stacked and executed sequentially.

01-10-2008, 05:02 AM
Ah, well, i asked as i wanted to be able to have SciTe just run a Lscript without having to save, go to Layout run script.

I want it to behave more like the Maya MEL editor (but with syntax highlighting and collapse functions), as i'm seriously getting fed up with the insane amount of bugs that are in the Lscript commander and the LSED (unstable, drawing errors, overal weirdness and frequent crashes)

So, since SciTe allows you to run custom commands to a program i thought i might have SciTe save to a custom temp Lscript that is already registered in LW as a plugin and have SciTe run said temp LScript by communicating via said method.

It's a lot of work to get around some extra mouse clicks, but it is also a bit of learning for me as i try to get to grips with C, C++.

01-10-2008, 06:00 PM
What about having a Master lscript or plugin which blocks, waiting for some outside signal from SciTe (e.g. an environment variable being set, or a network port if you want to get fancy), and then runs the script indicated by the signal?

It is also possible to start Layout with a given scene file by giving the path/name of the scene file on the command line. So you could construct a scene file with a reference to a Master lscript which is run when the scene has been loaded, and then launch Layout with it.