Dual Screen; setting window attribute to a default screen

palthe

Member
Is it possible, in a dual screen setup, to default a window to a predefined screen through it's attributes? Or should I make use of a system32 call or something like it? Where does the X and Y attributes default to in such a setup?

I need one window of my application to open default in the left screen, for example.

Thanks in advance.
 

Cecil

19+ years progress programming and still learning.
I have two monitors setup on my computer side-by-side. The Right Monitor is Windows "Primary Monitor" and the Left Monitor is the extended one.

All I did was to add a negative value to the X coordinates for the window to appear on the left monitor.

The problem is not how to set the X & Y coordinates but how to find the position of the second (or more) monitor(s) relative to the Primary Monitor. This might be a Windows DLL call or a registry hack. I don't know. Sorry.

Try this to help you get on you way:

Code:
MAIN-BLOCK:
DO ON ERROR   UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
   ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
  RUN enable_UI.
  /* Display the window on the monitor on my left as the primary monitor is on the right.*/
  C-win:X = (SESSION:WORK-AREA-WIDTH-PIXELS * -1) + 66.
  c-Win:Y = 66.

  IF NOT THIS-PROCEDURE:PERSISTENT THEN
    WAIT-FOR CLOSE OF THIS-PROCEDURE.
END.
 

Cecil

19+ years progress programming and still learning.
Just Done a quick Google and I found this:
http://www.microsoft.com/msj/0697/monitor/monitor.aspx

Looks like you need to make a call the Windows API GetSystemMetrics Function to get the virtual width & height and also get the upper top left position of your Virtual Screen Area of your multi monitor display setup. Plus some simple maths.

In hind site this should be a code request improvement to Progress to return these values from the SESSION system handler.

Hope this helps.
 
Top