Update of /cvsroot/pywin32/pywin32/win32/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28413/win32/src
Modified Files:
win32apimodule.cpp
Log Message:
add win32api.GetKeyboardLayout()
Index: win32apimodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -d -r1.93 -r1.94
*** win32apimodule.cpp 11 Dec 2008 00:25:40 -0000 1.93
--- win32apimodule.cpp 11 Dec 2008 05:09:00 -0000 1.94
***************
*** 5838,5841 ****
--- 5838,5853 ----
}
+ // @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)
***************
*** 5852,5856 ****
buflen=GetKeyboardLayoutList(buflen, buf);
if (buflen==0)
! PyWin_SetAPIError("GetKeyboardLayout");
else{
ret=PyTuple_New(buflen);
--- 5864,5868 ----
buflen=GetKeyboardLayoutList(buflen, buf);
if (buflen==0)
! PyWin_SetAPIError("GetKeyboardLayoutList");
else{
ret=PyTuple_New(buflen);
***************
*** 6036,6039 ****
--- 6048,6052 ----
{"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.
|