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

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

?? tchwnd.cpp

?? PXA270 MainstoneII平臺下完整觸摸屏驅動源碼
?? CPP
字號:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
/*++

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

   // GetMessage will return false when the message-signalling object is destroyed by GWES.
   // Then this thread will exit.
   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一区二区三区免费野_久草精品视频
91麻豆国产福利精品| 91精品国产综合久久精品图片| 国产aⅴ综合色| 成av人片一区二区| 91精品国产综合久久久蜜臀粉嫩| 精品国产伦一区二区三区观看方式 | 亚洲精品在线免费观看视频| 国产日韩欧美精品电影三级在线| 亚洲一区二区视频在线| 国产真实乱对白精彩久久| 欧美日韩一卡二卡三卡| 日韩欧美中文字幕一区| 国产欧美日韩激情| 亚洲午夜私人影院| 成人免费视频免费观看| 欧美日韩一本到| 日韩欧美一二三| 中文字幕免费一区| 国产真实精品久久二三区| 91蜜桃视频在线| 精品99久久久久久| 日韩在线卡一卡二| 99re免费视频精品全部| 日韩女优毛片在线| 日韩高清一区二区| 91欧美激情一区二区三区成人| 日韩一区二区在线观看视频| 国产精品久久久99| 岛国精品在线播放| 日韩一级二级三级| 亚洲高清不卡在线| 91蝌蚪国产九色| 欧美国产97人人爽人人喊| 五月婷婷久久综合| 日韩激情一二三区| 欧美电影一区二区| 亚洲激情五月婷婷| 99国内精品久久| 国产精品女人毛片| 国产福利视频一区二区三区| 欧美一区二区日韩一区二区| 天堂蜜桃91精品| 在线一区二区三区四区五区| 国产精品伦一区二区三级视频| 韩国成人精品a∨在线观看| 欧美日韩国产另类不卡| 亚洲精品日产精品乱码不卡| 成人伦理片在线| 亚洲日本va在线观看| 暴力调教一区二区三区| 国产色91在线| 成人久久视频在线观看| 国产精品色眯眯| 成人aaaa免费全部观看| 一区二区三区日韩精品| 91福利精品第一导航| 日韩毛片一二三区| 波多野结衣在线一区| 综合久久久久综合| 91国产精品成人| 亚洲一二三四在线观看| 日韩一区二区免费高清| 人人精品人人爱| 精品免费99久久| 成人激情黄色小说| 国产免费成人在线视频| 粉嫩13p一区二区三区| 日韩理论片在线| 欧美午夜精品一区二区蜜桃| 天使萌一区二区三区免费观看| 欧美日韩一区视频| 激情文学综合丁香| 国产精品―色哟哟| 波多野结衣精品在线| 天堂av在线一区| 久久综合一区二区| 91丨九色丨蝌蚪富婆spa| 首页国产欧美久久| 欧美大肚乱孕交hd孕妇| 国产成人亚洲综合a∨婷婷图片 | 亚洲电影激情视频网站| 日韩一区二区三区精品视频| 国产盗摄一区二区| 偷窥少妇高潮呻吟av久久免费| 欧美成人a在线| a美女胸又www黄视频久久| 亚洲123区在线观看| 欧美精品一区二区三区四区| 成人app在线| 亚洲国产成人高清精品| 国产精品女主播在线观看| 99r精品视频| 久久精品999| 亚洲成人激情综合网| 国产亚洲一区二区三区四区| 色综合久久99| 成人精品免费视频| 日韩中文字幕亚洲一区二区va在线| 久久精品一区四区| 在线精品视频免费播放| 国产精品综合在线视频| 午夜精品久久久久久久蜜桃app| 欧美mv日韩mv亚洲| 欧美高清www午色夜在线视频| 高清成人在线观看| 日本亚洲欧美天堂免费| 亚洲综合色丁香婷婷六月图片| 欧美成人猛片aaaaaaa| 在线观看亚洲a| 91在线视频播放| 国产成人av影院| 奇米影视7777精品一区二区| 欧美一卡二卡三卡四卡| 8x8x8国产精品| 91麻豆国产精品久久| 懂色av一区二区三区免费观看| 国内精品视频666| 日韩不卡一区二区三区 | 欧美一区二区三区视频在线 | 欧美日韩日日骚| 欧美亚洲综合一区| 99久久精品国产精品久久| 国产一区二区不卡在线| 国内一区二区在线| 久久99热这里只有精品| 午夜精品国产更新| 午夜精品久久久久久久久久 | 久久99精品久久久久久| 精彩视频一区二区三区| 麻豆成人在线观看| 日韩成人精品在线观看| 毛片不卡一区二区| 久久99国产精品久久| 免费精品视频在线| 日韩 欧美一区二区三区| 秋霞午夜鲁丝一区二区老狼| 亚洲国产精品久久一线不卡| 亚洲三级免费观看| 亚洲福中文字幕伊人影院| 亚洲成人7777| 视频一区二区三区入口| 久久精品久久综合| 国产一区二区三区免费| 国产福利一区在线| av在线不卡网| 欧美在线影院一区二区| 欧美婷婷六月丁香综合色| 色婷婷综合五月| 欧美日韩成人激情| 日韩美女视频在线| 精品国产91乱码一区二区三区| 日本一区二区三区免费乱视频| 亚洲一区二区精品3399| 性久久久久久久| 国产伦精品一区二区三区在线观看| 国产在线播放一区| 成人av电影免费在线播放| 欧美日韩国产精选| 日韩美一区二区三区| 国产日产欧美一区| 成人一区二区三区视频在线观看 | 亚洲国产精品嫩草影院| 国产在线不卡一区| 欧美四级电影在线观看| 久久久久久久综合色一本| 亚洲一区二区在线观看视频| 国产一区二区三区在线观看免费视频| 99re热视频精品| 26uuu国产日韩综合| 亚洲成人在线观看视频| 国产激情一区二区三区| 欧美顶级少妇做爰| 综合av第一页| 国内外成人在线| 777色狠狠一区二区三区| 国产精品乱人伦中文| 精东粉嫩av免费一区二区三区| 在线观看欧美黄色| 日本一二三四高清不卡| 久久99久久久欧美国产| 91精彩视频在线观看| 国产欧美日韩激情| 蜜桃视频在线观看一区二区| 在线观看av一区| 国产精品久久福利| 国产成人精品三级| 精品福利一区二区三区免费视频| 亚洲一区视频在线| 91玉足脚交白嫩脚丫在线播放| 久久综合狠狠综合| 麻豆视频观看网址久久| 欧美日韩亚洲综合| 亚洲激情校园春色| 欧美精品一区二区三区四区 | 国产精品综合二区| 欧美一级夜夜爽| 日韩国产高清在线| 7777精品伊人久久久大香线蕉的 | 欧美日韩在线直播| 亚洲另类春色校园小说|