The x and y parameters determine the location of the new window. This point can be located anywhere on the virtual screen (all rectangles of the monitor are combined).
If you want to create a window on the same monitor as another window, you can call MonitorFromWindow . Otherwise, you can list all monitors using EnumDisplayMonitors .
In any case, if you have an HMONITOR handle, you should then call GetMonitorInfo . Your x and y parameters must be a value inside the rcWork section in the monitor information structure. Usually you select values ββthat put your window in the center of this rectangle.
It is important to use the workarea rectangle rather than the full monitor rectangle, because you do not want your window to appear under the taskbar and other application panels always on top.
source share