Title: How do I center a window on the desktop?

To center a window use W$CENTER_WINDOW. Pass the window handle to this library to center the window on the current screen:

   call "W$CENTER-WINDOW"  using windowHandle
You can also pass the screen index to center your screen on a different monitor.
Use C$MONITOR's opcode GET-NO-MONITOR to get the number of monitors available and pass the number of the monitor you want to center your application in:
   call "C$MONITOR" using cmonitor-get-no-monitor
                          monitor-count, 
                          main-index.
   if monitor-count >= 2
      call "W$CENTER-WINDOW" using windowHandle, 
                                   2
   end-if.
Use the inquire verb to get the current screen index
   inquire windowHandle, screen-index in scr-num.

Authored by: Veryant Support on Mon, Nov 1st, 2010 at 7:00 PM
This question has been viewed 8758 times so far.
Online URL: http://support.veryant.com/support/phpkb/question.php?ID=154

Powered by PHPKB Knowledge Base Software