我一直在尝试使用键盘组合键 Shift+Win+LEFT 在 c# 中使用 sendkeys 将聚焦窗口发送到第二台显示器,但由于某种原因,窗口没有移动到第二台显示器。当我实际按下键盘上的这些键但不实用时,它会起作用。注意我已经知道如何将我想要的窗口带到前台并且它现在工作正常我想使用键盘组合使用 c# Shift+Win+LEFT 将那个想要的窗口发送到第二台显示器我不想使用 SetWindowPos(proceso. MainWindowHandle, 0, monitor.Left, monitor.Top, monitor.Width, monitor.Height, 0);
这是我尝试过的尝试预先感谢您期待您的帮助,顺便说一句,我仍在搜索和尝试。
试验 1:
private void btnSendToSecondDisplay_Click(object sender, EventArgs e)
{
bringToFront("Task Manager");//This lets the "task manager" window to be in the foreground and has the focus set to it
SendKeys.Send(Keys.ShiftKey.ToString());
SendKeys.Send(Keys.LWin.ToString());
SendKeys.Send("{LEFT}");
}
试验 2:
private void btnSendToSecondDisplay_Click(object sender, EventArgs e)
{
bringToFront("Task Manager");//This lets the "task manager" window to be in the foreground and has the focus set to it
SendKeys.Send("+"+Keys.LWin.ToString()+"{LEFT}");
}
试验 3:
private void btnSendToSecondDisplay_Click(object sender, EventArgs e)
{
bringToFront("Task Manager");//This lets the "task manager" window to be in the foreground and has the focus set to it
SendKeys.Send("+"+Keys.LWin.ToString()+"{LEFT}");
}
试验 4
private void btnSendToSecondDisplay_Click(object sender, EventArgs e)
{
bringToFront("Task Manager");//This lets the "task manager" window to be in the foreground and has the focus set to it
SendKeys.Send("{SHIFTDOWN}");
SendKeys.Send("{APPSKEY}");
SendKeys.Send("{LEFT}");
}
试验 5
private void btnSendToSecondDisplay_Click(object sender, EventArgs e)
{
bringToFront("Task Manager");//This lets the "task manager" window to be in the foreground and has the focus set to it
SendKeys.Send("{SHIFTDOWN}{APPSKEY}{LEFT}");
}
试验 6
private void btnSendToSecondDisplay_Click(object sender, EventArgs e)
{
bringToFront("Task Manager");//This lets the "task manager" window to be in the foreground and has the focus set to it
SendKeys.Send("+");
SendKeys.Send(Keys.LWin.ToString());
SendKeys.Send("{LEFT}");
}
我是一名优秀的程序员,十分优秀!