gpt4 book ai didi

c# - 如何在 C# 中使用 sendkeys 发送键盘组合 Shift+Win+LEFT?

转载 作者:太空宇宙 更新时间:2023-11-03 14:57:27 26 4
gpt4 key购买 nike

<分区>

我一直在尝试使用键盘组合键 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}");
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com