Update of /cvsroot/pywin32/pywin32/win32/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14142
Modified Files:
win32apimodule.cpp
Log Message:
Add GetLastInputInfo
Index: win32apimodule.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -d -r1.97 -r1.98
*** win32apimodule.cpp 27 Jan 2009 13:07:19 -0000 1.97
--- win32apimodule.cpp 2 Feb 2009 17:25:49 -0000 1.98
***************
*** 90,93 ****
--- 90,97 ----
static RegOverridePredefKeyfunc pfnRegOverridePredefKey = NULL;
+ // from user32.dll
+ typedef BOOL (WINAPI *GetLastInputInfofunc)(PLASTINPUTINFO);
+ static GetLastInputInfofunc pfnGetLastInputInfo = NULL;
+
/* error helper */
PyObject *ReturnError(char *msg, char *fnName = NULL)
***************
*** 1534,1537 ****
--- 1538,1553 ----
}
+ // @pymethod int|win32api|GetLastInputInfo|Returns time of last input event in tick count
+ // @pyseeapi GetLastInputInfo
+ static PyObject *PyGetLastInputInfo(PyObject * self, PyObject * args)
+ {
+ CHECK_PFN(GetLastInputInfo);
+ LASTINPUTINFO lii;
+ lii.cbSize = sizeof(lii);
+ if (!(*pfnGetLastInputInfo)(&lii))
+ return PyWin_SetAPIError("GetLastInputInfo");
+ return PyLong_FromUnsignedLong(lii.dwTime);
+ }
+
// @pymethod string|win32api|GetLogicalDriveStrings|Returns a string with all logical drives currently mapped.
static PyObject * PyGetLogicalDriveStrings (PyObject * self, PyObject *args)
***************
*** 6191,6194 ****
--- 6207,6211 ----
{"GetKeyState", PyGetKeyState, 1}, // @pymeth GetKeyState|Retrives the last known key state for a key.
{"GetLastError", PyGetLastError, 1}, // @pymeth GetLastError|Retrieves the last error code known by the system.
+ {"GetLastInputInfo", PyGetLastInputInfo, METH_NOARGS}, // @pymeth GetLastInputInfo|Returns time of last input event in tick count
{"GetLocalTime", PyGetLocalTime, 1}, // @pymeth GetLocalTime|Returns the current local time.
// @pymeth GetLongPathName|Converts the specified path to its long form.
***************
*** 6450,6453 ****
--- 6467,6471 ----
pfnGetMonitorInfo=(GetMonitorInfofunc)GetProcAddress(hmodule, "GetMonitorInfo" A_OR_W);
pfnEnumDisplaySettingsEx=(EnumDisplaySettingsExfunc)GetProcAddress(hmodule, "EnumDisplaySettingsEx" A_OR_W);
+ pfnGetLastInputInfo=(GetLastInputInfofunc)GetProcAddress(hmodule, "GetLastInputInfo");
}
|