[multiple-monitors] What determines the monitor my app runs on?

I've noticed that if I put a shortcut on my desktop on one screen the launched application may appear on that screen (if that app doesn't reposition itself).

This also applies to running things from Windows Explorer - if Explorer is on one screen the launched application will pick that monitor to use.

Again - I think this is when the launching application specifies the default (windows managed) position. Most applications seem to override this default behavior in some way.

A simple window created like so will do this:

hWnd = CreateWindow(windowClass, windowTitle, WS_VISIBLE | WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, SW_SHOW, CW_USEDEFAULT, 0, NULL, NULL, hInst, NULL);