Skip to content

Instantly share code, notes, and snippets.

@fushnisoft
Created March 28, 2012 11:43
Show Gist options
  • Save fushnisoft/2225570 to your computer and use it in GitHub Desktop.
Save fushnisoft/2225570 to your computer and use it in GitHub Desktop.
Determine which monitor form is on (Clarion.Net)
(I assume that you have your own Rectagle fom the .Net window, I have created one here as a test)
thisScreen OF Screen = Screen.FromControl(SELF) ! <-- screen this form is currently on
! Get a Rectangle to use in our test below.
rect OF Rectangle = NEW Rectangle(thisScreen.Bounds.X, thisScreen.Bounds.Y, thisScreen.Bounds.Width, thisScreen.Bounds.Height)
! Loop through all known screens and test to see if our rectangle is on one of them
s OF Screen &= NULL ! Not sure if there is an "inline" way to do this in clarion...
FOREACH s IN Screen.AllScreens
IF s.Bounds.IntersectsWith(rect)
Stop('current window is on s.DeviceName=' & s.DeviceName)
END
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment