I cannot seem to locate this in the help files for Rhinoscript? I’ve used this Windows Function in VBA for many years but cannot determine how to do this in Python.
In VBA I would access it this way:
Private Declare PtrSafe Function GetSystemMetrics32 Lib “user32” Alias “GetSystemMetrics” ( _
ByVal nIndex As LongPtr) As LongPtr
Private Sub GetWindowSize(lngWidth As LongPtr, lngHeight As LongPtr)
Set swApp = Application.SldWorks
swApp.Visible = True
swApp.UserControl = True
lngWidth = GetSystemMetrics32(0) ' width in points
lngHeight = GetSystemMetrics32(1) ' height in points
What I was trying to is open Excel and tile it next to Rhino. I have a high res touch screen monitor with a standard external 2nd monitor. It is a scaling issue with the laptop monitor. I solved it in VBA using Windows Api routines
that checked the pixel density of the laptop. It was a way to get two programs (at the time Solidworks and Excel) to take up a defined percentage of the screen.
In this case I want to determine my monitor resolution and pixel density and through formulas tile Excel on one side and Rhino on the other. Could be 50:50 or some other percentage. If there is an easier way to do this I’m all
for it. So far I have been successful opening and sizing Excel. I have yet to determine how to do this with Rhino.
OK, sounds smart.
For my needs the built in Windows10 "drag one app/programs to the side-edge of the monitor and then it automatically fills up 50% and then I choose what other software to fill the other 50% "- thing does the trick.