ポインター/タッチ メッセージを正常に挿入できますが、すべてのメッセージがエラーなしで正常に挿入されたにもかかわらず、アプリケーションに挿入されたすべてのメッセージを受信できません (メッセージはアプリケーションでキャプチャされます)。問題の提案/解決策を提供してください。
InitializeTouchInjection(10, TOUCH_FEEDBACK_INDIRECT);
//
// initialize the touch info structure
//
memset(&contact, 0, sizeof(POINTER_TOUCH_INFO));
contact.pointerInfo.pointerType = PT_TOUCH; //we're sending touch input
contact.pointerInfo.pointerId = 0; //contact 0
contact.pointerInfo.ptPixelLocation.x = 300;
contact.pointerInfo.ptPixelLocation.y = 300;
contact.pointerInfo.pointerFlags = POINTER_FLAG_DOWN | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
contact.touchFlags = TOUCH_FLAG_NONE;
contact.touchMask = TOUCH_MASK_CONTACTAREA | TOUCH_MASK_ORIENTATION | TOUCH_MASK_PRESSURE;
contact.orientation = 90;
contact.pressure = 32000;
//
// set the contact area depending on thickness
//
// defining contact area (I have taken area of 4 x 4 pixel)
contact.rcContact.top = contact.pointerInfo.ptPixelLocation.y - 2;
contact.rcContact.bottom = contact.pointerInfo.ptPixelLocation.y + 2;
contact.rcContact.left = contact.pointerInfo.ptPixelLocation.x - 2;
contact.rcContact.right = contact.pointerInfo.ptPixelLocation.x + 2;
//
// inject a touch down
//
bRet = InjectTouchInput(1, &contact);
//Setting the Pointer Flag to Drag
contact.pointerInfo.pointerFlags = POINTER_FLAG_UPDATE | POINTER_FLAG_INRANGE | POINTER_FLAG_INCONTACT;
bRet = InjectTouchInput(1, &contact);
for(int i=0;i<100;i++)
{
contact.pointerInfo.ptPixelLocation.y--;
bRet =InjectTouchInput(1, &contact);
}
//
// if touch down was succesfull, send a touch up
//
if (bRet) {
contact.pointerInfo.pointerFlags = POINTER_FLAG_UP;
//
// inject a touch up
//
InjectTouchInput(1, &contact);
}