Grasshopper

algorithmic modeling for Rhino

I've written a component that determines the dimensions and locations of all of a user's active screens, and identifies on which screen the Rhino window is located.  I'd like to use this information to update various UI elements.

Is there a way to listen to the window position of the main Rhino window, and/or get an event notification when after a user has dragged and dropped the Rhino window?

I've dug around in .NET documentation and the only thing I've found is in the System.Windows namespace, which is related to WPF applications only (and wouldn't apply to Rhino).  Any thoughts?


Thanks,

Marc

Views: 538

Replies to This Discussion

Hi there -- 

Thanks for the suggestions.  I'm a bit new to this low-level stuff, so if I could trouble you for a few more answers that would be great.  

1) First, VS doesn't recognize the DLL import syntax that is shown on that example page.  I tried finding the dll myself and importing into my project, but got an "invalid" error:

2) By what method do you recommend "observing the position constantly"?  Which event stream am I following?  In the sample code at the link, there is only an onClick type event, as opposed to a window listener.

Any thoughts/sample code is much appreciated.

Thanks!

Marc

System.Windows.Forms is the UI framework Grasshopper 1.0 is based on, but Rhino itself is an MFC application (C++, not .NET). Tom's suggestion will work, but will limit your code to Windows only. And you may even have trouble with different versions of Windows (although unlikely, it's a pretty simple method that's been around for ages).

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service