[pywin32-checkins] pywin32/win32/src win32apimodule.cpp,1.71,1.72
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2007-02-20 10:31:17
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25264/win32/src Modified Files: win32apimodule.cpp Log Message: Use PyWinObject_AsPARAM for WPARAM/LPARAM Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** win32apimodule.cpp 17 Feb 2007 17:26:18 -0000 1.71 --- win32apimodule.cpp 20 Feb 2007 10:31:15 -0000 1.72 *************** *** 2440,2455 **** { HWND hwnd; ! PyObject *obhwnd; UINT message; WPARAM wParam=0; LPARAM lParam=0; ! if (!PyArg_ParseTuple(args, "Oi|ii:PostMessage", &obhwnd, // @pyparm <o PyHANDLE>|hwnd||The hWnd of the window to receive the message. &message, // @pyparm int|idMessage||The ID of the message to post. ! &wParam, // @pyparm int|wParam||The wParam for the message ! &lParam)) // @pyparm int|lParam||The lParam for the message return NULL; if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; // @pyseeapi PostMessage PyW32_BEGIN_ALLOW_THREADS --- 2440,2459 ---- { HWND hwnd; ! PyObject *obhwnd, *obwParam=Py_None, *oblParam=Py_None; UINT message; WPARAM wParam=0; LPARAM lParam=0; ! if (!PyArg_ParseTuple(args, "OI|OO:PostMessage", &obhwnd, // @pyparm <o PyHANDLE>|hwnd||The hWnd of the window to receive the message. &message, // @pyparm int|idMessage||The ID of the message to post. ! &obwParam, // @pyparm int|wParam|None|The wParam for the message ! &oblParam)) // @pyparm int|lParam|None|The lParam for the message return NULL; if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; + if (!PyWinObject_AsPARAM(obwParam, &wParam)) + return NULL; + if (!PyWinObject_AsPARAM(oblParam, (WPARAM *)&lParam)) + return NULL; // @pyseeapi PostMessage PyW32_BEGIN_ALLOW_THREADS *************** *** 2469,2478 **** WPARAM wParam=0; LPARAM lParam=0; ! if (!PyArg_ParseTuple(args, "ii|ii:PostThreadMessage", &threadId, // @pyparm int|tid||Identifier of the thread to which the message will be posted. &message, // @pyparm int|idMessage||The ID of the message to post. ! &wParam, // @pyparm int|wParam||The wParam for the message ! &lParam)) // @pyparm int|lParam||The lParam for the message return NULL; // @pyseeapi PostThreadMessage PyW32_BEGIN_ALLOW_THREADS --- 2473,2488 ---- WPARAM wParam=0; LPARAM lParam=0; ! PyObject *obwParam=Py_None, *oblParam=Py_None; ! if (!PyArg_ParseTuple(args, "iI|OO:PostThreadMessage", &threadId, // @pyparm int|tid||Identifier of the thread to which the message will be posted. &message, // @pyparm int|idMessage||The ID of the message to post. ! &obwParam, // @pyparm int/str|wParam|None|The wParam for the message ! &oblParam)) // @pyparm int/str|lParam|None|The lParam for the message ! return NULL; ! if (!PyWinObject_AsPARAM(obwParam, &wParam)) return NULL; + if (!PyWinObject_AsPARAM(oblParam, (WPARAM *)&lParam)) + return NULL; + // @pyseeapi PostThreadMessage PyW32_BEGIN_ALLOW_THREADS *************** *** 3850,3866 **** { HWND hwnd; ! PyObject *obhwnd; ! int message; ! int wParam=0; ! int lParam=0; ! if (!PyArg_ParseTuple(args, "Oi|ii:SendMessage", ! &obhwnd, // @pyparm <o PyHANDLE>|hwnd||The hWnd of the window to receive the message. ! &message, // @pyparm int|idMessage||The ID of the message to send. ! &wParam, // @pyparm int|wParam||The wParam for the message ! &lParam)) // @pyparm int|lParam||The lParam for the message ! return NULL; if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; LRESULT rc; // @pyseeapi SendMessage --- 3860,3879 ---- { HWND hwnd; ! PyObject *obhwnd, *obwParam=Py_None, *oblParam=Py_None; ! UINT message; ! WPARAM wParam=0; ! LPARAM lParam=0; ! if (!PyArg_ParseTuple(args, "OI|OO:SendMessage", ! &obhwnd, // @pyparm <o PyHANDLE>|hwnd||The hWnd of the window to receive the message. ! &message, // @pyparm int|idMessage||The ID of the message to send. ! &obwParam, // @pyparm int/string|wParam|None|The wParam for the message ! &oblParam)) // @pyparm int/string|lParam|None|The lParam for the message return NULL; if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd, FALSE)) return NULL; + if (!PyWinObject_AsPARAM(obwParam, &wParam)) + return NULL; + if (!PyWinObject_AsPARAM(oblParam, (WPARAM *)&lParam)) + return NULL; LRESULT rc; // @pyseeapi SendMessage |