问题
Suppose the computer has two monitors: Mon1 and Mon2. Notepad is on Mon2. I know the handle of its window. Can I move the window from Mon2 to Mon1 programmatically? What Windows API should I use? I have found the following candidates, but their documentation does not mention monitors.
SetWindowPos
SetWindowPlacement
MoveWindow
If anyone is interested in why I am trying to do this, this is because sometimes I need to move a window from Mon2 to Mon1 while the window is obscured by a full-screen always-on-top window or Mon2 is turned off.
来源:https://stackoverflow.com/questions/41531147/windows-api-for-moving-a-window-to-a-specific-monitor