I want to simulate mouse moving,but I find it moves litter
and sometimes the display turns black screen,and after
a while the display recovers,why?how to solver?
Look:
Code:
void CCopyscrnDlg::OnButton1() 
{
INPUT mouseInput;
mouseInput.type = INPUT_MOUSE;
mouseInput.mi.dx = 0;
mouseInput.mi.dy = -1;
mouseInput.mi.dwFlags = MOUSEEVENTF_MOVE ;  
SendInput(1, &mouseInput, sizeof(INPUT));
}
void CCopyscrnDlg::OnButton2() 
{
INPUT mouseInput;
mouseInput.type = INPUT_MOUSE;
mouseInput.mi.dx = -1;
mouseInput.mi.dy = 0;
mouseInput.mi.dwFlags = MOUSEEVENTF_MOVE ;
SendInput(1,&mouseInput, sizeof(INPUT));
}
void CCopyscrnDlg::OnButton3() 
{
INPUT mouseInput;
mouseInput.type = INPUT_MOUSE;
mouseInput.mi.dx = 1;
mouseInput.mi.dy = 0;
mouseInput.mi.dwFlags = MOUSEEVENTF_MOVE ;  
SendInput(1, &mouseInput, sizeof(INPUT));
}
void CCopyscrnDlg::OnButton4() 
{
INPUT mouseInput;
mouseInput.type = INPUT_MOUSE;
mouseInput.mi.dx = 0;
mouseInput.mi.dy = 1;
mouseInput.mi.dwFlags = MOUSEEVENTF_MOVE ;
SendInput(1,&mouseInput, sizeof(INPUT));
}