亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tramousestub.cpp

?? 這是一個ce5.0下usb hid的驅動源代碼
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
      _iStat1Buf[_iStat1Current][1] = (short)X;
      _iStat1Buf[_iStat1Current][2] = (short)Y;
      _iStat1Current++;
      
	  if(_iStat1Current==MAX_STATS)
         {
          HANDLE hFile = INVALID_HANDLE_VALUE;
          int i;

 
		  
		  _iStat1Current = 0;

             hFile = CreateFile(L"\\tchlogInner.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
             if(hFile!=INVALID_HANDLE_VALUE)
                {
                 DWORD dw = 0;
				 int   len;
				 int   j;
      
				 SetFilePointer(hFile, 0, NULL, FILE_END);

				   for (i = 0; i < MAX_STATS; i++)
				   {
				    TCHAR str[64];
					unsigned char str2[64];

                    wsprintf(str, L"%d %d %d %d %c%c", count++, (int)_iStat1Buf[i][1], (int)(3000 - _iStat1Buf[i][2]), (int)_iStat1Buf[i][0], (TCHAR)13, (TCHAR)10); 
  		            
					len = _tcslen(str); 
					if(len > 62) 
						len = 62;

					for (j = 0; j < len; j ++) 
						str2[j] = (unsigned char)str[j]; 
					str2[len] = 0;
					
					WriteFile(hFile, str2, len, &dw, NULL);

				   }

                   CloseHandle(hFile);
                }

         }
   }
#endif


   // if we don't have a callig client window or bad sample or we are ignoring samples,
   //  pass back to the system (so the app "underneath" transcriber will get them)
   if(_hClientWnd==NULL ||
      (Flags&TouchSampleValidFlag)==0 ||
      (Flags&TouchSampleIgnore)!=0)
     {
        // danger, hardcoded conversion
        // pass the event back to the mouse code, unless it was a wheel event
        //  in which case, evfMouse will be 0, because the wheel flags got masked off
        if (0 != evfMouse)
            mouse_event(evfMouse, dxMouse, dyMouse, 0, NULL); 
        return;
     }

//	Intercept points here
   // 1. test window at stroke begining 
   // 0x07 means pen down, valid, callib, but pen wasn't down for the previous pt
   if(Flags==0x07)
      {
         if(!IsWindow(_hClientWnd))
            {
               _hClientWnd = NULL;
               // danger, hardcoded conversion
               // pass the event back to the mouse code, unless it was a wheel event
               //  in which case, evfMouse will be 0, because the wheel flags got masked off
               if (0 != evfMouse)
                   mouse_event(evfMouse, dxMouse, dyMouse, 0, NULL);
               return;
            }

        // set flags 
        _iClientFlags = (int)GetWindowLong(_hClientWnd, 0);
        //just adjust

        if((_iClientFlags&TABLET_TEST_FIRST_POINT)!=0 &&
           !SendMessage(_hClientWnd, WM_PEGREC_FIRSTPOINT, 0, MAKELPARAM(X, Y)))
           {
              _iClientFlags = TABLET_ALL_TO_SYSTEM;
           }

        if((_iClientFlags&TABLET_SMART_TO_SYSTEM)!=0)
           _iClientFlags = _iClientFlags&(~TABLET_ALL_TO_SYSTEM);
           

        if((_iClientFlags&TABLET_SAVE_FOCUS_WND)!=0)
           {

                  //@todo - do we need FindForegroundFocusWindow( ) instead of GetForegroundWindow( )?
                  _hLastTouchFocusWnd = GetForegroundWindow();  
           }
        begTick = dwLastDelayTick = dwTick;
        _begX = iLastDelayX = X;
        _begY = iLastDelayY = Y;
        bClick = FALSE;
        bDelay = FALSE;
        bNear = TRUE;
      } // if(flgs==07)


   if((_iClientFlags&TABLET_SMART_TO_SYSTEM)!=0)
      {   
         // 2.  Is still near?
         if( bNear                          && 
             Flags==0x0f /*inter point*/   &&
            (Flags&TouchSampleDownFlag)!=0 &&
            (_begX-X>=iMaxClickDist || _begX-X<=-iMaxClickDist ||
             _begY-Y>=iMaxClickDist || _begY-Y<=-iMaxClickDist))
            {  // decision = no click and no initial delay => stop NEAR
               bNear = FALSE;
               if((_iClientFlags&TABLET_SEND_RELEASE_MSG)!=0)
                    SendPtToWnd((TouchSamplePreviousDownFlag|TouchSampleDownFlag|TouchSampleIgnore), X, Y);
                                   iLastDelayX = X;
                                   iLastDelayY = Y;
                                   dwLastDelayTick = dwTick;
					{
                       HANDLE  hThread=GetCurrentThread();
                       SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
					}
            }

         // IS CLICK?
         if( bNear                                     &&
             Flags==0x0d      /*LAST PT*/              &&
             (_iClientFlags&TABLET_CLICK_TO_SYSTEM)!=0 &&
             dwTick-begTick < dwMaxClickTime           &&
             begTick-_dwLastSendedTick > dwMinPauseBeforeClick) 
            {  //yes - it's click
              HWND hWndFgr = GetForegroundWindow();
              BOOL bPermition = TRUE;
               bClick = TRUE;
               _dwLastSendedTick = 0;
               if((_iClientFlags&(TABLET_SEND|TABLET_NEED_PERMITION))!=0)
                  bPermition = (BOOL)SendMessage(_hClientWnd, WM_PEGREC_MOUSECLICK, (WPARAM)hWndFgr, MAKELPARAM(_begX, _begY));
               else
                  PostMessage(_hClientWnd, WM_PEGREC_MOUSECLICK, (WPARAM)hWndFgr, MAKELPARAM(_begX, _begY));

			   // simulate a click to the app "below" Transcriber (since we already ate the points)
               if((_iClientFlags&TABLET_NEED_PERMITION)==0 || bPermition)
                  {
	               // danger, hardcoded conversion
	               // pass the event back to the mouse code, unless it was a wheel event
	               //  in which case, evfMouse will be 0, because the wheel flags got masked off
	               if (0 != evfMouse)
	               	{
	                      mouse_event(MOUSEEVENTF_LEFTDOWN, dxMouse, dyMouse, 0, NULL);     
	                      mouse_event(MOUSEEVENTF_MOVE, 0, 0, 0, NULL);   
	                      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, NULL);  
	               	}
                  }
               else
               {
                  return;
               }
            }

		 // we delay points to see if we should either treat this as a selection or see if 
		 //  we should send the point to the application "underneath" Transcriber,
		 //  or tap and hold.

         // IS INITIAL DELAY?
         if( bNear                                      &&
             Flags==0x0f   /*intermediate point*/       &&
             (_iClientFlags&TABLET_STARTDELAY_TO_SYSTEM)!=0  &&
             (dwTick-begTick>1200 ||
               (dwTick-begTick>dwMinStartDelayTime      &&
                begTick-_dwLastSendedTick>dwMinPauseBeforeClick)) ) 
            {  //Yes, it's initial delay
             BOOL bPermition = TRUE;
               if((_iClientFlags&(TABLET_SEND|TABLET_NEED_PERMITION))!=0)
                  bPermition = (BOOL)SendMessage(_hClientWnd, WM_PEGREC_STARTDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));
               else
                  PostMessage(_hClientWnd, WM_PEGREC_STARTDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));
               if((_iClientFlags&TABLET_NEED_PERMITION)==0 || bPermition)
                  {
                     _iClientFlags |= TABLET_ALL_TO_SYSTEM;
                     _iClientFlags  &= (~TABLET_SMART_TO_SYSTEM);
                     FlagsToDll = 0x07;
                     bDelay = TRUE;
                  }
               else
                  {
//                   _iClientFlags = 0; //skip this stroke
                     _iClientFlags &= (~TABLET_STARTDELAY_TO_SYSTEM);
                  }

               _dwLastSendedTick = 0;
            }


         // IS SECONDARY DELAY?  (end of a stroke)
         if( !bNear                                      &&
             Flags==0x0f   /*intermediate point*/       &&
             (_iClientFlags&TABLET_INTERDELAY_TO_SYSTEM)!=0)
            if(iLastDelayX-X<iMaxDelayDist && X-iLastDelayX<iMaxDelayDist &&
               iLastDelayY-Y<iMaxDelayDist && Y-iLastDelayY<iMaxDelayDist)
               { //Yes, it is
                  if(dwTick - dwLastDelayTick > dwMinInterDelayTime)
                     {
                      BOOL bPermition = TRUE;
                        if((_iClientFlags&(TABLET_SEND|TABLET_NEED_PERMITION))!=0)
                           bPermition = (BOOL)SendMessage(_hClientWnd, WM_PEGREC_ENDDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));
                        else
                           PostMessage(_hClientWnd, WM_PEGREC_ENDDELAY, (WPARAM)GetForegroundWindow(), MAKELPARAM(_begX, _begY));

                        if((_iClientFlags&TABLET_NEED_PERMITION)==0 || bPermition)
                           {
                              _iClientFlags |= TABLET_ALL_TO_SYSTEM;
                              _iClientFlags  &= (~TABLET_SMART_TO_SYSTEM);
//                              _iClientFlags  &= (~TABLET_ALL_TO_CLIENT);
                              FlagsToDll = 0x07;
                              X=_begX;
                              Y=_begY;
                              _dwLastSendedTick = 0;
                              bDelay = TRUE;

//                              DeferedDelay = TRUE;
                           }
                        else
                           {
//                           _iClientFlags = 0; //skip this stroke
                              _iClientFlags &= (~TABLET_INTERDELAY_TO_SYSTEM);
                           }

//                        SendMessage(_hClientWnd, WM_PEGREC_CLEARTRACE, 0, 1);
                     }
               }
            else
               { // new delay point
                  iLastDelayX = X;
                  iLastDelayY = Y;
                  dwLastDelayTick = dwTick;
               }

      } // endif "smart"

   // TO ORIGINAL DLL CALLBACK 
   if((_iClientFlags&TABLET_ALL_TO_SYSTEM)!=0)
      {
         // danger, hardcoded conversion
         // pass the event back to the mouse code, unless it was a wheel event
         //  in which case, evfMouse will be 0, because the wheel flags got masked off
         if (0 != evfMouse)
             mouse_event(evfMouse, dxMouse, dyMouse, 0, NULL);         
         
      }

   // TO The Transcriber App window
   if((_iClientFlags&TABLET_ALL_TO_CLIENT)!=0)
      {

         // it should be here because of possible _dwLastSendedTick changing
         if(Flags == 0x0d && !bClick && !bDelay)
            _dwLastSendedTick = dwTick;

         _dwLastPostedToClient  = dwTick;

         SendPtToWnd(FlagsToWnd, X, Y);

      }

 	return;
}

void CgrMouseStubInitialize(HANDLE hinstDll) {

	ULONG		iSize = 0;
	DWORD       dwResult;

   // This code was all written originally with the (bad) assumption that
   //  if two processes load the same DLL, the dll shares global variables.
   //  In Win32, that assumption is not true. So, for the global variables
   //  that must be shared, we enforce the shared memory by using a MemoryMappedFile
   //  Both processes will attempt to create a MMF - whoever gets there first creates,
   //  whoever gets there second will open the existing MMF.
   //  so far, we need to put *_phStubWnd and the outer touch queue into the MMF area.
   //  This is really a bit of a misnomer since we never have a real file, just a memory object.
   //  might have to set SEC_NOCACHE for the ARM if there are cache coherency problems
   iSize = sizeof(HANDLE) + sizeof(HWND) + sizeof(TOUCH_QUEUE);
   _hFileMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, iSize, 
	                                 TEXT("TranscriberSharedGlobals"));
   dwResult = GetLastError();
   if (NULL == _hFileMapping)
   {
	  MYERRORMSG(1, (__TEXT("Transcriber driver couldn't create shared global memory area.\r\n")));
	  return;
   }

   _pView = MapViewOfFile(_hFileMapping, FILE_MAP_WRITE, 0, 0, 0);
   if (NULL == _pView)
   {
	  MYERRORMSG(1, (__TEXT("Transcriber driver couldn't access shared global memory area.\r\n")));
	  return;
   }

   // once we make it to here, _pView can be used as a base pointer to the global area.


   _hClientWnd=NULL;
   _iClientFlags=TABLET_ALL_TO_SYSTEM;

   g_hTabletEvent = CreateEvent(NULL, TRUE, TRUE, L"CgrTabletEvent");
   g_hInnerEvent  = CreateEvent(NULL, TRUE, TRUE, L"CgrTabletInnerEvent");

   DEBUGCHK(g_hTabletEvent != NULL && g_hInnerEvent != NULL);

   // initialize the thread safety objects
   InitializeCriticalSection(&Q2CritSect);
   hQ1Mutex = CreateMutex(NULL, FALSE, TRANSCRIBER_Q1MUTEX);

   // get a pointer that we can share out for the shared queue
   //@future - I should have a more elegant way for doing this than byte offset
   //  when I add more elements, go to a struct
   // LAYOUT - the hwnd occupies the low 4 bytes of shared memory.
   //  The touch queue starts after that.
   ptq = (TOUCH_QUEUE*)((BYTE*)_pView + sizeof(HWND) + sizeof(HANDLE));
   _phinstDll = (HANDLE *)((BYTE*)_pView + sizeof(HWND));
   _phStubWnd = (HWND*) _pView;
   if (dwResult != ERROR_ALREADY_EXISTS) {
       ptq->iPut = ptq->iGet = 0;  
       tq2.iPut = tq2.iGet = 0;  
       *_phinstDll = NULL;
   }
   if (*_phinstDll == NULL) *_phinstDll = hinstDll;
   // Touch driver is loaded by gwes process and transcriber process.
   //  Create the 2 worker threads in gwes process only.
   //  We can't call FindWindow here the way the touch driver stub does, 
   //  because the API is not loaded at kbd/mouse driver init time.  Just assume
   //  that our window is not already there (since this code runs at system startup time)
   {
      DWORD dwIDThread;
        if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MouseWindowThread, (LPVOID)hinstDll, 0, &dwIDThread)==NULL )
			 {
            MYERRORMSG(1,
				   (__TEXT("Couldn't create touchstub window thread.\r\n")));
          }
        if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MouseInnerThread, (LPVOID)hinstDll, 0, &dwIDThread)==NULL )
			 {
            MYERRORMSG(1,
				   (__TEXT("Couldn't create touchstub inner thread.\r\n")));
          }
   }


}

extern ULONG   culReferenceCount;              //@globalvar ULONG | culReferenceCount | Count of attached threads
extern HANDLE hThread;


#ifdef __cplusplus
}
#endif //ifdef __cplusplus

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产视频在线观看一区二区三区| 欧美r级在线观看| 日韩av成人高清| 日韩毛片精品高清免费| 日韩精品一区二区三区蜜臀| 91在线观看下载| 久久疯狂做爰流白浆xx| 亚洲一区二区三区自拍| 亚洲国产高清不卡| 精品国产免费一区二区三区四区| 色综合天天做天天爱| 国产成人综合网站| 人禽交欧美网站| 香港成人在线视频| 综合久久国产九一剧情麻豆| ww亚洲ww在线观看国产| 欧美精品乱码久久久久久| 日本韩国一区二区三区| 成人福利视频网站| 国产精品一区二区果冻传媒| 日本欧美一区二区| 图片区小说区区亚洲影院| 亚洲天堂久久久久久久| 亚洲国产精品成人综合色在线婷婷| 精品人在线二区三区| 欧美日韩视频专区在线播放| 色欧美片视频在线观看在线视频| 国产91精品精华液一区二区三区| 国内久久精品视频| 天堂一区二区在线免费观看| 亚洲一区二区三区影院| 亚洲综合色婷婷| 亚洲与欧洲av电影| 亚洲国产三级在线| 亚洲午夜免费福利视频| 夜色激情一区二区| 一级做a爱片久久| 亚洲精品日产精品乱码不卡| 亚洲九九爱视频| 亚洲蜜臀av乱码久久精品蜜桃| 国产精品久久毛片| 最新热久久免费视频| 亚洲情趣在线观看| 亚洲精品国产一区二区精华液| 中文字幕日韩一区| 亚洲精品视频在线| 亚洲h动漫在线| 秋霞成人午夜伦在线观看| 日本aⅴ精品一区二区三区 | 91蝌蚪porny| 午夜电影一区二区三区| 亚洲国产精品欧美一二99| 亚洲你懂的在线视频| 一区二区三区加勒比av| 91精品国产一区二区人妖| 欧美日韩国产首页在线观看| 在线国产亚洲欧美| 欧美美女黄视频| 日韩欧美国产精品一区| 久久久午夜精品理论片中文字幕| 国产无遮挡一区二区三区毛片日本| 中文字幕免费一区| 日韩一区中文字幕| 亚洲第一福利视频在线| 精品一区二区在线看| 国产成人午夜精品5599| 97久久精品人人做人人爽50路| 一本到不卡精品视频在线观看| 欧美日韩亚洲丝袜制服| 精品久久人人做人人爰| 国产精品无人区| 亚洲成人福利片| 国内精品伊人久久久久av一坑| 国产福利一区二区三区| 91久久久免费一区二区| 亚洲综合丝袜美腿| 一级日本不卡的影视| 日韩不卡一二三区| 制服.丝袜.亚洲.中文.综合| 国产成人av电影在线| 97成人超碰视| 日韩欧美一区二区在线视频| 国产清纯白嫩初高生在线观看91 | 欧美不卡123| 最新日韩在线视频| 美女爽到高潮91| 国产精品视频麻豆| 中文字幕不卡在线观看| 粉嫩久久99精品久久久久久夜| 欧美一区二区三区四区视频| 色婷婷久久久综合中文字幕| 这里只有精品电影| 国产精品麻豆99久久久久久| 成人综合日日夜夜| 国产欧美日韩久久| 免费人成在线不卡| 日韩在线一二三区| 成人高清在线视频| 日韩情涩欧美日韩视频| 中文字幕一区日韩精品欧美| 视频一区在线视频| 91无套直看片红桃| 国产亚洲一本大道中文在线| 偷窥国产亚洲免费视频| av不卡免费电影| 久久综合精品国产一区二区三区| 亚洲在线一区二区三区| 成人理论电影网| 精品日韩成人av| 婷婷综合五月天| 91丨九色丨国产丨porny| 久久综合久色欧美综合狠狠| 亚洲a一区二区| 一本久道中文字幕精品亚洲嫩| 欧美激情一区二区| 另类小说一区二区三区| 51精品国自产在线| 亚洲成人先锋电影| 色呦呦国产精品| 国产精品美女一区二区三区| 国产一区二区精品久久99| 欧美日韩高清一区二区| 91亚洲资源网| 91精品黄色片免费大全| 91香蕉视频污在线| 中文字幕一区日韩精品欧美| 国产精品66部| 亚洲精品在线一区二区| 精品嫩草影院久久| 国产精品1区2区3区在线观看| 久久嫩草精品久久久久| 国产69精品久久久久毛片| 亚洲国产精品ⅴa在线观看| 成人精品免费网站| 国产无一区二区| 色综合久久综合网欧美综合网| 亚洲成人动漫精品| 亚洲精品在线电影| 国产999精品久久久久久| 一区二区三区四区高清精品免费观看 | 亚洲午夜一区二区| 欧美精品tushy高清| 亚洲国产sm捆绑调教视频| 欧美高清hd18日本| 91麻豆国产自产在线观看| 久久精品999| 一区二区三区不卡视频在线观看| 欧美美女bb生活片| 亚洲一区在线观看视频| 欧美在线观看视频一区二区| 国产一区二区三区综合| 性欧美疯狂xxxxbbbb| 中文字幕中文在线不卡住| 欧美精品aⅴ在线视频| 成人激情电影免费在线观看| 亚洲成av人综合在线观看| 日韩免费看的电影| 成人免费视频免费观看| 亚洲不卡在线观看| 中文字幕综合网| 国产精品国产三级国产专播品爱网| 日韩精品一区二区三区四区| 国产清纯在线一区二区www| 麻豆精品在线播放| 欧美人牲a欧美精品| 亚洲乱码精品一二三四区日韩在线| 韩国一区二区三区| 日韩一级二级三级精品视频| 欧美另类高清zo欧美| 精品日韩一区二区三区免费视频| 国产亚洲精品超碰| 亚洲成a人片综合在线| 精品无人区卡一卡二卡三乱码免费卡| 国产一区二区三区不卡在线观看| 国产一区二区在线观看免费 | 精品国产一区二区精华| 国产精品日韩精品欧美在线| 午夜精品成人在线| 成人av在线一区二区| 91精品国产黑色紧身裤美女| 国产精品久久久久影院色老大| 亚洲国产一二三| 欧美日韩不卡在线| 日韩主播视频在线| 91精品国产综合久久福利| 日本视频在线一区| 久久久久久影视| 91在线丨porny丨国产| 亚洲一区二区三区四区不卡| 911精品产国品一二三产区| 久久99精品久久久| 中文字幕二三区不卡| 色综合久久久久久久久| 亚洲成人精品一区二区| 久久久久久久久久美女| 99精品欧美一区二区三区小说| 午夜精品成人在线| 久久久久国产精品麻豆| 在线观看91视频| 精品亚洲成a人|