I've been trying to send a focused window to the second monitor using the keyboard combination keys Shift+Win+LEFT using sendkeys in c#, but for some reason the window isn't moving to the second monitor. It works when I physically press on these keys on the keyboard but not pragmatically. Note I already know how to bring my desired window to foreground and it's working fine now I wanna send that desired window to the second monitor using the keyboard combination using c# Shift+Win+LEFT I don't want to use the SetWindowPos(proceso.MainWindowHandle, 0, monitor.Left, monitor.Top, monitor.Width, monitor.Height, 0);
here are my attempts that I've tried Thank you in advance looking forward for your help btw I'm still searching and trying.
trial 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}");
}
trial 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}");
}
trial 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}");
}
trial 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}");
}
trial 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}");
}
trial 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}");
}