Can Sketchup receive Window message?
-
This is what I've done so far: wrote a plugin using "Win32API" to send message to other program (e.g. tell ABC.exe to calculate sth..). But now I want to let SU knows the calculation is finished in ABC.exe (e.g. may be sending WM_COPYDATA message back to SU). Is there any callback function in SU can be used to check it?
Thanks
-
OR.. you could create a hidden Win32 window (off screen,) with an edit control, and send the data to that control.
When the control is populated, you read it with Win32API call from Ruby. -
Thank you so much!! The ABC.exe is written by me and I will take a look at Win32ole first.
By the way, I have been thinking about using DLL to receive message and then call a ruby function to collect the data. But it seems not easy to run ruby on Visual studio so I finally give up. -
Maybe you can make a Ruby C Extension work for you?
-
No, sorry. The reason is the API tries to be cross-platform, and I believe OSX does not use inter-window messaging like MS Windows does.
Did YOU write the program ABC.exe ???
Or is ABC.exe a command line program, and does it output it's results to
STDOUT
??If so, use "win32ole.so" (class
WIN32OLE
in Ruby,) instead of Win32API.
http://msdn.microsoft.com/en-us/library/ateytk4a(v=vs.84)The Ruby version looks most like the Javascript example.
Ref:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_windows.htmland "Windows Automation" on this page:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.htmlAlso.. search this forum for examples of using the Windows Scripting Host via class
WIN32OLE
in Ruby. -
@thomthom said:
Maybe you can make a Ruby C Extension work for you?
Ruby C extension? seems useful! thanks.
-
@debbie said:
@thomthom said:
Maybe you can make a Ruby C Extension work for you?
Ruby C extension? seems useful! thanks.
I made a Hello World project for getting Ruby C Extensions to work under SketchUp:
https://bitbucket.org/thomthom/sketchup-ruby-c-extension
Advertisement