[Maxscript] Get current Screen Resolution in a Multi-Screen Environment

polycounter lvl 11
Offline / Send Message
SimonT polycounter lvl 11
Hi! I try to fit the height of a rollout to the height of the screen it is put on after drag&dropping it (moved-event handler). This means, that if you have several screens (in my case I've 3) with different resolutions, the rollout must notice the height-differences depending on where you put the rollout.

Here an imaginary syntax i would love to have (not actual working code!!):
on myRollout moved newPos do
(
    maxDimensions = getCurrentScreenRes(newPos.x, newPos.y)
    myRollout.height = maxDimensions.height - myRollout.pos.y
)

I can't use this, because it only returns the maximum values for ALL screens together (so if you have one with 1080px and one with 1200px height, the desktopSize will return 1200):
sysInfo.desktopSize

Also i can't use this because via DotNet you're only able to receive the size of the primary screen or ALL screens. In my case i've 3 monitors all with different resolutions. Also i wouldn't know on which screen my rollout currently is located:
(dotNetClass "System.Windows.Forms.Screen").PrimaryScreen.Bounds

Any ideas how to get the screen resolution of the "current" screen after you drag&dropped a rollout around?

Replies

Sign In or Register to comment.