Win CE 鍵盤鎖定 與 取得鍵盤狀態

Win CE 鍵盤鎖 與 取得鍵盤狀態

imageimage

 

   1:  //匯入wince核心檔的方法
   2:          [DllImport("coredll.Dll", EntryPoint = "EnableHardwareKeyboard")]
   3:          private static extern int EnableHardwareKeyboard(int bEnable);
   4:          [DllImport("coredll.Dll", EntryPoint = "GetKeyboardStatus")]
   5:          private static extern int GetKeyboardStatus();
   6:   
   7:          public Form1()
   8:          {
   9:              InitializeComponent();
  10:          }
  11:   
  12:          private void disableKeyBoard_Click(object sender, EventArgs e)
  13:          {
  14:              EnableHardwareKeyboard(0);
  15:          }
  16:   
  17:          private void enableKeyBoard_Click(object sender, EventArgs e)
  18:          {
  19:              EnableHardwareKeyboard(1);
  20:          }
  21:   
  22:          private void keyboardStatus_Click(object sender, EventArgs e)
  23:          {
  24:              switch (GetKeyboardStatus())
  25:              {
  26:                  case 13:
  27:                      MessageBox.Show("關閉");
  28:                      break;
  29:                  case 15:
  30:                      MessageBox.Show("開啟");
  31:                      break;
  32:                  default:
  33:                      break;
  34:              }
  35:          }

 

 

//WinCE.NET兩個重要函數之一Coredll.dll: 
 
  1 SystemStarted   
  2 InitializeCriticalSection   
  3 DeleteCriticalSection   
  4 EnterCriticalSection   
  5 LeaveCriticalSection   
  6 ExitThread   
  7 PSLNotify   
  8 InitLocale   
  9 InterlockedTestExchange   
  10 InterlockedIncrement   
  11 InterlockedDecrement   
  12 InterlockedExchange   
  13 ThreadBaseFunc   
  14 MainThreadBaseFunc   
  15 TlsGetValue   
  16 TlsSetValue   
  17 GetVersionEx   
  18 CompareFileTime   
  19 SystemTimeToFileTime   
  20 FileTimeToSystemTime   
  21 FileTimeToLocalFileTime   
  22 LocalFileTimeToFileTime   
  23 GetLocalTime   
  24 SetLocalTime   
  25 GetSystemTime   
  26 SetSystemTime   
  27 GetTimeZoneInformation   
  28 SetTimeZoneInformation   
  29 GetCurrentFT   
  30 IsAPIReady   
  31 memchr   
  32 GetAPIAddress   
  33 LocalAlloc   
  34 LocalReAlloc   
  35 LocalSize   
  36 LocalFree   
  37 RemoteLocalAlloc   
  38 RemoteLocalReAlloc   
  39 RemoteLocalSize   
  40 RemoteLocalFree   
  41 LocalAllocInProcess   
  42 LocalFreeInProcess   
  43 LocalSizeInProcess   
  44 HeapCreate   
  45 HeapDestroy   
  46 HeapAlloc   
  47 HeapReAlloc   
  48 HeapSize   
  49 HeapFree   
  50 GetProcessHeap   
  51 HeapValidate   
  52 GetHeapSnapshot   
  53 CeModuleJit   
  54 CompactAllHeaps   
  56 wsprintfW   
  57 wvsprintfW   
  58 wcscat   
  59 wcschr   
  60 wcscmp   
  61 wcscpy   
  62 wcscspn   
  63 wcslen   
  64 wcsncat   
  65 wcsncmp   
  66 wcsncpy   
  67 _wcsnset   
  68 wcspbrk   
  69 wcsrchr   
  70 _wcsrev   
  71 _wcsset   
  72 wcsspn   
  73 wcsstr   
  74 _wcsdup   
  75 wcstombs   
  76 mbstowcs   
  77 wcstok   
  78 _wtol   
  79 _wtoll   
  80 Random   
  82 ProfileStart   
  83 ProfileStop   
  87 __C_specific_handler   
  88 GlobalMemoryStatus   
  89 SystemParametersInfoW   
  90 CreateDIBSection   
  91 EqualRgn   
  92 CreateAcceleratorTableW   
  93 DestroyAcceleratorTable   
  94 LoadAcceleratorsW   
  95 RegisterClassW   
  96 CopyRect   
  97 EqualRect   
  98 InflateRect   
  99 IntersectRect   
  100 IsRectEmpty   
  101 OffsetRect   
  102 PtInRect   
  103 SetRect   
  104 SetRectEmpty   
  105 SubtractRect   
  106 UnionRect   
  107 ClearCommBreak   
  108 ClearCommError   
  109 EscapeCommFunction   
  110 GetCommMask   
  111 GetCommModemStatus   
  112 GetCommProperties   
  113 GetCommState   
  114 GetCommTimeouts   
  115 PurgeComm   
  116 SetCommBreak   
  117 SetCommMask   
  118 SetCommState   
  119 SetCommTimeouts   
  120 SetupComm   
  121 TransmitCommChar   
  122 WaitCommEvent   
  123 EnumPnpIds   
  124 EnumDevices   
  125 GetDeviceKeys   
  126 CryptAcquireContextW   
  127 CryptReleaseContext   
  128 CryptGenKey   
  129 CryptDeriveKey   
  130 CryptDestroyKey   
  131 CryptSetKeyParam   
  132 CryptGetKeyParam   
  133 CryptExportKey   
  134 CryptImportKey   
  135 CryptEncrypt   
  136 CryptDecrypt   
  137 CryptCreateHash   
  138 CryptHashSessionKey   
  139 CryptHashData   
  140 CryptDestroyHash   
  141 CryptSignHashW   
  142 CryptVerifySignatureW   
  143 CryptGenRandom   
  144 CryptGetUserKey   
  145 CryptSetProviderW   
  146 CryptGetHashParam   
  147 CryptSetHashParam   
  148 CryptGetProvParam   
  149 CryptSetProvParam   
  150 CryptSetProviderExW   
  151 CryptGetDefaultProviderW   
  152 CryptEnumProviderTypesW   
  153 CryptEnumProvidersW   
  154 CryptContextAddRef   
  155 CryptDuplicateKey   
  156 CryptDuplicateHash   
  157 AttachDebugger   
  158 SetInterruptEvent   
  159 IsExiting   
  160 CreateDirectoryW   
  161 RemoveDirectoryW   
  162 GetTempPathW   
  163 MoveFileW   
  164 CopyFileW   
  165 DeleteFileW   
  166 GetFileAttributesW   
  167 FindFirstFileW   
  168 CreateFileW   
  169 SetFileAttributesW   
  170 ReadFile   
  171 WriteFile   
  172 GetFileSize   
  173 SetFilePointer   
  174 GetFileInformationByHandle   
  175 FlushFileBuffers   
  176 GetFileTime   
  177 SetFileTime   
  178 SetEndOfFile   
  179 DeviceIoControl   
  180 FindClose   
  181 FindNextFileW   
  182 CheckPassword   
  183 DeleteAndRenameFile   
  184 GetDiskFreeSpaceExW   
  185 IsValidCodePage   
  186 GetACP   
  187 GetOEMCP   
  188 GetCPInfo   
  189 SetACP   
  190 SetOEMCP   
  191 IsDBCSLeadByte   
  192 IsDBCSLeadByteEx   
  193 iswctype   
  194 towlower   
  195 towupper   
  196 MultiByteToWideChar   
  197 WideCharToMultiByte   
  198 CompareStringW   
  199 LCMapStringW   
  200 GetLocaleInfoW   
  /////////////////////////////////////////////////////   
  /////////////////////////////////////////////////////   
  2000 __rt_sdiv64by64   
  2001 __rt_srem64by64   
  2002 __rt_udiv64by64   
  2003 __rt_urem64by64   
  2005 __rt_sdiv   
  2006 __rt_sdiv10   
  2008 __rt_udiv   
  2009 __rt_udiv10   
  2010 __rt_srsh   
  2011 __rt_ursh   
  2012 __utod   
  2013 __u64tos   
  2014 __u64tod   
  2015 __subs   
  2016 __subd   
  2017 __stou64   
  2018 __stou   
  2019 __stoi64   
  2020 __stoi   
  2021 __stod   
  2022 __nes   
  2023 __negs   
  2024 __negd   
  2025 __ned   
  2026 __muls   
  2027 __muld   
  2028 __lts   
  2029 __ltd   
  2030 __les   
  2031 __led   
  2032 __itos   
  2033 __itod   
  2034 __i64tos   
  2035 __i64tod   
  2036 __gts   
  2037 __gtd   
  2038 __ges   
  2039 __ged   
  2040 __eqs   
  2041 __eqd   
  2042 __dtou64   
  2043 __dtou   
  2044 __dtos   
  2045 __dtoi64   
  2046 __dtoi   
  2047 __divs   
  2048 __divd   
  2049 __cmps   
  2050 __cmpd   
  2051 __adds   
  2052 __utos   
  2053 __addd   
  2054 setjmp   
  2055 _mbmemset  
 
 
  xxxx HeapAllocTrace   
  xxxx Int_HeapAlloc   
  xxxx Int_HeapCreate   
  xxxx Int_HeapDestroy   
  xxxx Int_HeapFree   
  xxxx Int_HeapReAlloc   
  xxxx Int_HeapSize   
  xxxx LocalAllocTrace