keybd_event Src for winAPI


void WINAPI keybd_event( BYTE bVk, BYTE bScan,
                         DWORD dwFlags, ULONG_PTR dwExtraInfo )
{
    INPUT input;

    input.type = INPUT_KEYBOARD;
    input.u.ki.wVk = bVk;
    input.u.ki.wScan = bScan;
    input.u.ki.dwFlags = dwFlags;
    input.u.ki.time = GetTickCount();
    input.u.ki.dwExtraInfo = dwExtraInfo;
    SendInput( 1, &input, sizeof(input) );
}

 

 

From:

 

http://www.google.cn/codesearch?hl=zh-CN&q=keybd_event+show:yYzRxohH9go:uGS7WzbcszM:bnuobYWiXzc&sa=N&cd=1&ct=rc&cs_p=http://gentoo.osuosl.org/distfiles/Wine-20050930.tar.gz&cs_f=wine-20050930/dlls/user/input.c

你可能感兴趣的:(keybd_event Src for winAPI)