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
WIN32OLEin 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
WIN32OLEin 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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement