check HKCU\Software\\Microsoft\\Shell\HasKeyboard for keyboard presence, if the key is not there assume older device and no keyboard */
| 1932 | /* check HKCU\Software\\Microsoft\\Shell\HasKeyboard for keyboard presence, |
| 1933 | if the key is not there assume older device and no keyboard */ |
| 1934 | BOOL |
| 1935 | mswin_has_keyboard(void) |
| 1936 | { |
| 1937 | DWORD dwHasKB = 0; |
| 1938 | #if defined(WIN_CE_POCKETPC) || defined(WIN_CE_SMARTPHONE) |
| 1939 | HKEY hKey; |
| 1940 | DWORD dwType; |
| 1941 | DWORD dwSize = sizeof(dwHasKB); |
| 1942 | if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Shell"), 0, |
| 1943 | 0, &hKey) == ERROR_SUCCESS) { |
| 1944 | if (RegQueryValueEx(hKey, _T("HasKeyboard"), NULL, &dwType, |
| 1945 | (LPBYTE) &dwHasKB, &dwSize) != ERROR_SUCCESS) { |
| 1946 | dwHasKB = 0; |
| 1947 | } |
| 1948 | RegCloseKey(hKey); |
| 1949 | } |
| 1950 | #endif |
| 1951 | return (dwHasKB == 1); |
| 1952 | } |
| 1953 | |
| 1954 | #ifdef _DEBUG |
| 1955 | #include <stdarg.h> |