以下のコードを理解するのに苦労しています。そして、私はそれについての良い説明に罰金を科すことはできません。質問があるコード セグメントの横にコメントを残しました。
void LeftClick ( )
{
INPUT input = {0};
// left down
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
::SendInput(1,&input,sizeof(INPUT));
// left up
::ZeroMemory(&input,sizeof(INPUT)); // why zeroMemory? removing this code changes nothing that i can tell
input.type = INPUT_MOUSE; // why reset this variable? is it not already set?
input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
::SendInput(1,&input,sizeof(INPUT));
}
http://forums.codeguru.com/showthread.php?377394-Windows-SDK-User-Interface-How-can-I-emulate-mouse-events-in-an-applicationでこのコードを取得しました