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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tchstub.cpp

?? windows ce 下的觸控屏驅(qū)動程序源代碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
                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)
      {
         (*v_pfnCgrPointCallback)(FlagsToDll, X, Y);
      }

   // 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;

#if DISCARD_SIMILAR_POINTS    
		 // Alex says safe to leave out - originally placed here to avoid overloading
		 //  slower processors.
		 // throw away redundant points (pen didn't move far enough within small time)
         if((FlagsToWnd&TouchSampleDownFlag)!=0)
            {
             int X0 = _iLastProceedX, Y0 = _iLastProceedY;
             
			 _iLastProceedX = X;
             _iLastProceedY = Y;
             _iLastProceedFlags = FlagsToWnd;
             
			 if((FlagsToWnd&TouchSamplePreviousDownFlag)!=0)
                  { //only for internal points
                   int iSum;

				   X = X0;
				   Y = Y0;               

				   if(dwTick-_dwLastPostedToClient<1000)
                         {
                            iSum = abs(X - _iLastPostedX)+abs(Y - _iLastPostedY);
                            if(iSum<_iMinDist)
                               goto bypass_sendpoint;
                         }
//                      if(iSum>_iMaxDist)
//                         goto bypass_sendpoint;
                  }
             
			   _iLastPostedX = X;
               _iLastPostedY = Y;
            }
         else
            {
               if((FlagsToWnd&TouchSamplePreviousDownFlag)!=0 &&
                  (_iLastPostedX != _iLastProceedX || _iLastPostedY != _iLastProceedY))
                  {
                     if(abs(X - _iLastPostedX)+abs(Y - _iLastPostedY) < _iMaxDist)
                        {
                           _iLastPostedX = _iLastProceedX;
                           _iLastPostedY = _iLastProceedY;
                           SendPtToWnd(_iLastProceedFlags, _iLastProceedX, _iLastProceedY);
                        }
                  }
            }

#endif // DISCARD_SIMILAR_POINTS

         _dwLastPostedToClient  = dwTick;

         SendPtToWnd(FlagsToWnd, X, Y);

//bypass_sendpoint:
        ;

//       if(Flags == 0x0d && !bClick && !bDelay)
//          _dwLastSendedTick = dwTick;
      }
#ifdef DEBUG2
      else
	  {
         OutputDebugString(L"CgrTouch Point 4\n");
      }
#endif

 	return;
}

void CgrTouchStubInitialize(HANDLE hinstDll) {

	TCHAR		*pOldDriverName = DEFAULT_TOUCH_DRIVER_NAME;
	SECURITY_ATTRIBUTES     SecAttr;
	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;

   SecAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
   SecAttr.lpSecurityDescriptor = NULL;
   SecAttr.bInheritHandle = TRUE;
   g_hTabletEvent = CreateEvent(&SecAttr, TRUE, TRUE, L"CgrTabletEvent");
   g_hInnerEvent  = CreateEvent(&SecAttr, TRUE, TRUE, L"CgrTabletInnerEvent");

   // initialize the thread safety objects
   InitializeCriticalSection(&Q2CritSect);
   hQ1Mutex = CreateMutex(NULL, FALSE, TRANSCRIBER_Q1MUTEX);
#ifdef DEBUGTOUCH
   InitializeCriticalSection(&csErrMsg);
#endif // DEBUGTOUCH

   // 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;
     //  if(!FindWindow(TOUCHSTUB_WNDCLASSNAME, NULL))
     {
      DWORD dwIDThread;
        if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TchWindowThread, (LPVOID)hinstDll, 0, &dwIDThread)==NULL )
			 {
            MYERRORMSG(1,
				   (__TEXT("Couldn't create touchstub window thread.\r\n")));
          }
        if(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TchInnerThread, (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 PFN_TOUCH_PANEL_CALLBACK v_pfnPointCallback;
PFN_TOUCH_PANEL_CALLBACK v_pfnCgrCallback = CgrCallback;

/*++
Autodoc Information:

    @func BOOL | TouchPanelDllEntry |
    Dll entry point.

    @rdesc
    TRUE if the function succeeds. Otherwise, FALSE.

--*/
BOOL
TouchPanelDllEntry(
    HANDLE  hinstDll,    //@parm Process handle.
    DWORD   fdwReason,   //@parm Reason for calling the function.
    LPVOID  lpvReserved  //@parm Reserved, not used.
    )
{

    BOOL ReturnCode = TRUE;

    switch ( fdwReason )
    {
        case DLL_PROCESS_ATTACH:
            DEBUGREGISTER(reinterpret_cast<HINSTANCE>(hinstDll));
            DEBUGMSG( ZONE_FUNCTION, (TEXT("Dll Process Attach\r\n")) );

             //
             // Process is attaching.  We allow only 1 process to be attached.
             // If our global counter (maintained by the PDD) is greater than 0,
             //   error.
             //

            CgrTouchStubInitialize(hinstDll); // init calligrapher's part

            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;
            if ( DdsiTouchPanelAttach() > 1 )
            {
                DEBUGMSG( ZONE_FUNCTION, (TEXT("DdsiTouchPanelAttach > 1\r\n") ) );
                DdsiTouchPanelDetach(); // if a process attach fails, the  detach is
                 // never called. So adjust the count here.
                ReturnCode = FALSE;
            }

            break;

        case DLL_THREAD_ATTACH:
            DEBUGMSG( ZONE_FUNCTION, (TEXT("Dll Thread Attach\r\n")) );

             //
             // Thread is attaching.  We allow only 1 thread to be attached.
             //
            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;
            if ( ++culReferenceCount > 1 )
                ReturnCode = FALSE;
            break;

        case DLL_THREAD_DETACH:
            DEBUGMSG( ZONE_FUNCTION, (TEXT("Dll Thread Detach\r\n")) );

             //
             // Thread is detaching. If the detaching thread is the thread that
             // was allowed to attach, we now have no one to process touch panel
             // points. In this case we clear the callback functions, disable the
             // touch panel hardware, and disconnect from the logical interrupt.
             //

            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;
            if ( --culReferenceCount == 0 )
            {
                v_pfnPointCallback = NULL;
                DdsiTouchPanelDisable();
                InterruptDisable( gIntrTouch );
//				if( SYSINTR_NOP != gIntrTouchChanged )
//               		InterruptDisable( gIntrTouchChanged );
            }
            break;

        case DLL_PROCESS_DETACH:
            DEBUGMSG( ZONE_FUNCTION,
                      (TEXT("Dll Process Detach\r\n")) );

            if (_phinstDll != NULL && *_phinstDll != hinstDll) break;

             //
             // Process is detaching.
             // If the detaching process is the process that was allowed
             // to attach, we reset the callback functions,
             // reference count, disable the touch panel, and disconnect from the
             // logical interrupt.
             //
             //
            DdsiTouchPanelDetach();
            break;
    }
    return ( ReturnCode );
}


#ifdef __cplusplus
   }
#endif //ifdef __cplusplus

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月婷婷另类国产| 高清beeg欧美| 国产在线播放一区二区三区| 国产一区二区在线观看视频| 成人av资源在线观看| 在线精品亚洲一区二区不卡| 欧美成人三级在线| 亚洲人精品一区| 蜜臀精品久久久久久蜜臀 | 亚洲自拍都市欧美小说| 久久精品国产澳门| 91视视频在线观看入口直接观看www| 6080午夜不卡| 亚洲欧美色图小说| 国产精品综合久久| 欧美人成免费网站| 日韩伦理免费电影| 蜜桃一区二区三区在线观看| 色就色 综合激情| 国产日产精品1区| 男女视频一区二区| 在线精品视频免费播放| 欧美国产日韩一二三区| 免费在线观看成人| 欧洲国内综合视频| 国产精品妹子av| 国内欧美视频一区二区| 欧美日韩国产首页| 亚洲素人一区二区| 国产成人综合网| 日韩一级精品视频在线观看| 亚洲h精品动漫在线观看| 91丨国产丨九色丨pron| 国产日产欧美精品一区二区三区| 香蕉av福利精品导航| 色噜噜久久综合| 国产精品久久久久久久久免费桃花| 美女任你摸久久| 欧美一级片免费看| 亚洲高清免费在线| 在线视频一区二区三区| 中文字幕在线不卡| 成人精品电影在线观看| 久久婷婷一区二区三区| 久草在线在线精品观看| 日韩欧美黄色影院| 蜜桃视频在线观看一区二区| 91麻豆精品国产综合久久久久久| 亚洲成人免费在线| 欧美精品视频www在线观看| 亚洲一区二区三区自拍| 精品视频在线免费观看| 一区二区三区在线视频免费观看| 91在线视频免费91| 亚洲精品国产第一综合99久久| 99久久久久免费精品国产 | 免费观看在线色综合| 91精品一区二区三区在线观看| 亚洲18影院在线观看| 欧美色国产精品| 另类调教123区| 久久婷婷综合激情| 懂色一区二区三区免费观看| 中文字幕巨乱亚洲| av在线一区二区三区| 日韩美女啊v在线免费观看| 91视频精品在这里| 午夜欧美在线一二页| 日韩精品一区二区三区视频播放| 国产一区二区调教| 中文字幕在线免费不卡| 色婷婷综合久久| 日韩国产欧美在线观看| 精品国产91九色蝌蚪| 国产suv一区二区三区88区| 国产精品久久夜| 欧美日韩精品一二三区| 久久99久久久欧美国产| 国产精品天天看| 欧美综合亚洲图片综合区| 亚洲成人一区二区在线观看| 精品国产免费视频| 一本色道a无线码一区v| 日本欧美久久久久免费播放网| 精品国产免费人成在线观看| 91在线观看一区二区| 日本不卡123| 亚洲欧洲色图综合| 日韩一区二区三区免费观看| 丰满岳乱妇一区二区三区| 亚洲国产综合色| 久久夜色精品国产欧美乱极品| 99视频超级精品| 免播放器亚洲一区| 亚洲精品成人悠悠色影视| 欧美一区二区三区的| 波多野结衣中文一区| 美女视频黄免费的久久| 亚洲色图.com| 久久久久久久久久美女| 91视视频在线观看入口直接观看www| 日韩黄色一级片| 亚洲欧美综合色| 日韩欧美国产综合| 在线视频欧美区| 国产成人免费视| 丝袜a∨在线一区二区三区不卡| 国产精品久久免费看| 欧美成人高清电影在线| 欧美最新大片在线看| 成人免费高清视频在线观看| 日韩国产欧美一区二区三区| 亚洲欧洲精品一区二区精品久久久| 日韩色视频在线观看| 欧美午夜精品久久久久久超碰| a亚洲天堂av| 国产伦精品一区二区三区免费迷| 亚洲va欧美va天堂v国产综合| 日韩码欧中文字| 国产精品国产馆在线真实露脸| 欧美成人一区二区三区在线观看 | 91麻豆精品国产91久久久资源速度| 国产精品18久久久久| 日韩电影一区二区三区| 亚洲在线视频网站| 亚洲欧美激情一区二区| 国产精品午夜在线| 欧美激情一区二区在线| 国产区在线观看成人精品| 精品久久久久99| 精品国产伦一区二区三区观看方式| 91精品国产乱| 欧美一区二区三区婷婷月色| 欧美三片在线视频观看 | 国产一区二区伦理片| 奇米在线7777在线精品| 亚洲va欧美va国产va天堂影院| 一级日本不卡的影视| 一区二区在线观看视频在线观看| 亚洲欧洲综合另类在线| 伊人开心综合网| 一区二区三区在线免费观看| 亚洲综合在线五月| 亚洲综合精品久久| 午夜日韩在线电影| 奇米亚洲午夜久久精品| 美女一区二区三区在线观看| 捆绑调教一区二区三区| 国内精品自线一区二区三区视频| 国产精品一区三区| 99精品久久久久久| 在线观看国产一区二区| 欧美日本乱大交xxxxx| 日韩一区国产二区欧美三区| 精品国产一区a| 欧美国产一区在线| 亚洲精品v日韩精品| 午夜日韩在线电影| 麻豆成人91精品二区三区| 久久爱另类一区二区小说| 天堂一区二区在线免费观看| 久久精品72免费观看| 韩国欧美国产一区| 成人av在线网站| 一本色道久久综合精品竹菊| 欧美军同video69gay| 精品国产成人在线影院 | 国产精品丝袜在线| 亚洲日本一区二区三区| 日韩主播视频在线| 国产成人综合在线播放| 91浏览器在线视频| 欧美一区二区视频在线观看| 久久精品亚洲一区二区三区浴池| 18欧美乱大交hd1984| 日日夜夜免费精品| 成人精品高清在线| 欧美一区二区三区啪啪| 国产精品久久久久久久第一福利 | 男女激情视频一区| 99久久精品99国产精品| 欧美人妇做爰xxxⅹ性高电影| 久久久精品影视| 午夜国产不卡在线观看视频| 国产成人无遮挡在线视频| 欧美午夜精品久久久| 久久久91精品国产一区二区精品| 一区二区高清免费观看影视大全| 亚洲国产wwwccc36天堂| 国产乱子伦视频一区二区三区 | 老司机免费视频一区二区 | 99久久精品免费看国产免费软件| 欧美日韩国产三级| 国产精品免费网站在线观看| 日韩国产在线观看| 91免费在线视频观看| 精品播放一区二区| 亚洲一区二区三区在线| 成人综合婷婷国产精品久久| 欧美一级日韩不卡播放免费|