[pywin32-checkins] pywin32/win32/src win32apimodule.cpp, 1.89.2.3, 1.89.2.4
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-28 10:58:16
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26837/win32/src Modified Files: Tag: py3k win32apimodule.cpp Log Message: restore use of integer for RegQueryInfoKey from trunk Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.89.2.3 retrieving revision 1.89.2.4 diff -C2 -d -r1.89.2.3 -r1.89.2.4 *** win32apimodule.cpp 8 Dec 2008 13:41:06 -0000 1.89.2.3 --- win32apimodule.cpp 28 Dec 2008 10:58:11 -0000 1.89.2.4 *************** *** 3809,3813 **** )!=ERROR_SUCCESS) return ReturnAPIError("RegQueryInfoKey", rc); ! return Py_BuildValue("iiN",nSubKeys,nValues, PyWinObject_FromFILETIME(ft)); } --- 3809,3818 ---- )!=ERROR_SUCCESS) return ReturnAPIError("RegQueryInfoKey", rc); ! ULARGE_INTEGER l; ! l.LowPart = ft.dwLowDateTime; ! l.HighPart = ft.dwHighDateTime; ! PyObject *ret = Py_BuildValue("iiN",nSubKeys,nValues, ! PyWinObject_FromULARGE_INTEGER(l)); ! return ret; } *************** *** 5834,5837 **** --- 5839,5854 ---- } + // @pymethod int|win32api|GetKeyboardLayout|retrieves the active input locale identifier (formerly called the keyboard layout) for the specified thread. + // @comm If the idThread parameter is zero, the input locale identifier for the active thread is returned. + PyObject *PyGetKeyboardLayout(PyObject *self, PyObject *args) + { + int tid = 0; + // @pyparm int|threadId|0| + if (!PyArg_ParseTuple(args,"|i:GetKeyboardLayout", &tid)) + return NULL; + HKL hkl = ::GetKeyboardLayout((DWORD)tid); + return PyWinLong_FromVoidPtr(hkl); + } + // @pymethod (int,..)|win32api|GetKeyboardLayoutList|Returns a sequence of all locale ids currently loaded PyObject *PyGetKeyboardLayoutList(PyObject *self, PyObject *args) *************** *** 5848,5852 **** buflen=GetKeyboardLayoutList(buflen, buf); if (buflen==0) ! PyWin_SetAPIError("GetKeyboardLayout"); else{ ret=PyTuple_New(buflen); --- 5865,5869 ---- buflen=GetKeyboardLayoutList(buflen, buf); if (buflen==0) ! PyWin_SetAPIError("GetKeyboardLayoutList"); else{ ret=PyTuple_New(buflen); *************** *** 6086,6089 **** --- 6103,6107 ---- {"GetFullPathName", PyGetFullPathName,1}, // @pymeth GetFullPathName|Returns the full path of a (possibly relative) path {"GetHandleInformation", PyGetHandleInformation,1}, // @pymeth GetHandleInformation|Retrieves a handle's flags. + {"GetKeyboardLayout", PyGetKeyboardLayout, 1}, // @pymeth GetKeyboardLayout|Retrieves the active input locale identifier {"GetKeyboardLayoutList", PyGetKeyboardLayoutList, 1}, // @pymeth GetKeyboardLayoutList|Returns a sequence of all locale ids in the system {"GetKeyboardState", PyGetKeyboardState, 1}, // @pymeth GetKeyboardState|Retrieves the status of the 256 virtual keys on the keyboard. |