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

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

?? tchwnd.cpp

?? win ce下的觸摸屏驅動源代碼
?? CPP
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++

TCHWND
--*/

#include    <windows.h>
#include	<tchar.h>
#include	<types.h>

//#include	   "debug.h"
#include	   "pegc_def.h"
#include    "tchddi.h"

#ifdef __cplusplus
extern "C"{
#endif 
#include    "tchstub.h"

// Local and external functions
HWND	FindForegroundFocusWindow(HWND hForegroundWnd);
LRESULT CALLBACK TchStubWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void TouchCreateEventInternal(int begX, int begY);
void
StubCallback2(
	DWORD dwtick0,
   TOUCH_PANEL_SAMPLE_FLAGS	Flags,
	INT	X,
	INT	Y
    );


DWORD WINAPI TchWindowThread(DWORD dwParameter)
{
 WNDCLASSW wc;
 HWND hWnd;
 MSG msg;
 HANDLE	hInst = reinterpret_cast<HANDLE>(dwParameter);

   wc.style = 0; //CS_HREDRAW | CS_VREDRAW; //|  CS_DBLCLKS;
   wc.lpfnWndProc = (WNDPROC) TchStubWndProc;
   wc.cbClsExtra = 0;
   wc.cbWndExtra = 0;
   wc.hInstance = reinterpret_cast<HINSTANCE>(hInst);
   wc.hIcon = 0;
   wc.hCursor = 0;
   wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
   wc.lpszMenuName = 0;
   wc.lpszClassName = TOUCHSTUB_WNDCLASSNAME;
   Sleep(4000);
   if (RegisterClass(&wc) == FALSE ) 
      {
     	  MYERRORMSG(1,
			(TEXT("Could not register window class for TouchStub Window.\r\n")));
         return 0;
      }

   if((hWnd=CreateWindowEx(0, TOUCHSTUB_WNDCLASSNAME, L"", 0,
             0, 0, 1 , 1, NULL, NULL, reinterpret_cast<HINSTANCE>(hInst), NULL))==0)
      {
		   MYERRORMSG(1,
			   (TEXT("Could not create TouchStub Window.\r\n")));
         return 0;
      }
   ShowWindow(hWnd, SW_HIDE);   

   while(1)
      {
         if(GetMessage(&msg, NULL, 0, 0) == FALSE) 
            break;
         TranslateMessage(&msg);
         DispatchMessage(&msg);
      }
   return 0;
}


// The point of this routine is to get the focus window in the client proc (ie, pWord, etc).
//
//  Since the Focus window of the foreground proc is not the same as the foreground window, we do this by
//  creating a window parented to the foreground window, then calling GetFocus() on that window, then
//  destroying the temp window we created.
//  If creating the window fails, we return hForegroundWnd - not perfect, but the best we can do.
//  The GWE lead developer warns that this could break with future versions of the OS.  The alternative is to //  sublcass the foreground wnd, then on that subclassed thread check to see who has focus, then
//  undo the sublcass, returning the result (the code used to do that).
HWND	FindForegroundFocusWindow(HWND hForegroundWnd)
{
	HWND	hWndFocus;
	HWND	hTempWindow;

	// create a window, any window, parented to hForegroundWnd
	hTempWindow = CreateWindowEx(0, TOUCHSTUB_WNDCLASSNAME, L"", 0,
                                 0, 0, 1 , 1, hForegroundWnd, NULL, 
                                 reinterpret_cast<HINSTANCE>(*_phinstDll), NULL);

	if (NULL == hTempWindow)
		return hForegroundWnd;

	// this works because creating a window parented to hForegroundWindow joins the 
	//  input contexts of the message queues temporarily, so we can find which
	//  child of the foreground wnd actually has the focus using the standard API call.
	hWndFocus = GetFocus();

	// destroying the window disconnects my thread input context from the foreground thread
	DestroyWindow(hTempWindow);

	return hWndFocus;

}


LRESULT CALLBACK TchStubWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
  switch (message) 
   {
      case WM_CLOSE:
         return 0;
      case WM_STUB_TABLET:
         StubCallback2(wParam, (TOUCH_PANEL_SAMPLE_FLAGS)(lParam>>26), ((lParam>>13)&0x01FFF), (lParam&0x01FFF));
         break;

      case WM_STUB_GETVERSION:
         return (CGRTOUCH_MAJOR_VERSION*10000+CGRTOUCH_MINOR_VERSION*100+CGRTOUCH_RELEASE);
         //_iTouchStubVersion;

      case WM_STUB_GETLASTTOUCHFOCUSWND:
         return (LRESULT)_hLastTouchFocusWnd;

	  // go to the client process (pWord, etc) and see who has focus there (set _hLastTouchFocusWnd to answer)
      case WM_STUB_GETFOCUSWND:
         {
            HWND hFgrWnd = GetForegroundWindow();

			// if there is no foreground window, no need to go further
            if(hFgrWnd==NULL || !IsWindow(hFgrWnd))
			{
                _hLastTouchFocusWnd = NULL;
                return 0;
			}
			// default to the foreground window in case the explorer has focus
            _hLastTouchFocusWnd = hFgrWnd;	
            
			// if the explorer has focus, return
            TCHAR szClass[128];
            GetClassName( hWnd, szClass, 127);
            if(_tcscmp(szClass, L"DesktopExplorerWindow")==0)
                return 0;

			// Call our routine to find the focus window
			_hLastTouchFocusWnd = FindForegroundFocusWindow(hFgrWnd);
			return reinterpret_cast<long>(_hLastTouchFocusWnd);
		 }
			

      case WM_STUB_EVENT:
         TouchCreateEventInternal((int)wParam, (int)lParam);
         return TRUE;

      case WM_STUB_REGISTWND:
         _hClientWnd = (HWND)wParam;

#ifdef DEBUGTOUCH
         // Show the debug message next time touch driver performance is below.
         _bNoDbgMsg = FALSE;
#endif // DEBUGTOUCH

         return TRUE;
      case WM_STUB_UNREGISTWND:
         if(_hClientWnd == (HWND)wParam)
            _hClientWnd = NULL;

#ifdef DEBUGTOUCH
         // Show the debug message next time touch driver performance is below.
         _bNoDbgMsg = FALSE;
#endif // DEBUGTOUCH

         break;
      case WM_STUB_SETVALUE:
         switch(wParam)
            {
               case STUB_LAST_CLICKTIME:
                  _dwLastSendedTick = lParam;
                  break;
               case STUB_VALUE_REGWND:
                  break;
               case STUB_VALUE_STUBWND:
                  break;
               case STUB_MIN_PAUSE_BEFORE_CLICK:
                  dwMinPauseBeforeClick = lParam;
                  break;
               case STUB_MAX_CLICK_DIST:
                  iMaxClickDist = lParam;
                  break;
               case STUB_MAX_CLICK_TIME:
                  dwMaxClickTime = lParam;
                  break;
               case STUB_MAX_DELAY_DIST:
                  iMaxDelayDist = lParam;
                  break;
               case STUB_MIN_START_DELAY_TIME:
                  dwMinStartDelayTime = lParam;
                  break;
               case STUB_MIN_INTER_DELAY_TIME:
                  dwMinInterDelayTime = lParam;
                  break;
            }
         break;
      case WM_STUB_GETVALUE:
         switch(wParam)
            {
               case STUB_VALUE_REGWND:
                  return (LRESULT)_hClientWnd;
               case STUB_VALUE_STUBWND:
                  return (LRESULT)*_phStubWnd;
               case STUB_MIN_PAUSE_BEFORE_CLICK:
                  return dwMinPauseBeforeClick;
               case STUB_MAX_CLICK_DIST:
                  return iMaxClickDist;
               case STUB_MAX_CLICK_TIME:
                  return dwMaxClickTime;
               case STUB_MAX_DELAY_DIST:
                  return iMaxDelayDist;
               case STUB_MIN_START_DELAY_TIME:
                  return dwMinStartDelayTime;
               case STUB_MIN_INTER_DELAY_TIME:
                  return dwMinInterDelayTime;
               default:
                  return 0;
            }
         break;
      case WM_STUB_RESET:
         if(wParam)
            {
               dwMinPauseBeforeClick         =  1500;
               iMaxClickDist                 =  23;
               iMaxDelayDist                 =  18;
               dwMaxClickTime                =  480;
               dwMinStartDelayTime           =  480;
               dwMinInterDelayTime           =  800;
            }
         _dwLastSendedTick = 0;

      default : return DefWindowProc(hWnd, message, wParam, lParam);
   }

  return DefWindowProc(hWnd, message, wParam, lParam);
}


#ifdef __cplusplus
   }
#endif //ifdef __cplusplus

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区视频| 99r国产精品| 久久久99精品免费观看不卡| 欧美日韩一区视频| 欧美日韩久久久| 欧美日韩国产一级二级| 欧美人与z0zoxxxx视频| 欧美精品日韩一本| 欧美一级淫片007| 日韩精品在线看片z| 欧美电影免费观看高清完整版在线 | 97se亚洲国产综合在线| 成人av手机在线观看| 99久久精品免费看国产| 91捆绑美女网站| 欧美区在线观看| 久久午夜免费电影| 国产精品高潮久久久久无| 亚洲欧美色图小说| 石原莉奈在线亚洲二区| 麻豆精品在线观看| 99国产精品一区| 欧美精品一卡二卡| 精品播放一区二区| 国产精品美女久久久久久久久久久 | 国产欧美日韩视频在线观看| 国产精品电影一区二区三区| 亚洲一区二区视频在线| 伦理电影国产精品| 成人成人成人在线视频| 欧美三区在线观看| 国产午夜三级一区二区三| 亚洲天堂2014| 国产一区二区91| 在线视频国内自拍亚洲视频| 欧美xxxxx裸体时装秀| 国产精品美女久久久久久久| 亚洲第一久久影院| 国产黄色91视频| 在线不卡一区二区| 国产精品看片你懂得| 蜜桃精品在线观看| 欧亚洲嫩模精品一区三区| 久久久久久麻豆| 午夜一区二区三区视频| 成人av在线影院| 欧美成人官网二区| 亚洲高清三级视频| 99久久er热在这里只有精品66| 日韩精品专区在线| 亚洲妇女屁股眼交7| 成人丝袜视频网| 欧美哺乳videos| 日韩电影在线一区| 欧美日韩国产123区| 中文字幕视频一区| 成人精品视频一区二区三区尤物| 欧美男男青年gay1069videost| 中文字幕欧美一区| 高清shemale亚洲人妖| 日韩欧美亚洲另类制服综合在线| 亚洲一区二区三区中文字幕在线| 99免费精品在线| 亚洲国产精品激情在线观看| 精品一区二区三区香蕉蜜桃| 91.xcao| 日本中文一区二区三区| 欧美吻胸吃奶大尺度电影 | 久久亚洲精品小早川怜子| 亚洲国产日韩一级| 欧美日本在线一区| 香蕉成人啪国产精品视频综合网| 在线视频国内自拍亚洲视频| 亚洲欧美中日韩| 97久久超碰精品国产| 国产情人综合久久777777| 国产成人综合亚洲91猫咪| 久久综合九色综合97婷婷女人| 精品一区二区三区免费毛片爱 | 日韩综合一区二区| 91精品国产入口| 免费一级片91| 久久精品视频在线免费观看| 国产成人精品三级| 最新中文字幕一区二区三区| 99热这里都是精品| 亚洲国产精品一区二区www| 在线观看av一区二区| 午夜精品久久久久久久久久久| 91精品国产综合久久久久久| 日本不卡高清视频| 国产欧美综合色| 色综合天天综合色综合av| 曰韩精品一区二区| 91精品国产麻豆国产自产在线| 免费观看久久久4p| 日本一区二区久久| 欧美伊人精品成人久久综合97 | 亚洲尤物在线视频观看| 国产喷白浆一区二区三区| 国产一二三精品| 亚洲男女毛片无遮挡| 欧美亚洲国产bt| 国产精品自拍三区| 一个色在线综合| 精品国一区二区三区| 99久久免费精品| 免费高清视频精品| 亚洲欧美偷拍三级| 欧美不卡视频一区| 色噜噜狠狠一区二区三区果冻| 婷婷国产v国产偷v亚洲高清| 久久青草欧美一区二区三区| 色婷婷久久久久swag精品| 久久精品国产99久久6| 国产精品白丝在线| 日韩精品专区在线影院观看| 一本大道久久a久久精二百| 青青草伊人久久| 亚洲欧美国产77777| 精品国产凹凸成av人网站| 一本色道亚洲精品aⅴ| 国产在线精品一区二区不卡了| 亚洲免费观看高清在线观看| 亚洲精品在线一区二区| 欧美在线观看视频一区二区| 国产精品小仙女| 麻豆91在线播放| 天堂资源在线中文精品| 国产精品电影一区二区| www激情久久| 欧美一区二区啪啪| 欧美唯美清纯偷拍| 在线观看一区日韩| 99久久免费国产| 成人高清免费观看| 国产成人aaaa| 国产剧情一区二区| 狠狠狠色丁香婷婷综合久久五月| 亚洲风情在线资源站| 一区二区三区欧美日| 国产精品国产三级国产三级人妇 | 欧美自拍偷拍一区| 91美女视频网站| 99麻豆久久久国产精品免费| 国产在线一区二区| 麻豆精品久久精品色综合| 日韩经典一区二区| 爽好久久久欧美精品| 日韩电影在线免费| 日本三级亚洲精品| 激情综合一区二区三区| 国内不卡的二区三区中文字幕 | 五月综合激情日本mⅴ| 亚洲综合丁香婷婷六月香| 一区二区三区精品久久久| 一区二区久久久久| 亚洲一区国产视频| 日韩国产高清影视| 久久精品国产第一区二区三区| 麻豆精品蜜桃视频网站| 国产一区欧美二区| 成人av在线一区二区三区| 91美女福利视频| 欧美日韩综合在线| 在线综合视频播放| 久久一夜天堂av一区二区三区| 精品电影一区二区| 国产精品视频第一区| 亚洲日本韩国一区| 日韩激情视频在线观看| 精品制服美女久久| 972aa.com艺术欧美| 欧美视频一二三区| 日韩你懂的在线播放| 国产无遮挡一区二区三区毛片日本| 国产精品乱人伦一区二区| 亚洲欧美激情在线| 日本不卡视频在线观看| 国产一区二区三区| 久久天堂av综合合色蜜桃网| 国产日韩精品一区二区三区在线| 亚洲欧洲99久久| 视频在线观看91| 国产福利一区在线观看| 色综合久久久久网| 精品裸体舞一区二区三区| 中文字幕亚洲电影| 日韩成人精品在线| 不卡一卡二卡三乱码免费网站| 欧美日韩精品专区| 国产日韩欧美一区二区三区综合 | 久久精品一区二区三区不卡牛牛| 国产精品蜜臀在线观看| 亚洲成av人片一区二区三区| 国产主播一区二区| 欧美色欧美亚洲另类二区| 国产精品视频观看| 精品一区二区三区视频在线观看| 一本久久a久久免费精品不卡|