pywin32-checkins Mailing List for Python for Windows Extensions (Page 105)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mark H. <mha...@us...> - 2006-01-10 05:35:55
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26242 Modified Files: win32apimodule.cpp Log Message: GetVersionEx takes an optional param - if 1, we return a longer tuple representing the OSVERSIONINFOEX structure. Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** win32apimodule.cpp 2 Dec 2005 07:51:47 -0000 1.51 --- win32apimodule.cpp 10 Jan 2006 05:35:47 -0000 1.52 *************** *** 2006,2026 **** } ! // @pymethod (int,int,int,int,string)|win32api|GetVersionEx|Returns the current version of Windows, and information about the environment. static PyObject * PyGetVersionEx(PyObject * self, PyObject * args) { ! if (!PyArg_ParseTuple(args, ":GetVersionEx")) return NULL; ! OSVERSIONINFO ver; ! ver.dwOSVersionInfoSize = sizeof(ver); ! if (!::GetVersionEx(&ver)) ! return ReturnAPIError("GetVersionEx"); ! return Py_BuildValue("iiiis", ! // @rdesc The return value is a tuple with the following information.<nl> ! ver.dwMajorVersion, // @tupleitem 0|int|majorVersion|Identifies the major version number of the operating system.<nl> ! ver.dwMinorVersion, // @tupleitem 1|int|minorVersion|Identifies the minor version number of the operating system.<nl> ! ver.dwBuildNumber, // @tupleitem 2|int|buildNumber|Identifies the build number of the operating system in the low-order word. (The high-order word contains the major and minor version numbers.)<nl> ! ver.dwPlatformId, // @tupleitem 3|int|platformId|Identifies the platform supported by the operating system. May be one of VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS or VER_PLATFORM_WIN32_NT<nl> ! ver.szCSDVersion); // @tupleitem 4|string|version|Contains arbitrary additional information about the operating system. } --- 2006,2050 ---- } ! // @pymethod tuple|win32api|GetVersionEx|Returns the current version of Windows, and information about the environment. static PyObject * PyGetVersionEx(PyObject * self, PyObject * args) { ! // @pyparm int|format|0|The format of the version info to return. ! // May be 0 (for OSVERSIONINFO) or 1 (for OSVERSIONINFOEX) ! int format = 0; ! if (!PyArg_ParseTuple(args, "|i:GetVersionEx", &format)) return NULL; ! if (format == 0) { ! OSVERSIONINFO ver; ! ver.dwOSVersionInfoSize = sizeof(ver); ! if (!::GetVersionEx(&ver)) ! return ReturnAPIError("GetVersionEx"); ! return Py_BuildValue("iiiis", ! // @rdesc The return value is a tuple with the following information.<nl> ! ver.dwMajorVersion, // @tupleitem 0|int|majorVersion|Identifies the major version number of the operating system.<nl> ! ver.dwMinorVersion, // @tupleitem 1|int|minorVersion|Identifies the minor version number of the operating system.<nl> ! ver.dwBuildNumber, // @tupleitem 2|int|buildNumber|Identifies the build number of the operating system in the low-order word. (The high-order word contains the major and minor version numbers.)<nl> ! ver.dwPlatformId, // @tupleitem 3|int|platformId|Identifies the platform supported by the operating system. May be one of VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS or VER_PLATFORM_WIN32_NT<nl> ! ver.szCSDVersion); // @tupleitem 4|string|version|Contains arbitrary additional information about the operating system. ! } else if (format == 1) { ! OSVERSIONINFOEX ver; ! ver.dwOSVersionInfoSize = sizeof(ver); ! if (!::GetVersionEx((LPOSVERSIONINFO)&ver)) ! return ReturnAPIError("GetVersionEx"); ! return Py_BuildValue("iiiisiiiii", ! // @rdesc or if the format param is 1, the return value is a tuple with:<nl> ! ver.dwMajorVersion, // @tupleitem 0|int|majorVersion|Identifies the major version number of the operating system.<nl> ! ver.dwMinorVersion, // @tupleitem 1|int|minorVersion|Identifies the minor version number of the operating system.<nl> ! ver.dwBuildNumber, // @tupleitem 2|int|buildNumber|Identifies the build number of the operating system in the low-order word. (The high-order word contains the major and minor version numbers.)<nl> ! ver.dwPlatformId, // @tupleitem 3|int|platformId|Identifies the platform supported by the operating system. May be one of VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS or VER_PLATFORM_WIN32_NT<nl> ! ver.szCSDVersion, // @tupleitem 4|string|version|Contains arbitrary additional information about the operating system. ! ver.wServicePackMajor, // @tupleitem 5|int|wServicePackMajor|Major version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the major version number is 3. If no Service Pack has been installed, the value is zero. ! ver.wServicePackMinor, // @tupleitem 6|int|wServicePackMinor|Minor version number of the latest Service Pack installed on the system. For example, for Service Pack 3, the minor version number is 0. ! ver.wSuiteMask, // @tupleitem 7|int|wSuiteMask|Bit flags that identify the product suites available on the system. This member can be a combination of the VER_SUITE_* values. ! ver.wProductType, // @tupleitem 8|int|wProductType|Additional information about the system. This member can be one of the VER_NT_* values. ! ver.wReserved); // @tupleitem 9|int|wReserved| ! ! } ! return PyErr_Format(PyExc_ValueError, "format must be 0 or 1 (got %d)", format); } |
From: Mark H. <mha...@us...> - 2006-01-10 05:07:03
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9479 Modified Files: win32app.cpp Win32app.h win32uimodule.cpp Log Message: [ 1043734 ] Fixed win32ui.GetRecentFileList Index: win32uimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uimodule.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** win32uimodule.cpp 7 Oct 2004 08:45:24 -0000 1.29 --- win32uimodule.cpp 10 Jan 2006 04:39:43 -0000 1.30 *************** *** 1155,1159 **** CProtectedWinApp *pApp = GetProtectedApp(); if (!pApp) return NULL; ! int cnt = pApp->GetProfileInt("Settings", "Recent File List Size", _AFX_MRU_COUNT); PyObject *list = PyList_New(cnt); if (list==NULL) { --- 1155,1159 ---- CProtectedWinApp *pApp = GetProtectedApp(); if (!pApp) return NULL; ! int cnt = pApp->GetRecentCount(); PyObject *list = PyList_New(cnt); if (list==NULL) { Index: win32app.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32app.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32app.cpp 20 Jan 2004 22:28:53 -0000 1.4 --- win32app.cpp 10 Jan 2006 04:39:43 -0000 1.5 *************** *** 29,32 **** --- 29,37 ---- // ////////////////////////////////////////////////////////////////////// + int CProtectedWinApp::GetRecentCount() + { + return m_pRecentFileList->GetSize(); + } + CString CProtectedWinApp::GetRecentFileName(int index) { Index: Win32app.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/Win32app.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Win32app.h 20 Jan 2004 22:28:50 -0000 1.3 --- Win32app.h 10 Jan 2006 04:39:43 -0000 1.4 *************** *** 47,50 **** --- 47,51 ---- public: // how do I change from protected to public? + int GetRecentCount(); CString GetRecentFileName(int index); void RemoveRecentFile(int index); |
From: Mark H. <mha...@us...> - 2006-01-10 05:03:58
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21957 Modified Files: view.py Log Message: [ 1186128 ] Adding dynamic dispatch methods to AutoComplete list Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** view.py 20 Jan 2004 22:15:15 -0000 1.23 --- view.py 10 Jan 2006 05:03:49 -0000 1.24 *************** *** 426,429 **** --- 426,442 ---- except AttributeError: pass + # The object might be a pure COM dynamic dispatch with typelib support - lets see if we can get its props. + if hasattr(ob, "_oleobj_"): + try: + for iTI in xrange(0,ob._oleobj_.GetTypeInfoCount()): + typeInfo = ob._oleobj_.GetTypeInfo(iTI) + typeAttr = typeInfo.GetTypeAttr() + for iFun in xrange(0,typeAttr.cFuncs): + funDesc = typeInfo.GetFuncDesc(iFun) + funName = typeInfo.GetNames(funDesc.memid)[0] + if not items_dict.has_key(funName): + items_dict[funName] = None + except: + pass except: win32ui.SetStatusText("Error attempting to get object attributes - %s" % (`sys.exc_info()[0]`,)) |
From: Mark H. <mha...@us...> - 2006-01-10 04:58:20
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21002 Modified Files: pythonframe.h Log Message: [ 1043738 ] Added SetFloatingFrameClass method to CPythonFrameWnd Index: pythonframe.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pythonframe.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pythonframe.h 1 Sep 1999 23:32:59 -0000 1.1 --- pythonframe.h 10 Jan 2006 04:58:08 -0000 1.2 *************** *** 9,12 **** --- 9,18 ---- class CPythonFrameWnd : public CPythonWndFramework<CFrameWnd> { DECLARE_DYNAMIC(CPythonFrameWnd); + public: + // m_pFloatingFrameClass is protected so we can't access + // it from the outside + void SetFloatingFrameClass(CRuntimeClass* frameClass) { + m_pFloatingFrameClass = frameClass; + } }; |
From: Mark H. <mha...@us...> - 2006-01-10 04:53:46
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20591 Modified Files: win32toolbar.h Log Message: [ 1043736 ] PyCControlBar is now exported with PYW_EXPORT Index: win32toolbar.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32toolbar.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32toolbar.h 1 Sep 1999 23:33:02 -0000 1.1 --- win32toolbar.h 10 Jan 2006 04:53:38 -0000 1.2 *************** *** 1,5 **** // long awaited toolbar class ! class PyCControlBar : public PyCWnd { public: --- 1,5 ---- // long awaited toolbar class ! class PYW_EXPORT PyCControlBar : public PyCWnd { public: |
From: Mark H. <mha...@us...> - 2006-01-10 04:52:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20434 Modified Files: win32cmdui.cpp Log Message: [ 1043735 ] Added m_pMenu and m_pSubMenu attributes to PyCCmdUI Index: win32cmdui.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32cmdui.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32cmdui.cpp 4 Aug 2000 04:44:45 -0000 1.5 --- win32cmdui.cpp 10 Jan 2006 04:52:19 -0000 1.6 *************** *** 14,17 **** --- 14,18 ---- */ #include "stdafx.h" + #include "win32menu.h" #include "win32cmdui.h" *************** *** 270,273 **** --- 271,290 ---- return NULL; return PyInt_FromLong(pCU->m_nID); + } else if (strcmp(name, "m_pMenu")==0) { // @prop <o PyCMenu>|m_pMenu| + CCmdUI *pCU = PyCCmdUI::GetCCmdUIPtr(this); + if (!pCU) + return NULL; + if (pCU->m_pMenu) + return ui_assoc_object::make(PyCMenu::type, pCU->m_pMenu->GetSafeHmenu()); + Py_INCREF(Py_None); + return Py_None; + } else if (strcmp(name, "m_pSubMenu")==0) { // @prop <o PyCMenu>|m_pSubMenu| + CCmdUI *pCU = PyCCmdUI::GetCCmdUIPtr(this); + if (!pCU) + return NULL; + if (pCU->m_pSubMenu) + return ui_assoc_object::make(PyCMenu::type, pCU->m_pSubMenu->GetSafeHmenu()); + Py_INCREF(Py_None); + return Py_None; } return ui_assoc_object::getattr(name); |
From: Mark H. <mha...@us...> - 2006-01-10 04:37:24
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7251/pythonwin/pywin/mfc Modified Files: object.py Log Message: [ 1043733 ] Added message map ranges support to CmdTarget Index: object.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/object.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** object.py 5 May 2000 14:04:30 -0000 1.2 --- object.py 10 Jan 2006 04:37:14 -0000 1.3 *************** *** 39,40 **** --- 39,55 ---- def __init__(self, initObj): Object.__init__(self, initObj) + def HookNotifyRange(self, handler, firstID, lastID): + oldhandlers = [] + for i in range(firstID, lastID + 1): + oldhandlers.append(self.HookNotify(handler, i)) + return oldhandlers + def HookCommandRange(self, handler, firstID, lastID): + oldhandlers = [] + for i in range(firstID, lastID + 1): + oldhandlers.append(self.HookCommand(handler, i)) + return oldhandlers + def HookCommandUpdateRange(self, handler, firstID, lastID): + oldhandlers = [] + for i in range(firstID, lastID + 1): + oldhandlers.append(self.HookCommandUpdate(handler, i)) + return oldhandlers |
From: Mark H. <mha...@us...> - 2006-01-10 04:35:40
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7045 Modified Files: win32con.py Log Message: [ 1043732 ] New win32con constants and a bug fix Index: win32con.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32con.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** win32con.py 7 Oct 2005 10:44:07 -0000 1.13 --- win32con.py 10 Jan 2006 04:35:26 -0000 1.14 *************** *** 27,30 **** --- 27,33 ---- OFN_ENABLEINCLUDENOTIFY = 4194304 # send include message to callback OFN_ENABLESIZING = 8388608 + OFN_DONTADDTORECENT = 33554432 + OFN_FORCESHOWHIDDEN = 268435456 # Show All files including System and hidden files + OFN_EX_NOPLACESBAR = 1 OFN_SHAREFALLTHROUGH = 2 OFN_SHARENOWARN = 1 *************** *** 3388,3396 **** PC_EXPLICIT = 2 PC_NOCOLLAPSE = 4 ! def GetRValue(rgb): return ((rgb)) ! def GetGValue(rgb): return ((((rgb)) >> 8)) ! def GetBValue(rgb): return (((rgb)>>16)) TRANSPARENT = 1 --- 3391,3399 ---- PC_EXPLICIT = 2 PC_NOCOLLAPSE = 4 ! def GetRValue(rgb): return rgb & 0xff ! def GetGValue(rgb): return (rgb >> 8) & 0xff ! def GetBValue(rgb): return (rgb >> 16) & 0xff TRANSPARENT = 1 *************** *** 4820,4821 **** --- 4823,4835 ---- ULW_OPAQUE = 0x00000004 + # WinDef.h + TRUE = 1 + FALSE = 0 + MAX_PATH = 260 + # WinGDI.h + AC_SRC_OVER = 0 + AC_SRC_ALPHA = 1 + GRADIENT_FILL_RECT_H = 0 + GRADIENT_FILL_RECT_V = 1 + GRADIENT_FILL_TRIANGLE = 2 + GRADIENT_FILL_OP_FLAG = 255 |
From: Mark H. <mha...@us...> - 2006-01-10 04:29:58
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6347/win32/Lib Modified Files: mmsystem.py Log Message: [ 1043731 ] New mmsystem.py constants Index: mmsystem.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/mmsystem.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mmsystem.py 2 Sep 1999 00:19:28 -0000 1.1 --- mmsystem.py 10 Jan 2006 04:29:49 -0000 1.2 *************** *** 141,144 **** --- 141,145 ---- WIM_CLOSE = MM_WIM_CLOSE WIM_DATA = MM_WIM_DATA + WAVE_MAPPER = 0xFFFFFFFFL WAVE_FORMAT_QUERY = 0x0001 WAVE_ALLOWSYNC = 0x0002 *************** *** 172,175 **** --- 173,177 ---- WAVE_FORMAT_4S16 = 0x00000800 WAVE_FORMAT_PCM = 1 + WAVE_FORMAT_IEEE_FLOAT = 3 MIDIERR_UNPREPARED = (MIDIERR_BASE + 0) MIDIERR_STILLPLAYING = (MIDIERR_BASE + 1) |
From: Mark H. <mha...@us...> - 2006-01-10 04:28:48
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6037/pythonwin/pywin/mfc Modified Files: afxres.py Log Message: [ 1043730 ] New afxres.py constants Index: afxres.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/afxres.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** afxres.py 1 Sep 1999 23:33:52 -0000 1.1 --- afxres.py 10 Jan 2006 04:28:40 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- CBRS_SIZE_FIXED = 0x0002 CBRS_FLOATING = 0x0001 + CBRS_GRIPPER = 0x00400000 CBRS_ORIENT_HORZ = (CBRS_ALIGN_TOP|CBRS_ALIGN_BOTTOM) CBRS_ORIENT_VERT = (CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT) *************** *** 28,31 **** --- 29,38 ---- CBRS_RIGHT = (CBRS_ALIGN_RIGHT|CBRS_BORDER_LEFT) CBRS_BOTTOM = (CBRS_ALIGN_BOTTOM|CBRS_BORDER_TOP) + SBPS_NORMAL = 0x0000 + SBPS_NOBORDERS = 0x0100 + SBPS_POPOUT = 0x0200 + SBPS_OWNERDRAW = 0x1000 + SBPS_DISABLED = 0x04000000 + SBPS_STRETCH = 0x08000000 ID_INDICATOR_EXT = 0xE700 ID_INDICATOR_CAPS = 0xE701 |
From: Mark H. <mha...@us...> - 2006-01-10 04:26:16
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5580 Modified Files: win32uiExt.h Log Message: [ 1043740 ] Added PyCWnd.OnTimer virtual handler, from Adal Chiriliuc. Index: win32uiExt.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32uiExt.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32uiExt.h 5 Mar 2005 03:24:11 -0000 1.6 --- win32uiExt.h 10 Jan 2006 04:26:07 -0000 1.7 *************** *** 223,226 **** --- 223,233 ---- T::OnPaint(); } + afx_msg void OnTimer(UINT nIDEvent) { + // @pyvirtual void|PyCWnd|OnTimer|Called for the WM_TIMER message. + // @pyparm <int>|nIDEvent||Specifies the identifier of the timer. + CVirtualHelper helper( "OnTimer", this ); + if (!helper.HaveHandler() || !helper.call(static_cast<int>(nIDEvent))) + T::OnTimer(nIDEvent); + } afx_msg HCURSOR OnQueryDragIcon() { // @pyvirtual int|PyCWnd|OnQueryDragIcon|Called for the WM_QUERYDRAGICON message. *************** *** 386,389 **** --- 393,397 ---- ON_WM_QUERYNEWPALETTE() ON_WM_PAINT() + ON_WM_TIMER() ON_WM_QUERYDRAGICON() ON_WM_CREATE() |
From: Mark H. <mha...@us...> - 2006-01-10 04:04:11
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1539/win32com/test Added Files: testGIT.py Log Message: Patch from Stefan Schukat for IGlobalInterfaceTable. --- NEW FILE: testGIT.py --- """Testing pasing object between multiple COM threads Uses standard COM marshalling to pass objects between threads. Even though Python generally seems to work when you just pass COM objects between threads, it shouldnt. This shows the "correct" way to do it. It shows that although we create new threads to use the Python.Interpreter, COM marshalls back all calls to that object to the main Python thread, which must be running a message loop (as this sample does). When this test is run in "free threaded" mode (at this stage, you must manually mark the COM objects as "ThreadingModel=Free", or run from a service which has marked itself as free-threaded), then no marshalling is done, and the Python.Interpreter object start doing the "expected" thing - ie, it reports being on the same thread as its caller! Python.exe needs a good way to mark itself as FreeThreaded - at the moment this is a pain in the but! """ import thread, traceback import win32com.client import win32event, win32api import pythoncom def TestInterp(interp): if interp.Eval("1+1") <> 2: raise ValueError, "The interpreter returned the wrong result." try: interp.Eval(1+1) raise ValueError, "The interpreter did not raise an exception" except pythoncom.com_error, details: import winerror if details[0]!=winerror.DISP_E_TYPEMISMATCH: raise ValueError, "The interpreter exception was not winerror.DISP_E_TYPEMISMATCH." def TestInterpInThread(stopEvent, cookie): try: DoTestInterpInThread(cookie) finally: win32event.SetEvent(stopEvent) def CreateGIT(): return pythoncom.CoCreateInstance(pythoncom.CLSID_StdGlobalInterfaceTable, None, pythoncom.CLSCTX_INPROC, pythoncom.IID_IGlobalInterfaceTable) def DoTestInterpInThread(cookie): try: pythoncom.CoInitialize() myThread = win32api.GetCurrentThreadId() GIT = CreateGIT() interp = GIT.GetInterfaceFromGlobal(cookie, pythoncom.IID_IDispatch) interp = win32com.client.Dispatch(interp) TestInterp(interp) interp.Exec("import win32api") print "The test thread id is %d, Python.Interpreter's thread ID is %d" % (myThread, interp.Eval("win32api.GetCurrentThreadId()")) interp = None pythoncom.CoUninitialize() except: traceback.print_exc() def BeginThreadsSimpleMarshal(numThreads, cookie): """Creates multiple threads using simple (but slower) marshalling. Single interpreter object, but a new stream is created per thread. Returns the handles the threads will set when complete. """ ret = [] for i in range(numThreads): hEvent = win32event.CreateEvent(None, 0, 0, None) thread.start_new(TestInterpInThread, (hEvent, cookie)) ret.append(hEvent) return ret def test(fn): print "The main thread is %d" % (win32api.GetCurrentThreadId()) GIT = CreateGIT() interp = win32com.client.Dispatch("Python.Interpreter") cookie = GIT.RegisterInterfaceInGlobal(interp._oleobj_, pythoncom.IID_IDispatch) events = fn(4, cookie) numFinished = 0 while 1: try: rc = win32event.MsgWaitForMultipleObjects(events, 0, 2000, win32event.QS_ALLINPUT) if rc >= win32event.WAIT_OBJECT_0 and rc < win32event.WAIT_OBJECT_0+len(events): numFinished = numFinished + 1 if numFinished >= len(events): break elif rc==win32event.WAIT_OBJECT_0 + len(events): # a message # This is critical - whole apartment model demo will hang. pythoncom.PumpWaitingMessages() else: # Timeout print "Waiting for thread to stop with interfaces=%d, gateways=%d" % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount()) except KeyboardInterrupt: break GIT.RevokeInterfaceFromGlobal(cookie) del interp del GIT if __name__=='__main__': test(BeginThreadsSimpleMarshal) win32api.Sleep(500) # Doing CoUninit here stop Pythoncom.dll hanging when DLLMain shuts-down the process pythoncom.CoUninitialize() if pythoncom._GetInterfaceCount()!=0 or pythoncom._GetGatewayCount()!=0: print "Done with interfaces=%d, gateways=%d" % (pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount()) else: print "Done." |
From: Mark H. <mha...@us...> - 2006-01-10 04:04:11
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1539/win32com/src/include Added Files: PyIGlobalInterfaceTable.h Log Message: Patch from Stefan Schukat for IGlobalInterfaceTable. --- NEW FILE: PyIGlobalInterfaceTable.h --- // This file declares the IGlobalInterfaceTable.h Interface and Gateway for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration class PyIGlobalInterfaceTable : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIGlobalInterfaceTable); static IGlobalInterfaceTable *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *RegisterInterfaceInGlobal(PyObject *self, PyObject *args); static PyObject *RevokeInterfaceFromGlobal(PyObject *self, PyObject *args); static PyObject *GetInterfaceFromGlobal(PyObject *self, PyObject *args); protected: PyIGlobalInterfaceTable(IUnknown *pdisp); ~PyIGlobalInterfaceTable(); }; |
From: Mark H. <mha...@us...> - 2006-01-10 04:04:11
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1539/win32com/src/extensions Added Files: PyIGlobalInterfaceTable.cpp Log Message: Patch from Stefan Schukat for IGlobalInterfaceTable. --- NEW FILE: PyIGlobalInterfaceTable.cpp --- // This file implements the IGlobalInterfaceTable Interface for Python. // Generated by makegw.py #include "stdafx.h" #include "PythonCOM.h" #include "PyIGlobalInterfaceTable.h" // --------------------------------------------------- // // Interface Implementation PyIGlobalInterfaceTable::PyIGlobalInterfaceTable(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIGlobalInterfaceTable::~PyIGlobalInterfaceTable() { } IGlobalInterfaceTable *PyIGlobalInterfaceTable::GetI(PyObject *self) { return (IGlobalInterfaceTable *)PyIUnknown::GetI(self); } PyObject *PyIGlobalInterfaceTable::RegisterInterfaceInGlobal(PyObject *self, PyObject *args) { PyObject *obpUnk = NULL; PyObject *obriid = NULL; IUnknown * pUnk; IID riid; DWORD pdwCookie; PyObject *ppyobRetval = NULL; HRESULT hr; IGlobalInterfaceTable *pIGIT = GetI(self); if ( pIGIT == NULL ) { return NULL; } if (!PyArg_ParseTuple(args, "OO:RegisterInterfaceInGlobal", &obpUnk, &obriid) ) { return NULL; } BOOL bPythonIsHappy = TRUE; if (!PyCom_InterfaceFromPyInstanceOrObject(obpUnk, IID_IUnknown, (void **)&pUnk, TRUE /* bNoneOK */)) bPythonIsHappy = FALSE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if(!bPythonIsHappy) { return NULL; } PY_INTERFACE_PRECALL; hr = pIGIT->RegisterInterfaceInGlobal( pUnk, riid, &pdwCookie ); if (pUnk) pUnk->Release(); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) { return PyCom_BuildPyException(hr, pIGIT, IID_IGlobalInterfaceTable ); } ppyobRetval = Py_BuildValue("l", pdwCookie); return ppyobRetval; } PyObject *PyIGlobalInterfaceTable::RevokeInterfaceFromGlobal(PyObject *self, PyObject *args) { DWORD dwCookie; HRESULT hr; IGlobalInterfaceTable *pIGIT = GetI(self); if ( pIGIT == NULL ) { return NULL; } if (!PyArg_ParseTuple(args, "l:RevokeInterfaceFromGlobal", &dwCookie) ) { return NULL; } PY_INTERFACE_PRECALL; hr = pIGIT->RevokeInterfaceFromGlobal( dwCookie ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) { return PyCom_BuildPyException(hr, pIGIT, IID_IGlobalInterfaceTable ); } Py_INCREF(Py_None); return Py_None; } PyObject *PyIGlobalInterfaceTable::GetInterfaceFromGlobal(PyObject *self, PyObject *args) { PyObject *obriid = NULL; DWORD dwCookie; IID riid; void* ppv; HRESULT hr; IGlobalInterfaceTable *pIGIT = GetI(self); if ( pIGIT == NULL ) { return NULL; } if (!PyArg_ParseTuple(args, "lO:GetInterfaceFromGlobal", &dwCookie, &obriid) ) { return NULL; } BOOL bPythonIsHappy = TRUE; if (!PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE; if(!bPythonIsHappy) { return NULL; } PY_INTERFACE_PRECALL; hr = pIGIT->GetInterfaceFromGlobal( dwCookie, riid, &ppv ); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) { return PyCom_BuildPyException(hr, pIGIT, IID_IGlobalInterfaceTable ); } return PyCom_PyObjectFromIUnknown((IUnknown*)ppv, riid, FALSE); } static struct PyMethodDef PyIGlobalInterfaceTable_methods[] = { { "RegisterInterfaceInGlobal", PyIGlobalInterfaceTable::RegisterInterfaceInGlobal, 1 }, { "RevokeInterfaceFromGlobal", PyIGlobalInterfaceTable::RevokeInterfaceFromGlobal, 1 }, { "GetInterfaceFromGlobal", PyIGlobalInterfaceTable::GetInterfaceFromGlobal, 1 }, { NULL } }; PyComTypeObject PyIGlobalInterfaceTable::type("PyIGlobalInterfaceTable", &PyIUnknown::type, sizeof(PyIGlobalInterfaceTable), PyIGlobalInterfaceTable_methods, GET_PYCOM_CTOR(PyIGlobalInterfaceTable)); |
From: Mark H. <mha...@us...> - 2006-01-10 04:04:11
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1539/win32com/src Modified Files: Register.cpp Log Message: Patch from Stefan Schukat for IGlobalInterfaceTable. Index: Register.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Register.cpp 13 Jul 2004 04:47:15 -0000 1.14 --- Register.cpp 10 Jan 2006 04:04:00 -0000 1.15 *************** *** 52,55 **** --- 52,56 ---- #include "PyIDropTarget.h" #include "PyIOleWindow.h" + #include "PyIGlobalInterfaceTable.h" //PyObject *CLSIDMapping; // Maps CLSIDs onto PyClassObjects *************** *** 217,220 **** --- 218,222 ---- PYCOM_INTERFACE_CLSID_ONLY ( StdComponentCategoriesMgr ), #endif // NO_PYCOM_ICATINFORMATION + PYCOM_INTERFACE_CLSID_ONLY ( StdGlobalInterfaceTable ), // Sort alphabetically just for us poor humans! PYCOM_INTERFACE_CLIENT_ONLY( BindCtx), *************** *** 252,255 **** --- 254,258 ---- PYCOM_INTERFACE_FULL ( ErrorLog), PYCOM_INTERFACE_FULL ( ExternalConnection), + PYCOM_INTERFACE_CLIENT_ONLY( GlobalInterfaceTable), PYCOM_INTERFACE_FULL ( LockBytes), PYCOM_INTERFACE_IID_ONLY ( Marshal ), |
From: Mark H. <mha...@us...> - 2006-01-10 04:04:11
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1539 Modified Files: win32com.dsp Log Message: Patch from Stefan Schukat for IGlobalInterfaceTable. Index: win32com.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com.dsp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** win32com.dsp 13 Jul 2004 04:47:15 -0000 1.26 --- win32com.dsp 10 Jan 2006 04:03:59 -0000 1.27 *************** *** 339,342 **** --- 339,346 ---- # Begin Source File + SOURCE=.\win32com\src\extensions\PyIGlobalInterfaceTable.cpp + # End Source File + # Begin Source File + SOURCE=.\win32com\src\extensions\PyILockBytes.cpp # End Source File *************** *** 507,510 **** --- 511,518 ---- # Begin Source File + SOURCE=.\win32com\src\include\PyIGlobalInterfaceTable.h + # End Source File + # Begin Source File + SOURCE=.\win32com\src\include\PyILockBytes.h # End Source File |
From: Mark H. <mha...@us...> - 2006-01-10 03:43:33
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30824/src Modified Files: PyDEVMODE.cpp PyTime.cpp win32dynamicdialog.cpp win32event.i win32gui.i win32process.i Log Message: [ 1377153 ] Improved Windows CE support, from Luke Dunstan Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** win32process.i 2 May 2005 02:57:25 -0000 1.16 --- win32process.i 10 Jan 2006 03:43:21 -0000 1.17 *************** *** 24,27 **** --- 24,28 ---- static BOOL (WINAPI *fpEnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD) = NULL; static DWORD (WINAPI *fpGetModuleFileNameEx)(HANDLE, HMODULE, WCHAR *, DWORD) = NULL; + #ifndef MS_WINCE static BOOL (WINAPI *fpGetProcessMemoryInfo)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD) = NULL; static BOOL (WINAPI *fpGetProcessTimes)(HANDLE, LPFILETIME, LPFILETIME, LPFILETIME, LPFILETIME) = NULL; *************** *** 32,35 **** --- 33,37 ---- static BOOL (WINAPI *fpGetProcessShutdownParameters)(LPDWORD, LPDWORD) = NULL; static BOOL (WINAPI *fpSetProcessShutdownParameters)(DWORD, DWORD) = NULL; + #endif // Support for a STARTUPINFO object. *************** *** 1025,1028 **** --- 1027,1031 ---- %} + #ifndef MS_WINCE // @pyswig <o dict>|GetProcessMemoryInfo|Returns process memory statistics as a dict representing a PROCESS_MEMORY_COUNTERS struct %native(GetProcessMemoryInfo) PyGetProcessMemoryInfo; *************** *** 1224,1228 **** } %} ! %init %{ --- 1227,1231 ---- } %} ! #endif // MS_WINCE %init %{ *************** *** 1233,1250 **** hmodule=LoadLibrary(_T("Psapi.dll")); if (hmodule!=NULL){ ! fp=GetProcAddress(hmodule, "EnumProcesses"); if (fp!=NULL) fpEnumProcesses=(BOOL (WINAPI *)(DWORD *, DWORD, DWORD *))(fp); ! fp=GetProcAddress(hmodule, "EnumProcessModules"); if (fp!=NULL) fpEnumProcessModules=(BOOL (WINAPI *)(HANDLE, HMODULE *, DWORD, LPDWORD))(fp); ! fp=GetProcAddress(hmodule, "GetModuleFileNameExW"); if (fp!=NULL) fpGetModuleFileNameEx=(DWORD (WINAPI *)(HANDLE, HMODULE, WCHAR *, DWORD))(fp); ! fp=GetProcAddress(hmodule,"GetProcessMemoryInfo"); if (fp!=NULL) fpGetProcessMemoryInfo=(BOOL (WINAPI *)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD))(fp); } hmodule=GetModuleHandle(_T("Kernel32.dll")); if (hmodule==NULL) --- 1236,1256 ---- hmodule=LoadLibrary(_T("Psapi.dll")); if (hmodule!=NULL){ ! fp=GetProcAddress(hmodule, _T("EnumProcesses")); if (fp!=NULL) fpEnumProcesses=(BOOL (WINAPI *)(DWORD *, DWORD, DWORD *))(fp); ! fp=GetProcAddress(hmodule, _T("EnumProcessModules")); if (fp!=NULL) fpEnumProcessModules=(BOOL (WINAPI *)(HANDLE, HMODULE *, DWORD, LPDWORD))(fp); ! fp=GetProcAddress(hmodule, _T("GetModuleFileNameExW")); if (fp!=NULL) fpGetModuleFileNameEx=(DWORD (WINAPI *)(HANDLE, HMODULE, WCHAR *, DWORD))(fp); ! #ifndef MS_WINCE ! fp=GetProcAddress(hmodule,_T("GetProcessMemoryInfo")); if (fp!=NULL) fpGetProcessMemoryInfo=(BOOL (WINAPI *)(HANDLE, PPROCESS_MEMORY_COUNTERS, DWORD))(fp); + #endif } + #ifndef MS_WINCE hmodule=GetModuleHandle(_T("Kernel32.dll")); if (hmodule==NULL) *************** *** 1279,1282 **** --- 1285,1289 ---- fpGetProcessWindowStation=(HWINSTA (WINAPI *)(void))(fp); } + #endif // MS_WINCE %} Index: win32dynamicdialog.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32dynamicdialog.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32dynamicdialog.cpp 19 Nov 2002 10:55:54 -0000 1.2 --- win32dynamicdialog.cpp 10 Jan 2006 03:43:21 -0000 1.3 *************** *** 46,50 **** --- 46,52 ---- #define BASED_CODE + #ifndef ASSERT #define ASSERT(a) + #endif #define RETURN_TYPE_ERR(err) do {PyErr_SetString(PyExc_TypeError,err);return NULL;} while (0) Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PyTime.cpp 6 Mar 2005 23:27:01 -0000 1.14 --- PyTime.cpp 10 Jan 2006 03:43:21 -0000 1.15 *************** *** 15,23 **** #include <oleauto.h> // Time conversion functions on CE. // The Python helpers. ! DL_IMPORT(BOOL) PyCE_UnixTimeToFileTime(time_t t, LPFILETIME pft); ! DL_IMPORT(BOOL) PyCE_UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst); ! DL_IMPORT(BOOL) PyCE_FileTimeToUnixTime(FILETIME *pft, time_t *pt); ! DL_IMPORT(BOOL) PyCE_SystemTimeToUnixTime(SYSTEMTIME *pst, time_t *pt); ! DL_IMPORT(void) PyCE_TimeStructToSystemTime(struct tm *ptm, SYSTEMTIME *pst); #endif --- 15,23 ---- #include <oleauto.h> // Time conversion functions on CE. // The Python helpers. ! BOOL PyCE_UnixTimeToFileTime(time_t t, LPFILETIME pft); ! BOOL PyCE_UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst); ! BOOL PyCE_FileTimeToUnixTime(FILETIME *pft, time_t *pt); ! BOOL PyCE_SystemTimeToUnixTime(SYSTEMTIME *pst, time_t *pt); ! void PyCE_TimeStructToSystemTime(struct tm *ptm, SYSTEMTIME *pst); #endif *************** *** 702,708 **** // We dont have a decent time implementation, but // we need _some_ implementation of these functions! ! extern "C" { ! DL_IMPORT(double) PyCE_SystemTimeToCTime(SYSTEMTIME* pstTime); ! DL_IMPORT(BOOL) PyCE_UnixTimeToFileTime(time_t t, LPFILETIME pft); } --- 702,746 ---- // We dont have a decent time implementation, but // we need _some_ implementation of these functions! ! ! double PyCE_SystemTimeToCTime(SYSTEMTIME* pstTime) ! { ! SYSTEMTIME stBase; ! FILETIME ftTime; ! FILETIME ftBase; ! __int64 iTime; ! __int64 iBase; ! ! SystemTimeToFileTime(pstTime, &ftTime); ! ! stBase.wYear = 1970; ! stBase.wMonth = 1; ! stBase.wDayOfWeek = 1; ! stBase.wDay = 1; ! stBase.wHour = 0; ! stBase.wMinute = 0; ! stBase.wSecond = 0; ! stBase.wMilliseconds = 0; ! SystemTimeToFileTime(&stBase, &ftBase); ! ! iTime=ftTime.dwHighDateTime; ! iTime=iTime << 32; ! iTime |= ftTime.dwLowDateTime; ! ! iBase=ftBase.dwHighDateTime; ! iBase=iBase << 32; ! iBase |= ftBase.dwLowDateTime; ! ! return (double)((iTime - iBase) / 10000000L); ! } ! ! BOOL PyCE_UnixTimeToFileTime(time_t t, LPFILETIME pft) ! { ! // Note that LONGLONG is a 64-bit value ! LONGLONG ll; ! ll = ((__int64)t * 10000000) + 116444736000000000; ! // ll = Int32x32To64(t, 10000000) + 116444736000000000; ! pft->dwLowDateTime = (DWORD)ll; ! pft->dwHighDateTime = (DWORD)(ll >> 32); ! return TRUE; } Index: win32event.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32event.i,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32event.i 30 Jan 2005 13:40:41 -0000 1.7 --- win32event.i 10 Jan 2006 03:43:21 -0000 1.8 *************** *** 101,106 **** --- 101,108 ---- #define SYNCHRONIZE SYNCHRONIZE // Windows NT only: Enables use of the event handle in any of the wait functions to wait for the events state to be signaled. + #ifndef MS_WINCE // @pyswig |CancelWaitableTimer|Cancels a waiting timer. BOOLAPI CancelWaitableTimer(PyHANDLE handle); + #endif #end *************** *** 132,136 **** TCHAR * INPUT_NULLOK // @pyparm <o PyIUnicode>|semaphoreName||semaphore-object name, or None ); - #endif // MS_WINCE PyHANDLE CreateWaitableTimer( --- 134,137 ---- *************** *** 139,142 **** --- 140,144 ---- TCHAR * INPUT_NULLOK // pointer to timer object name ); + #endif // MS_WINCE // GetOverlappedResult *************** *** 284,289 **** ); - #endif /* MS_WINCE */ - //@pyswig handle|OpenWaitableTimer|Opens an existing named waitable timer object PyHANDLE OpenWaitableTimer( --- 286,289 ---- *************** *** 293,296 **** --- 293,298 ---- ); + #endif /* MS_WINCE */ + // @pyswig |PulseEvent|Provides a single operation that sets (to signaled) the state of the specified event object and then resets it (to nonsignaled) after releasing the appropriate number of waiting threads. BOOLAPI PulseEvent( *************** *** 323,326 **** --- 325,329 ---- ); + #ifndef MS_WINCE // @pyswig |SetWaitableTimer|Sets a waitable timer. BOOLAPI_NL SetWaitableTimer( *************** *** 338,341 **** --- 341,345 ---- BOOL bAlertable // alertable flag ); + #endif %{ Index: PyDEVMODE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyDEVMODE.cpp 29 Jul 2005 01:33:08 -0000 1.3 --- PyDEVMODE.cpp 10 Jan 2006 03:43:21 -0000 1.4 *************** *** 5,8 **** --- 5,12 ---- #include "PyWinObjects.h" + #ifdef MS_WINCE + #define DM_SPECVERSION 0 + #endif + // @object PyDEVMODE|Python object wrapping a DEVMODE structure struct PyMethodDef PyDEVMODE::methods[] = { *************** *** 25,30 **** --- 29,36 ---- {"PaperLength", T_SHORT, OFF(devmode.dmPaperLength), 0, "Specified in 1/10 millimeters"}, {"PaperWidth", T_SHORT, OFF(devmode.dmPaperWidth), 0, "Specified in 1/10 millimeters"}, + #ifndef MS_WINCE {"Position_x", T_LONG, OFF(devmode.dmPosition.x), 0, "Position of display relative to desktop"}, {"Position_y", T_LONG, OFF(devmode.dmPosition.y), 0, "Position of display relative to desktop"}, + #endif // {"DisplayOrientation",T_ULONG,OFF(devmode.dmDisplayOrientation), 0, "Display rotation: DMDO_DEFAULT,DMDO_90, DMDO_180, DMDO_270"}, // {"DisplayFixedOutput",T_ULONG,OFF(devmode.dmDisplayFixedOutput), 0, "DMDFO_DEFAULT, DMDFO_CENTER, DMDFO_STRETCH"}, *************** *** 45,48 **** --- 51,57 ---- {"DisplayFlags", T_ULONG, OFF(devmode.dmDisplayFlags), 0, "Combination of DM_GRAYSCALE and DM_INTERLACED"}, {"DisplayFrequency",T_ULONG, OFF(devmode.dmDisplayFrequency), 0, "Refresh rate"}, + #ifdef MS_WINCE + {"DisplayOrientation",T_ULONG,OFF(devmode.dmDisplayOrientation), 0, "Display rotation: DMDO_DEFAULT,DMDO_90, DMDO_180, DMDO_270"}, + #else {"ICMMethod", T_ULONG, OFF(devmode.dmICMMethod), 0, ""}, {"ICMIntent", T_ULONG, OFF(devmode.dmICMIntent), 0, ""}, *************** *** 56,60 **** {"PanningWidth", T_ULONG, OFF(devmode.dmPanningWidth), 0, ""}, {"PanningHeight", T_ULONG, OFF(devmode.dmPanningHeight), 0, ""}, ! #endif {NULL} }; --- 65,71 ---- {"PanningWidth", T_ULONG, OFF(devmode.dmPanningWidth), 0, ""}, {"PanningHeight", T_ULONG, OFF(devmode.dmPanningHeight), 0, ""}, ! {"DriverData", T_OBJECT, OFF(obdummy), 0, "Driver data appended to end of structure"}, ! #endif // WINVER >= 0x0500 ! #endif // !MS_WINCE {NULL} }; Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** win32gui.i 10 Jan 2006 00:22:15 -0000 1.73 --- win32gui.i 10 Jan 2006 03:43:21 -0000 1.74 *************** *** 34,37 **** --- 34,38 ---- #ifdef MS_WINCE #include "winbase.h" + #define IS_INTRESOURCE(res) (((DWORD)(res) & 0xffff0000) == 0) #endif *************** *** 123,130 **** %{ ! extern "C" __declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { if ( dwReason == DLL_PROCESS_ATTACH ) ! g_dllhandle = hInstance; return TRUE; } --- 124,140 ---- %{ ! #ifdef MS_WINCE ! typedef HANDLE HINST_ARG; ! // WinCE gives a compile error this with dllexport ! #define DECLSPEC_DLLMAIN ! #else ! typedef HINSTANCE HINST_ARG; ! #define DECLSPEC_DLLMAIN __declspec(dllexport) ! #endif ! ! extern "C" DECLSPEC_DLLMAIN BOOL WINAPI DllMain(HINST_ARG hInstance, DWORD dwReason, LPVOID lpReserved) { if ( dwReason == DLL_PROCESS_ATTACH ) ! g_dllhandle = (HINSTANCE)hInstance; return TRUE; } *************** *** 169,172 **** --- 179,185 ---- typedef long HBRUSH + %apply HPEN {long}; + typedef long HPEN + %apply HRGN {long}; typedef long HRGN *************** *** 1435,1438 **** --- 1448,1452 ---- } + #ifndef MS_WINCE // @pyswig int|FlashWindow|The FlashWindow function flashes the specified window one time. It does not change the active state of the window. // @pyparm int|hwnd|| *************** *** 1455,1459 **** return NULL; // not on NT ! HMODULE hmod = GetModuleHandle("user32"); BOOL (WINAPI *pfnFW)(PFLASHWINFO) = NULL; if (hmod) --- 1469,1473 ---- return NULL; // not on NT ! HMODULE hmod = GetModuleHandle(_T("user32")); BOOL (WINAPI *pfnFW)(PFLASHWINFO) = NULL; if (hmod) *************** *** 1471,1474 **** --- 1485,1489 ---- %} %native(FlashWindowEx) PyFlashWindowEx; + #endif // MS_WINCE // To avoid LoadLibrary etc (ie, keep my life simple) for functions *************** *** 1710,1715 **** --- 1725,1732 ---- BOOLAPI PostThreadMessage(DWORD dwThreadId, UINT msg, WPARAM wParam, LPARAM lParam); + #ifndef MS_WINCE // @pyswig int|ReplyMessage|Used to reply to a message sent through the SendMessage function without returning control to the function that called SendMessage. BOOLAPI ReplyMessage(int lResult); // @pyparm int|result||Specifies the result of the message processing. The possible values are based on the message sent. + #endif /* not MS_WINCE */ // @pyswig int|RegisterWindowMessage|Defines a new window message that is guaranteed to be unique throughout the system. The message value can be used when sending or posting messages. *************** *** 1771,1774 **** --- 1788,1792 ---- } + #ifndef MS_WINCE // @pyswig |EnumThreadWindows|Enumerates all top-level windows associated with a thread on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last top-level window associated with the thread is enumerated or the callback function returns FALSE static PyObject *PyEnumThreadWindows(PyObject *self, PyObject *args) *************** *** 1825,1832 **** --- 1843,1853 ---- } + #endif /* not MS_WINCE */ %} %native (EnumWindows) PyEnumWindows; + #ifndef MS_WINCE %native (EnumThreadWindows) PyEnumThreadWindows; %native (EnumChildWindows) PyEnumChildWindows; + #endif /* not MS_WINCE */ *************** *** 2009,2012 **** --- 2030,2035 ---- %native (GetWindowText) PyGetWindowText; + int GetWindowTextLength(HWND hwnd); + // @pyswig |InitCommonControls|Initializes the common controls. void InitCommonControls(); *************** *** 2045,2048 **** --- 2068,2072 ---- HCURSOR GetCursor(); + #ifndef MS_WINCE %{ // @pyswig flags, hcursor, (x,y)|GetCursorInfo|Retrieves information about the global cursor. *************** *** 2059,2062 **** --- 2083,2087 ---- %} %native(GetCursorInfo) PyGetCursorInfo; + #endif // @pyswig HACCEL|CreateAcceleratorTable|Creates an accelerator table *************** *** 2127,2133 **** --- 2152,2160 ---- HICON LoadIcon(HINSTANCE hInst, RESOURCE_ID name); + #ifndef MS_WINCE // @pyswig HICON|CopyIcon|Copies an icon // @pyparm int|hicon||Existing icon HICON CopyIcon(HICON hicon); + #endif // @pyswig |DrawIcon|Draws an icon or cursor into the specified device context. *************** *** 2181,2186 **** %native (CreateIconFromResource) PyCreateIconFromResource; - HICON CreateIconIndirect(); - // @pyswig HANDLE|LoadImage|Loads a bitmap, cursor or icon HANDLE LoadImage(HINSTANCE hInst, // @pyparm int|hinst||Handle to an instance of the module that contains the image to be loaded. To load an OEM image, set this parameter to zero. --- 2208,2211 ---- *************** *** 2196,2199 **** --- 2221,2225 ---- #define LR_DEFAULTCOLOR LR_DEFAULTCOLOR + #ifndef MS_WINCE #define LR_CREATEDIBSECTION LR_CREATEDIBSECTION #define LR_DEFAULTSIZE LR_DEFAULTSIZE *************** *** 2204,2207 **** --- 2230,2234 ---- #define LR_SHARED LR_SHARED #define LR_VGACOLOR LR_VGACOLOR + #endif /* not MS_WINCE */ // @pyswig |DeleteObject|Deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. *************** *** 2240,2243 **** --- 2267,2271 ---- ); + #ifndef MS_WINCE // @pyswig int|SetStretchBltMode| // @rdesc If the function succeeds, the return value is the previous stretching mode. *************** *** 2246,2249 **** --- 2274,2278 ---- // @pyparm int|dc|| // @pyparm int|mode|| + #endif /* not MS_WINCE */ %ifdef WINXPGUI *************** *** 2280,2283 **** --- 2309,2313 ---- #define ILC_COLOR ILC_COLOR + #ifndef MS_WINCE #define ILC_COLOR4 ILC_COLOR4 #define ILC_COLOR8 ILC_COLOR8 *************** *** 2285,2288 **** --- 2315,2319 ---- #define ILC_COLOR24 ILC_COLOR24 #define ILC_COLOR32 ILC_COLOR32 + #endif /* not MS_WINCE */ #define ILC_COLORDDB ILC_COLORDDB #define ILC_MASK ILC_MASK *************** *** 2383,2386 **** --- 2414,2418 ---- TCHAR *INPUT_NULLOK); // @pyparm string|WindowName|| + #ifndef MS_WINCE // @pyswig int|FindWindowEx|Retrieves a handle to the top-level window whose class name and window name match the specified strings. HWND FindWindowEx( *************** *** 2403,2412 **** BOOL DragDetect(HWND hWnd, POINT INPUT); - // @pyswig int|GetDoubleClickTime| - UINT GetDoubleClickTime(); - // @pyswig |SetDoubleClickTime| // @pyparm int|newVal|| BOOLAPI SetDoubleClickTime(UINT val); // @pyswig |HideCaret| --- 2435,2445 ---- BOOL DragDetect(HWND hWnd, POINT INPUT); // @pyswig |SetDoubleClickTime| // @pyparm int|newVal|| BOOLAPI SetDoubleClickTime(UINT val); + #endif /* not MS_WINCE */ + + // @pyswig int|GetDoubleClickTime| + UINT GetDoubleClickTime(); // @pyswig |HideCaret| *************** *** 2508,2515 **** ); - - #ifndef MS_WINCE HINSTANCE GetModuleHandle(TCHAR *INPUT_NULLOK); - #endif // @pyswig (left, top, right, bottom)|GetWindowRect| --- 2541,2545 ---- *************** *** 2524,2529 **** --- 2554,2561 ---- void PostQuitMessage(int rc); + #ifndef MS_WINCE // @pyswig |WaitMessage|Waits for a message BOOLAPI WaitMessage(); + #endif /* MS_WINCE */ // @pyswig int|SetWindowPos| *************** *** 2721,2724 **** --- 2753,2774 ---- // Should go in win32sh? %{ + #ifdef MS_WINCE + BOOL PyObject_AsNOTIFYICONDATA(PyObject *ob, NOTIFYICONDATA *pnid) + { + PyObject *obTip=NULL; + memset(pnid, 0, sizeof(*pnid)); + pnid->cbSize = sizeof(*pnid); + if (!PyArg_ParseTuple(ob, "l|iiilO:NOTIFYICONDATA tuple", &pnid->hWnd, &pnid->uID, &pnid->uFlags, &pnid->uCallbackMessage, &pnid->hIcon, &obTip)) + return FALSE; + if (obTip) { + TCHAR *szTip; + if (!PyWinObject_AsTCHAR(obTip, &szTip)) + return NULL; + _tcsncpy(pnid->szTip, szTip, sizeof(pnid->szTip)/sizeof(TCHAR)); + PyWinObject_FreeTCHAR(szTip); + } + return TRUE; + } + #else // MS_WINCE BOOL PyObject_AsNOTIFYICONDATA(PyObject *ob, NOTIFYICONDATA *pnid) { *************** *** 2755,2762 **** --- 2805,2815 ---- return TRUE; } + #endif // MS_WINCE %} #define NIF_ICON NIF_ICON #define NIF_MESSAGE NIF_MESSAGE #define NIF_TIP NIF_TIP + + #ifndef MS_WINCE #define NIF_INFO NIF_INFO #define NIIF_WARNING NIIF_WARNING *************** *** 2764,2767 **** --- 2817,2821 ---- #define NIIF_NONE NIIF_NONE #define NIIF_INFO NIIF_INFO + #endif #define NIM_ADD NIM_ADD // Adds an icon to the status area. *************** *** 2851,2856 **** #ifdef MS_WINCE %{ ! // Where oh where has this function gone, oh where oh where can it be? ! //#include "dbgapi.h" static PyObject *PyNKDbgPrintfW(PyObject *self, PyObject *args) { --- 2905,2909 ---- #ifdef MS_WINCE %{ ! #include "dbgapi.h" static PyObject *PyNKDbgPrintfW(PyObject *self, PyObject *args) { *************** *** 2861,2865 **** if (!PyWinObject_AsTCHAR(obtext, &text)) return NULL; ! // NKDbgPrintfW(_T("%s"), text); PyWinObject_FreeTCHAR(text); Py_INCREF(Py_None); --- 2914,2918 ---- if (!PyWinObject_AsTCHAR(obtext, &text)) return NULL; ! NKDbgPrintfW(_T("%s"), text); PyWinObject_FreeTCHAR(text); Py_INCREF(Py_None); *************** *** 2936,2941 **** --- 2989,2996 ---- #define TPM_NONOTIFY TPM_NONOTIFY #define TPM_RETURNCMD TPM_RETURNCMD + #ifndef MS_WINCE #define TPM_LEFTBUTTON TPM_LEFTBUTTON #define TPM_RIGHTBUTTON TPM_RIGHTBUTTON + #endif /* not MS_WINCE */ %{ *************** *** 2964,2967 **** --- 3019,3023 ---- } + #ifndef MS_WINCE // @pyswig int|ExtractIcon| // @pyparm int|hinstance|| *************** *** 2971,2974 **** --- 3027,3031 ---- // @rdesc The result is a HICON. HICON ExtractIcon(HINSTANCE hinst, TCHAR *modName, UINT index); + #endif /* not MS_WINCE */ // @pyswig int|ExtractIconEx| *************** *** 2983,2996 **** { int i; ! char *fname; int index, nicons=1, nicons_got; ! if (!PyArg_ParseTuple(args, "si|i", &fname, &index, &nicons)) return NULL; if (index==-1) { ! nicons = ExtractIconEx(fname, index, NULL, NULL, 0); return PyInt_FromLong(nicons); } ! if (nicons<=0) return PyErr_Format(PyExc_ValueError, "Must supply a valid number of icons to fetch."); HICON *rgLarge = NULL; HICON *rgSmall = NULL; --- 3040,3061 ---- { int i; ! PyObject *obFname; ! TCHAR *fname; int index, nicons=1, nicons_got; ! if (!PyArg_ParseTuple(args, "Oi|i", &obFname, &index, &nicons)) ! return NULL; ! if (!PyWinObject_AsTCHAR(obFname, &fname, TRUE)) return NULL; + #ifndef MS_WINCE // CE doesn't have this special "-1" handling. if (index==-1) { ! nicons = (int)ExtractIconEx(fname, index, NULL, NULL, 0); ! PyWinObject_FreeTCHAR(fname); return PyInt_FromLong(nicons); } ! #endif // MS_WINCE ! if (nicons<=0) { ! PyWinObject_FreeTCHAR(fname); return PyErr_Format(PyExc_ValueError, "Must supply a valid number of icons to fetch."); + } HICON *rgLarge = NULL; HICON *rgSmall = NULL; *************** *** 3008,3016 **** goto done; } ! nicons_got = ExtractIconEx(fname, index, rgLarge, rgSmall, nicons); if (nicons_got==-1) { PyWin_SetAPIError("ExtractIconEx"); goto done; } // Asking for 1 always says it got 2!? nicons = min(nicons, nicons_got); --- 3073,3085 ---- goto done; } ! nicons_got = (int)ExtractIconEx(fname, index, rgLarge, rgSmall, nicons); if (nicons_got==-1) { PyWin_SetAPIError("ExtractIconEx"); goto done; } + #ifdef MS_WINCE + /* On WinCE >= 2.1 the API actually returns a HICON */ + nicons_got = 1; + #endif // Asking for 1 always says it got 2!? nicons = min(nicons, nicons_got); *************** *** 3025,3028 **** --- 3094,3098 ---- ret = Py_BuildValue("OO", objects_large, objects_small); done: + PyWinObject_FreeTCHAR(fname); Py_XDECREF(objects_large); Py_XDECREF(objects_small); *************** *** 3038,3041 **** --- 3108,3112 ---- BOOLAPI DestroyIcon( HICON hicon); + #ifndef MS_WINCE // @pyswig tuple|GetIconInfo| // @pyparm int|hicon||The icon to query *************** *** 3043,3046 **** --- 3114,3118 ---- // The hbmMask and hbmColor items are bitmaps created for the caller, so must be freed. BOOLAPI GetIconInfo( HICON hicon, ICONINFO *OUTPUT); + #endif /* not MS_WINCE */ // @pyswig |ScreenToClient|Convert screen coordinates to client coords *************** *** 3133,3136 **** --- 3205,3209 ---- #endif + #ifndef MS_WINCE // @pyswig int|GetMenuItemCount| int GetMenuItemCount(HMENU hMenu); *************** *** 3147,3150 **** --- 3220,3224 ---- // @pyswig |GetMenuDefaultItem| int GetMenuDefaultItem(HMENU hMenu, UINT fByPos, UINT flags); + #endif /* not MS_WINCE */ // @pyswig |AppendMenu| *************** *** 3155,3163 **** // @pyswig |EnableMenuItem| ! BOOLAPI EnableMenuItem(HMENU hMenu, UINT uIDEnableItem, UINT uEnable); // @pyswig int|CheckMenuItem| int CheckMenuItem(HMENU hMenu, UINT uIDCheckItem, UINT uCheck); // @pyswig |ModifyMenu|Changes an existing menu item. This function is used to specify the content, appearance, and behavior of the menu item. BOOLAPI ModifyMenu( --- 3229,3241 ---- // @pyswig |EnableMenuItem| ! BOOL EnableMenuItem(HMENU hMenu, UINT uIDEnableItem, UINT uEnable); // @pyswig int|CheckMenuItem| int CheckMenuItem(HMENU hMenu, UINT uIDCheckItem, UINT uCheck); + // @pyswig HMENU|GetSubMenu| + HMENU GetSubMenu(HMENU hMenu, int nPos); + + #ifndef MS_WINCE // @pyswig |ModifyMenu|Changes an existing menu item. This function is used to specify the content, appearance, and behavior of the menu item. BOOLAPI ModifyMenu( *************** *** 3166,3170 **** UINT uFlags, // @pyparm int|uFlags||options UINT uIDNewItem, // @pyparm int|uIDNewItem||identifier, menu, or submenu ! LPCTSTR lpNewItem // @pyparm string|newItem||menu item content ); --- 3244,3248 ---- UINT uFlags, // @pyparm int|uFlags||options UINT uIDNewItem, // @pyparm int|uIDNewItem||identifier, menu, or submenu ! TCHAR *INPUT // @pyparm string|newItem||menu item content ); *************** *** 3183,3186 **** --- 3261,3265 ---- HBITMAP hBitmapChecked // @pyparm int|hBitmapChecked||handle to checked bitmap ); + #endif /* not MS_WINCE */ // @pyswig |CheckMenuRadioItem|Checks a specified menu item and makes it a *************** *** 3220,3224 **** int DrawText( HDC hDC, // @pyparm int/<o PyHANDLE>|hDC||The device context on which to draw ! LPCTSTR lpString, // @pyparm str|String||The text to be drawn int nCount, // @pyparm int|nCount||The number of characters, use -1 for simple null-terminated string RECT *BOTH, // @pyparm tuple|Rect||Tuple of 4 ints specifying the position (left, top, right, bottom) --- 3299,3303 ---- int DrawText( HDC hDC, // @pyparm int/<o PyHANDLE>|hDC||The device context on which to draw ! TCHAR *INPUT, // @pyparm str|String||The text to be drawn int nCount, // @pyparm int|nCount||The number of characters, use -1 for simple null-terminated string RECT *BOTH, // @pyparm tuple|Rect||Tuple of 4 ints specifying the position (left, top, right, bottom) *************** *** 3243,3246 **** --- 3322,3327 ---- // @pyswig |CreateSolidBrush| HBRUSH CreateSolidBrush(COLORREF color); + // @pyswid |CreatePen| + HPEN CreatePen(int fnPenStyle, int nWidth, COLORREF crColor); // @pyswig |GetSysColor| DWORD GetSysColor(int nIndex); *************** *** 3249,3256 **** --- 3330,3341 ---- // @pyswig |InvalidateRect| BOOLAPI InvalidateRect(HWND hWnd, RECT *INPUT_NULLOK , BOOL bErase); + #ifndef MS_WINCE // @pyswig |FrameRect| int FrameRect(HDC hDC, RECT *INPUT, HBRUSH hbr); + #endif /* not MS_WINCE */ // @pyswig |GetUpdateRgn| int GetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase); + // @pyswig |Rectangle| + BOOLAPI Rectangle(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect); // @pyswig hdc, paintstruct|BeginPaint| *************** *** 3307,3313 **** --- 3392,3400 ---- ); + #ifndef MS_WINCE // @pyswig |IsIconic|determines whether the specified window is minimized (iconic). BOOL IsIconic( HWND hWnd // @pyparm int|hWnd||handle to window ); + #endif /* not MS_WINCE */ *************** *** 3328,3334 **** --- 3415,3424 ---- // @pyswig |SetCapture|Captures the mouse for the specified window. HWND SetCapture(HWND hWnd); + + #ifndef MS_WINCE // @pyswig |_TrackMouseEvent|Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount of time. // @pyparm <o TRACKMOUSEEVENT>|tme|| BOOLAPI _TrackMouseEvent(TRACKMOUSEEVENT *INPUT); + #endif // @pyswig int|ReleaseDC|Releases a device context. *************** *** 3529,3533 **** { HWND hwnd; ! char buf[256]; // @pyparm int|hwnd||The handle to the window if (!PyArg_ParseTuple(args, "i:GetClassName", &hwnd)) --- 3619,3623 ---- { HWND hwnd; ! TCHAR buf[256]; // @pyparm int|hwnd||The handle to the window if (!PyArg_ParseTuple(args, "i:GetClassName", &hwnd)) *************** *** 3537,3541 **** if (nchars==0) PyWin_SetAPIError("GetClassName"); ! return PyString_FromStringAndSize(buf, nchars); } %} --- 3627,3631 ---- if (nchars==0) PyWin_SetAPIError("GetClassName"); ! return PyWinObject_FromTCHAR(buf, nchars); } %} *************** *** 3551,3554 **** --- 3641,3645 ---- HWND ChildWindowFromPoint(HWND INPUT, POINT INPUT); + #ifndef MS_WINCE // @pyswig int|ChildWindowFromPoint|Determines which, if any, of the child windows belonging to a parent window contains the specified point. // @pyparm int|hwndParent||The parent. *************** *** 3556,3559 **** --- 3647,3651 ---- // @pyparm int|flags||Specifies which child windows to skip. This parameter can be one or more of the CWP_* constants. HWND ChildWindowFromPointEx(HWND INPUT, POINT INPUT, int flags); + #endif // Sorting for controls *************** *** 3635,3638 **** --- 3727,3745 ---- return Py_None; } + #else // PYVERSION + static PyObject *PyListView_SortItems(PyObject *self, PyObject *args) + { + PyErr_SetString(PyExc_NotImplementedError, + "This requires Python 2.3 or greater"); + return NULL; + } + #endif // PYVERSION 2.3+ + %} + + %native (ListView_SortItems) PyListView_SortItems; + + #ifndef MS_WINCE + %{ + #if (PY_VERSION_HEX >= 0x02030000) // PyGILState only in 2.3+ // @pyswig |ListView_SortItemsEx|Uses an application-defined comparison function to sort the items of a list view control. static PyObject * *************** *** 3669,3707 **** return NULL; } ! static PyObject *PyListView_SortItems(PyObject *self, PyObject *args) ! { ! PyErr_SetString(PyExc_NotImplementedError, ! "This requires Python 2.3 or greater"); ! return NULL; ! } ! #endif // PYVERSION 2.3+ %} - - %native (ListView_SortItems) PyListView_SortItems; %native (ListView_SortItemsEx) PyListView_SortItemsEx; ! // @pyswig int|CreateDC|Creates a device context for a printer or display device ! %native (CreateDC) PyCreateDC; ! %{ ! static PyObject *PyCreateDC(PyObject *self, PyObject *args) { ! PDEVMODE pdevmode; ! PyObject *obdevmode=NULL; ! char *driver, *device, *dummyoutput=NULL; ! HDC hdc; ! // @pyparm string|Driver||Name of display or print provider, usually DISPLAY or WINSPOOL ! // @pyparm string|Device||Name of specific device, eg printer name returned from GetDefaultPrinter ! // @pyparm <o PyDEVMODE>|InitData||A PyDEVMODE that specifies printing parameters, use None for printer defaults ! if (!PyArg_ParseTuple(args, "szO", &driver, &device, &obdevmode)) ! return NULL; ! if (!PyWinObject_AsDEVMODE(obdevmode, &pdevmode, TRUE)) ! return NULL; ! hdc=CreateDC(driver, device, dummyoutput, pdevmode); ! if (hdc!=NULL) ! return Py_BuildValue("l",hdc); ! PyWin_SetAPIError("CreateDC",GetLastError()); return NULL; } ! %} %{ --- 3776,3800 ---- return NULL; } ! #endif // PYVERSION %} %native (ListView_SortItemsEx) PyListView_SortItemsEx; + #endif // !MS_WINCE ! %typemap(python,in) DEVMODE *INPUT { ! if(!PyWinObject_AsDEVMODE($source, &$target, TRUE)) return NULL; } ! ! %typemap(python,arginit) DEVMODE * ! { ! $target = NULL; ! } ! ! // @pyswig int|CreateDC|Creates a device context for a printer or display device ! // @pyparm string|Driver||Name of display or print provider, usually DISPLAY or WINSPOOL ! // @pyparm string|Device||Name of specific device, eg printer name returned from GetDefaultPrinter ! // @pyparm <o PyDEVMODE>|InitData||A PyDEVMODE that specifies printing parameters, use None for printer defaults ! HDC CreateDC(TCHAR *INPUT_NULLOK, TCHAR *INPUT_NULLOK, TCHAR *INPUT, DEVMODE *INPUT); %{ *************** *** 3941,3945 **** --- 4034,4040 ---- BOOL boolParam; UINT uintParam; + #ifndef MS_WINCE long longParam; + #endif if (!PyArg_ParseTupleAndKeywords(args, kwargs, "k|Ok", keywords, *************** *** 3951,3954 **** --- 4046,4050 ---- // @flagh Action|Input/return type switch (Action){ + #ifndef MS_WINCE // @flag SPI_GETDESKWALLPAPER|Returns the path to the bmp used as wallpaper case SPI_GETDESKWALLPAPER: *************** *** 4036,4039 **** --- 4132,4136 ---- // @flag SPI_GETSCREENREADER|Returns a boolean case SPI_GETSCREENREADER: + #endif // !MS_WINCE // @flag SPI_GETSHOWSOUNDS|Returns a boolean case SPI_GETSHOWSOUNDS: *************** *** 4041,4044 **** --- 4138,4142 ---- break; + #ifndef MS_WINCE // Actions in this section accept a boolean as pvParam // @flag SPI_SETDROPSHADOW|Param must be a boolean *************** *** 4115,4118 **** --- 4213,4217 ---- // @flag SPI_SETSCREENREADER|Param is a boolean case SPI_SETSCREENREADER: + #endif // !MS_WINCE // @flag SPI_SETSHOWSOUNDS|Param is a boolean case SPI_SETSHOWSOUNDS: *************** *** 4122,4130 **** --- 4221,4232 ---- break; + #ifndef MS_WINCE // These accept an int placed in uiParam // @flag SPI_SETMOUSETRAILS|Param should be an int specifying the nbr of cursors in the trail (0 or 1 means disabled) case SPI_SETMOUSETRAILS: + #endif // !MS_WINCE // @flag SPI_SETWHEELSCROLLLINES|Param is an int specifying nbr of lines case SPI_SETWHEELSCROLLLINES: + #ifndef MS_WINCE // @flag SPI_SETKEYBOARDDELAY|Param is an int in the range 0 - 3 case SPI_SETKEYBOARDDELAY: *************** *** 4157,4160 **** --- 4259,4263 ---- // @flag SPI_SETBORDER|Param is an int case SPI_SETBORDER: + #endif // !MS_WINCE if (!PyObject_AsUINT(obParam, &uiParam)) goto done; *************** *** 4164,4167 **** --- 4267,4271 ---- // @flag SPI_GETFONTSMOOTHINGCONTRAST|Returns an int case SPI_GETFONTSMOOTHINGCONTRAST: + #ifndef MS_WINCE // @flag SPI_GETFONTSMOOTHINGTYPE|Returns an int case SPI_GETFONTSMOOTHINGTYPE: *************** *** 4182,4187 **** --- 4286,4293 ---- // @flag SPI_GETMOUSEHOVERTIME|Returns an int case SPI_GETMOUSEHOVERTIME: + #endif // !MS_WINCE // @flag SPI_GETSCREENSAVETIMEOUT|Returns an int (idle time in seconds) case SPI_GETSCREENSAVETIMEOUT: + #ifndef MS_WINCE // @flag SPI_GETMENUSHOWDELAY|Returns an int (shortcut delay in milliseconds) case SPI_GETMENUSHOWDELAY: *************** *** 4206,4209 **** --- 4312,4316 ---- // @flag SPI_GETMOUSECLICKLOCKTIME|Returns an int (in milliseconds) case SPI_GETMOUSECLICKLOCKTIME: + #endif // !MS_WINCE pvParam=&uintParam; break; *************** *** 4212,4215 **** --- 4319,4323 ---- // @flag SPI_SETFONTSMOOTHINGCONTRAST|Param should be an int in the range 1000 to 2200 case SPI_SETFONTSMOOTHINGCONTRAST: + #ifndef MS_WINCE // @flag SPI_SETFONTSMOOTHINGTYPE|Param should be one of the FE_FONTSMOOTHING* constants case SPI_SETFONTSMOOTHINGTYPE: *************** *** 4230,4237 **** --- 4338,4347 ---- // @flag SPI_SETMOUSECLICKLOCKTIME|Param is an int (in milliseconds) case SPI_SETMOUSECLICKLOCKTIME: + #endif // !MS_WINCE if (!PyObject_AsUINT(obParam, (UINT *)&pvParam)) goto done; break; + #ifndef MS_WINCE // @flag SPI_GETICONTITLELOGFONT|Returns a <o PyLOGFONT>, case SPI_GETICONTITLELOGFONT: *************** *** 4260,4263 **** --- 4370,4374 ---- case SPI_SETICONS: break; + #endif // !MS_WINCE // @flag SPI_GETMOUSE|Returns a tuple of 3 ints containing the x and y mouse thresholds and the acceleration factor. *************** *** 4289,4292 **** --- 4400,4404 ---- } + #ifndef MS_WINCE // @flag SPI_GETDEFAULTINPUTLANG|Returns an int (locale id for default language) case SPI_GETDEFAULTINPUTLANG: *************** *** 4330,4333 **** --- 4442,4446 ---- goto done; break; + #endif // !MS_WINCE // below are not handled yet *************** *** 4380,4383 **** --- 4493,4497 ---- switch (Action){ + #ifndef MS_WINCE case SPI_GETDESKWALLPAPER: ret=PyWinObject_FromTCHAR((TCHAR *)pvParam); *************** *** 4416,4426 **** case SPI_GETMOUSEVANISH: case SPI_GETSCREENREADER: case SPI_GETSHOWSOUNDS: ret=PyBool_FromLong(boolParam); break; ! case SPI_GETFONTSMOOTHINGCONTRAST: case SPI_GETFONTSMOOTHINGTYPE: case SPI_GETMOUSETRAILS: - case SPI_GETWHEELSCROLLLINES: case SPI_GETKEYBOARDDELAY: case SPI_GETKEYBOARDSPEED: --- 4530,4540 ---- case SPI_GETMOUSEVANISH: case SPI_GETSCREENREADER: + #endif // !MS_WINCE case SPI_GETSHOWSOUNDS: ret=PyBool_FromLong(boolParam); break; ! #ifndef MS_WINCE case SPI_GETFONTSMOOTHINGTYPE: case SPI_GETMOUSETRAILS: case SPI_GETKEYBOARDDELAY: case SPI_GETKEYBOARDSPEED: *************** *** 4429,4433 **** case SPI_GETMOUSEHOVERWIDTH: case SPI_GETMOUSEHOVERTIME: - case SPI_GETSCREENSAVETIMEOUT: case SPI_GETMENUSHOWDELAY: case SPI_GETLOWPOWERTIMEOUT: --- 4543,4546 ---- *************** *** 4441,4446 **** --- 4554,4564 ---- case SPI_GETFOCUSBORDERWIDTH: case SPI_GETMOUSECLICKLOCKTIME: + #endif // !MS_WINCE + case SPI_GETFONTSMOOTHINGCONTRAST: + case SPI_GETWHEELSCROLLLINES: + case SPI_GETSCREENSAVETIMEOUT: ret=PyLong_FromUnsignedLong(uintParam); break; + #ifndef MS_WINCE case SPI_GETDEFAULTINPUTLANG: ret=PyLong_FromLong(longParam); *************** *** 4449,4455 **** --- 4567,4575 ---- ret=new PyLOGFONT((LOGFONT *)pvParam); break; + #endif // !MS_WINCE case SPI_GETMOUSE: ret=Py_BuildValue("kkk", ((UINT *)pvParam)[0], ((UINT *)pvParam)[1], ((UINT *)pvParam)[2]); break; + #ifndef MS_WINCE case SPI_GETANIMATION: ret=PyInt_FromLong(((ANIMATIONINFO *)pvParam)->iMinAnimate); *************** *** 4465,4468 **** --- 4585,4589 ---- } break; + #endif // !MS_WINCE default: *************** *** 4473,4482 **** done: switch (Action){ case SPI_GETDESKWALLPAPER: case SPI_GETICONTITLELOGFONT: - case SPI_GETMOUSE: - case SPI_SETMOUSE: case SPI_GETANIMATION: case SPI_SETANIMATION: if (pvParam!=NULL) free(pvParam); --- 4594,4605 ---- done: switch (Action){ + #ifndef MS_WINCE case SPI_GETDESKWALLPAPER: case SPI_GETICONTITLELOGFONT: case SPI_GETANIMATION: case SPI_SETANIMATION: + #endif // !MS_WINCE + case SPI_GETMOUSE: + case SPI_SETMOUSE: if (pvParam!=NULL) free(pvParam); |
From: Mark H. <mha...@us...> - 2006-01-10 01:22:04
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8722 Removed Files: axcontrol.dsp Log Message: axcontrol.dsp no longer used. --- axcontrol.dsp DELETED --- |
From: Mark H. <mha...@us...> - 2006-01-10 01:19:48
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8426 Added Files: ietoolbar.py Log Message: IE toolbar sample contributed by Leonard Ritter. --- NEW FILE: ietoolbar.py --- # encoding: latin-1 # PyWin32 Internet Explorer Toolbar # # written by Leonard Ritter (pa...@gm...) # and Robert Förtsch (in...@ro...) """ This sample implements a simple IE Toolbar COM server supporting Windows XP styles and access to the IWebBrowser2 interface. It also demonstrates how to hijack the parent window to catch WM_COMMAND messages. """ # imports section import sys, os from win32com import universal from win32com.client import gencache, DispatchWithEvents, Dispatch from win32com.client import constants, getevents import win32com import pythoncom import _winreg from win32com.shell import shell from win32com.shell.shellcon import * from win32com.axcontrol import axcontrol try: # try to get styles (winxp) import winxpgui as win32gui except: # import default module (win2k and lower) import win32gui import win32ui import win32con import commctrl import array, struct # ensure we know the ms internet controls typelib so we have access to IWebBrowser2 later on win32com.client.gencache.EnsureModule('{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}',0,1,1) # IDeskBand_methods = ['GetBandInfo'] IDockingWindow_methods = ['ShowDW','CloseDW','ResizeBorderDW'] IOleWindow_methods = ['GetWindow','ContextSensitiveHelp'] IInputObject_methods = ['UIActivateIO','HasFocusIO','TranslateAcceleratorIO'] IObjectWithSite_methods = ['SetSite','GetSite'] IPersistStream_methods = ['GetClassID','IsDirty','Load','Save','GetSizeMax'] _ietoolbar_methods_ = IDeskBand_methods + IDockingWindow_methods + \ IOleWindow_methods + IInputObject_methods + \ IObjectWithSite_methods + IPersistStream_methods _ietoolbar_com_interfaces_ = [ shell.IID_IDeskBand, # IDeskBand axcontrol.IID_IObjectWithSite, # IObjectWithSite pythoncom.IID_IPersistStream, axcontrol.IID_IOleCommandTarget, ] class WIN32STRUCT: def __init__(self, **kw): full_fmt = "" for name, fmt, default in self._struct_items_: self.__dict__[name] = None if fmt == "z": full_fmt += "pi" else: full_fmt += fmt for name, val in kw.items(): self.__dict__[name] = val def __setattr__(self, attr, val): if not attr.startswith("_") and not self.__dict__.has_key(attr): raise AttributeError, attr self.__dict__[attr] = val def toparam(self): self._buffs = [] full_fmt = "" vals = [] for name, fmt, default in self._struct_items_: val = self.__dict__[name] if fmt == "z": fmt = "Pi" if val is None: vals.append(0) vals.append(0) else: str_buf = array.array("c", val+'\0') vals.append(str_buf.buffer_info()[0]) vals.append(len(val)) self._buffs.append(str_buf) # keep alive during the call. else: if val is None: val = default vals.append(val) full_fmt += fmt return apply(struct.pack, (full_fmt,) + tuple(vals) ) class TBBUTTON(WIN32STRUCT): _struct_items_ = [ ("iBitmap", "i", 0), ("idCommand", "i", 0), ("fsState", "B", 0), ("fsStyle", "B", 0), ("bReserved", "H", 0), ("dwData", "I", 0), ("iString", "z", None), ] class Stub: """ this class serves as a method stub, outputting debug info whenever the object is being called. """ def __init__(self,name): self.name = name def __call__(self,*args): print 'STUB: ',self.name,args class IEToolbarCtrl: """ a tiny wrapper for our winapi-based toolbar control implementation. """ def __init__(self,hwndparent): styles = win32con.WS_CHILD \ | win32con.WS_VISIBLE \ | win32con.WS_CLIPSIBLINGS \ | win32con.WS_CLIPCHILDREN \ | commctrl.TBSTYLE_LIST \ | commctrl.TBSTYLE_FLAT \ | commctrl.TBSTYLE_TRANSPARENT \ | commctrl.CCS_TOP \ | commctrl.CCS_NODIVIDER \ | commctrl.CCS_NORESIZE \ | commctrl.CCS_NOPARENTALIGN self.hwnd = win32gui.CreateWindow('ToolbarWindow32', None, styles, 0, 0, 100, 100, hwndparent, 0, win32gui.dllhandle, None) win32gui.SendMessage(self.hwnd, commctrl.TB_BUTTONSTRUCTSIZE, 20, 0) def ShowWindow(self,mode): win32gui.ShowWindow(self.hwnd,mode) def AddButtons(self,*buttons): tbbuttons = '' for button in buttons: tbbuttons += button.toparam() return win32gui.SendMessage(self.hwnd, commctrl.TB_ADDBUTTONS, len(buttons), tbbuttons) def GetSafeHwnd(self): return self.hwnd class IEToolbar: """ The actual COM server class """ _com_interfaces_ = _ietoolbar_com_interfaces_ _public_methods_ = _ietoolbar_methods_ _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER # if you copy and modify this example, be sure to change the clsid below _reg_clsid_ = "{F21202A2-959A-4149-B1C3-68B9013F3335}" _reg_progid_ = "PyWin32.IEToolbar" _reg_desc_ = 'PyWin32 IE Toolbar' def __init__( self ): # put stubs for non-implemented methods for method in self._public_methods_: if not hasattr(self,method): print 'providing default stub for %s' % method setattr(self,method,Stub(method)) def GetWindow(self): return self.toolbar.GetSafeHwnd() def Load(self, stream): # called when the toolbar is loaded pass def Save(self, pStream, fClearDirty): # called when the toolbar shall save its information pass def CloseDW(self, dwReserved): del self.toolbar def ShowDW(self, bShow): if bShow: self.toolbar.ShowWindow(win32con.SW_SHOW) else: self.toolbar.ShowWindow(win32con.SW_HIDE) def on_first_button(self): print "first!" self.webbrowser.Navigate2('http://starship.python.net/crew/mhammond/') def on_second_button(self): print "second!" def on_third_button(self): print "third!" def toolbar_command_handler(self,args): hwnd,message,wparam,lparam,time,point = args if lparam == self.toolbar.GetSafeHwnd(): self._command_map[wparam]() def SetSite(self,unknown): if unknown: # retrieve the parent window interface for this site olewindow = unknown.QueryInterface(pythoncom.IID_IOleWindow) # ask the window for its handle hwndparent = olewindow.GetWindow() # first get a command target cmdtarget = unknown.QueryInterface(axcontrol.IID_IOleCommandTarget) # then travel over to a service provider serviceprovider = cmdtarget.QueryInterface(pythoncom.IID_IServiceProvider) # finally ask for the internet explorer application, returned as a dispatch object self.webbrowser = win32com.client.Dispatch(serviceprovider.QueryService('{0002DF05-0000-0000-C000-000000000046}',pythoncom.IID_IDispatch)) # now create and set up the toolbar self.toolbar = IEToolbarCtrl(hwndparent) buttons = [ ('Visit PyWin32 Homepage',self.on_first_button), ('Another Button', self.on_second_button), ('Yet Another Button', self.on_third_button), ] self._command_map = {} # wrap our parent window so we can hook message handlers window = win32ui.CreateWindowFromHandle(hwndparent) # add the buttons for i in range(len(buttons)): button = TBBUTTON() name,func = buttons[i] id = 0x4444+i button.iBitmap = -2 button.idCommand = id button.fsState = commctrl.TBSTATE_ENABLED button.fsStyle = commctrl.TBSTYLE_BUTTON button.iString = name self._command_map[0x4444+i] = func self.toolbar.AddButtons(button) window.HookMessage(self.toolbar_command_handler,win32con.WM_COMMAND) else: # lose all references self.webbrowser = None def GetClassID(self): return self._reg_clsid_ def GetBandInfo(self, dwBandId, dwViewMode, dwMask): ptMinSize = (0,24) ptMaxSize = (2000,24) ptIntegral = (0,0) ptActual = (2000,24) wszTitle = 'PyWin32 IE Toolbar' dwModeFlags = DBIMF_VARIABLEHEIGHT crBkgnd = 0 return (ptMinSize,ptMaxSize,ptIntegral,ptActual,wszTitle,dwModeFlags,crBkgnd) # used for HKLM install def DllInstall( bInstall, cmdLine ): comclass = IEToolbar # register plugin def DllRegisterServer(): comclass = IEToolbar # register toolbar with IE try: print "Trying to register Toolbar.\n" hkey = _winreg.CreateKey( _winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Internet Explorer\\Toolbar" ) subKey = _winreg.SetValueEx( hkey, comclass._reg_clsid_, 0, _winreg.REG_BINARY, "\0" ) except WindowsError: print "Couldn't set registry value.\nhkey: %d\tCLSID: %s\n" % ( hkey, comclass._reg_clsid_ ) else: print "Set registry value.\nhkey: %d\tCLSID: %s\n" % ( hkey, comclass._reg_clsid_ ) # TODO: implement reg settings for standard toolbar button # unregister plugin def DllUnregisterServer(): comclass = IEToolbar # unregister toolbar from internet explorer try: print "Trying to unregister Toolbar.\n" hkey = _winreg.CreateKey( _winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Internet Explorer\\Toolbar" ) _winreg.DeleteValue( hkey, comclass._reg_clsid_ ) except WindowsError: print "Couldn't delete registry value.\nhkey: %d\tCLSID: %s\n" % ( hkey, comclass._reg_clsid_ ) else: print "Deleting reg key succeeded.\n" # entry point if __name__ == '__main__': import win32com.server.register win32com.server.register.UseCommandLine( IEToolbar ) # parse actual command line option if "--unregister" in sys.argv: DllUnregisterServer() else: DllRegisterServer() else: # import trace utility for remote debugging import win32traceutil |
From: Mark H. <mha...@us...> - 2006-01-10 00:52:12
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1155/com/win32comext/shell Modified Files: shellcon.py Log Message: More shell constants. Index: shellcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/shellcon.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shellcon.py 16 May 2005 04:26:31 -0000 1.14 --- shellcon.py 10 Jan 2006 00:52:04 -0000 1.15 *************** *** 936,937 **** --- 936,956 ---- SHGVSPB_USERDEFAULTS = SHGVSPB_PERUSER | SHGVSPB_ALLFOLDERS SHGVSPB_GLOBALDEAFAULTS = SHGVSPB_ALLUSERS | SHGVSPB_ALLFOLDERS + + # IDeskband and related + DBIM_MINSIZE = 0x0001 + DBIM_MAXSIZE = 0x0002 + DBIM_INTEGRAL = 0x0004 + DBIM_ACTUAL = 0x0008 + DBIM_TITLE = 0x0010 + DBIM_MODEFLAGS = 0x0020 + DBIM_BKCOLOR = 0x0040 + + DBIMF_NORMAL = 0x0000 + DBIMF_VARIABLEHEIGHT = 0x0008 + DBIMF_DEBOSSED = 0x0020 + DBIMF_BKCOLOR = 0x0040 + + DBIF_VIEWMODE_NORMAL = 0x0000 + DBIF_VIEWMODE_VERTICAL = 0x0001 + DBIF_VIEWMODE_FLOATING = 0x0002 + DBIF_VIEWMODE_TRANSPARENT = 0x0004 |
From: Mark H. <mha...@us...> - 2006-01-10 00:51:24
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv816/com/win32com/client Modified Files: dynamic.py Log Message: The 'user name' (really the 'display name') of a COM object should never be unicode. Index: dynamic.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dynamic.py 9 Apr 2004 11:22:45 -0000 1.20 --- dynamic.py 10 Jan 2006 00:51:15 -0000 1.21 *************** *** 43,47 **** winerror.DISP_E_PARAMNOTOPTIONAL, winerror.DISP_E_TYPEMISMATCH, ! winerror.E_INVALIDARG, ] --- 43,47 ---- winerror.DISP_E_PARAMNOTOPTIONAL, winerror.DISP_E_TYPEMISMATCH, ! winerror.E_INVALIDARG, ] *************** *** 65,72 **** print ! # get the dispatch type in use. dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch] iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown] - _StringOrUnicodeType=[StringType, UnicodeType] _GoodDispatchType=[StringType,IIDType,UnicodeType] _defaultDispatchItem=build.DispatchItem --- 65,71 ---- print ! # get the type objects for IDispatch and IUnknown dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch] iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown] _GoodDispatchType=[StringType,IIDType,UnicodeType] _defaultDispatchItem=build.DispatchItem *************** *** 83,92 **** return IDispatch ! def _GetGoodDispatchAndUserName(IDispatch,userName,clsctx): if userName is None: ! if type(IDispatch) in _StringOrUnicodeType: userName = IDispatch ! else: ! userName = "<unknown>" return (_GetGoodDispatch(IDispatch, clsctx), userName) --- 82,99 ---- return IDispatch ! def _GetGoodDispatchAndUserName(IDispatch, userName, clsctx): ! # Get a dispatch object, and a 'user name' (ie, the name as ! # displayed to the user in repr() etc. if userName is None: ! if type(IDispatch) == StringType: userName = IDispatch ! elif type(IDispatch) == UnicodeType: ! # We always want the displayed name to be a real string ! userName = IDispatch.encode("ascii", "replace") ! elif type(userName) == UnicodeType: ! # As above - always a string... ! userName = userName.encode("ascii", "replace") ! else: ! userName = str(userName) return (_GetGoodDispatch(IDispatch, clsctx), userName) |
From: Mark H. <mha...@us...> - 2006-01-10 00:49:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv530/com/win32com/src Modified Files: PyIDispatch.cpp Log Message: Document InvokeTypes. Index: PyIDispatch.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIDispatch.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyIDispatch.cpp 7 Sep 2004 02:12:22 -0000 1.9 --- PyIDispatch.cpp 10 Jan 2006 00:49:43 -0000 1.10 *************** *** 291,299 **** return OleSetTypeError("not enough arguments (at least 5 needed)"); ! DISPID dispid = PyInt_AsLong(PyTuple_GET_ITEM(args, 0)); // @pyparm int|dispid||The dispid to use. Please see <om PyIDispatch.Invoke>. ! LCID lcid = PyInt_AsLong(PyTuple_GET_ITEM(args, 1)); // @pyparm int|lcid||The locale ID. Please see <om PyIDispatch.Invoke>. ! UINT wFlags = PyInt_AsLong(PyTuple_GET_ITEM(args, 2)); // @pyparm int|wFlags||Flags for the call. Please see <om PyIDispatch.Invoke>. ! PyObject *resultElemDesc = PyTuple_GET_ITEM(args, 3); // @pyparm tuple|resultTypeDesc||A tuple describing the type of the result. ! PyObject *argsElemDescArray = PyTuple_GET_ITEM(args, 4); // @pyparm (tuple, ...)|typeDesc||A sequence of tuples describing the types of the parameters for the function. // @pyparm object, ...|args||The args to the function. if ( PyErr_Occurred() ) --- 291,307 ---- return OleSetTypeError("not enough arguments (at least 5 needed)"); ! // @pyparm int|dispid||The dispid to use. Please see <om PyIDispatch.Invoke>. ! DISPID dispid = PyInt_AsLong(PyTuple_GET_ITEM(args, 0)); ! // @pyparm int|lcid||The locale ID. Please see <om PyIDispatch.Invoke>. ! LCID lcid = PyInt_AsLong(PyTuple_GET_ITEM(args, 1)); ! // @pyparm int|wFlags||Flags for the call. Please see <om PyIDispatch.Invoke>. ! UINT wFlags = PyInt_AsLong(PyTuple_GET_ITEM(args, 2)); ! // @pyparm tuple|resultTypeDesc||A tuple describing the type of the ! // result. See the comments for more information. ! PyObject *resultElemDesc = PyTuple_GET_ITEM(args, 3); ! // @pyparm (tuple, ...)|typeDescs||A sequence of tuples describing ! // the types of the parameters for the function. See the comments ! // for more information. ! PyObject *argsElemDescArray = PyTuple_GET_ITEM(args, 4); // @pyparm object, ...|args||The args to the function. if ( PyErr_Occurred() ) *************** *** 456,459 **** --- 464,487 ---- delete [] ArgHelpers; return result; + // @comm The Microsoft documentation for IDispatch should be used for all + // params except 'resultTypeDesc' and 'typeDescs'. 'resultTypeDesc' describes + // the return value of the function, and is a tuple of (type_id, flags). + // 'typeDescs' describes the type of each parameters, and is a list of the + // same (type_id, flags) tuple. + // @flagh item|Description + // @flag type_id|A valid "variant type" constant (eg, VT_I4 \| VT_ARRAY, VT_DATE, etc - see VARIANT at MSDN). + // @flag flags|One of the PARAMFLAG constants (eg, PARAMFLAG_FIN, PARAMFLAG_FOUT etc - see PARAMFLAG at MSDN). + // @ex An example from the makepy generated file for Word| + // + // class Cells(DispatchBaseClass): + // ... + // def SetWidth(self, ColumnWidth=..., RulerStyle=...): + // return self._oleobj_.InvokeTypes(202, LCID, 1, (24, 0), ((4, 1), (3, 1)),...) + + // @ex The interesting bits are| + // resultTypeDesc: (24, 0) - (VT_VOID, <no flags>) + // typeDescs: ((4, 1), (3, 1)) - ((VT_R4, PARAMFLAG_FIN), (VT_I4, PARAMFLAG_FIN)) + // @ex So, in this example, the function returns no value and takes 2 "in" + // params - ColumnWidth is a float, and RulerStule is an int.| } |
From: Mark H. <mha...@us...> - 2006-01-10 00:30:11
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29667/win32/Demos Modified Files: win32gui_taskbar.py Log Message: Update demo to handle that the taskbar may not be created (either due to windows still starting up, or explorer dieing) Index: win32gui_taskbar.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_taskbar.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32gui_taskbar.py 6 Oct 2003 11:03:15 -0000 1.7 --- win32gui_taskbar.py 10 Jan 2006 00:30:00 -0000 1.8 *************** *** 47,51 **** flags = NIF_ICON | NIF_MESSAGE | NIF_TIP nid = (self.hwnd, 0, flags, win32con.WM_USER+20, hicon, "Python Demo") ! Shell_NotifyIcon(NIM_ADD, nid) def OnRestart(self, hwnd, msg, wparam, lparam): --- 47,58 ---- flags = NIF_ICON | NIF_MESSAGE | NIF_TIP nid = (self.hwnd, 0, flags, win32con.WM_USER+20, hicon, "Python Demo") ! try: ! Shell_NotifyIcon(NIM_ADD, nid) ! except error: ! # This is common when windows is starting, and this code is hit ! # before the taskbar has been created. ! print "Failed to add the taskbar icon - is explorer running?" ! # but keep running anyway - when explorer starts, we get the ! # TaskbarCreated message. def OnRestart(self, hwnd, msg, wparam, lparam): |
From: Mark H. <mha...@us...> - 2006-01-10 00:22:25
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28145/win32/src Modified Files: win32gui.i Log Message: Add CreateIconFromResource and CreateIConIndirect. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** win32gui.i 2 Dec 2005 07:49:49 -0000 1.72 --- win32gui.i 10 Jan 2006 00:22:15 -0000 1.73 *************** *** 2158,2161 **** --- 2158,2186 ---- HICON CreateIconIndirect(ICONINFO *INPUT); + %{ + // @pyswig int|CreateIconFromResource|Creates an icon or cursor from resource bits describing the icon. + static PyObject *PyCreateIconFromResource(PyObject *self, PyObject *args) + { + // @pyparm string|bits||The bits + // @pyparm bool|fIcon||True if an icon, False if a cursor. + // @pyparm int|ver|0x00030000|Specifies the version number of the icon or cursor + // format for the resource bits pointed to by the presbits parameter. + // This parameter can be 0x00030000. + char *bits; + int nBits; + int isIcon; + int ver = 0x00030000; + if (!PyArg_ParseTuple(args, "s#i|i", &bits, &nBits, &isIcon, &ver)) + return NULL; + HICON ret = CreateIconFromResource((PBYTE)bits, nBits, isIcon, ver); + if (!ret) + return PyWin_SetAPIError("CreateIconFromResource"); + return PyLong_FromVoidPtr(ret); + } + %} + %native (CreateIconFromResource) PyCreateIconFromResource; + + HICON CreateIconIndirect(); + // @pyswig HANDLE|LoadImage|Loads a bitmap, cursor or icon HANDLE LoadImage(HINSTANCE hInst, // @pyparm int|hinst||Handle to an instance of the module that contains the image to be loaded. To load an OEM image, set this parameter to zero. |
From: Mark H. <mha...@us...> - 2006-01-10 00:21:36
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27760/win32/src Modified Files: win32pipe.i Log Message: Avoid setting a Python error without returning NULL. There may be an issue with a py2exe generated script using win32pipe when py2exe bundling is enabled on Win9x, but this wasn't the way to handle it! Index: win32pipe.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pipe.i,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32pipe.i 18 May 2005 02:38:49 -0000 1.12 --- win32pipe.i 10 Jan 2006 00:21:28 -0000 1.13 *************** *** 92,98 **** // Setup g_fUsingWin9x and module path correctly... { ! if (!LoadModulePath()) { ! PyErr_SetString(PyExc_RuntimeError, "Could not determine the module base path!?"); ! } OSVERSIONINFO osvi; --- 92,96 ---- // Setup g_fUsingWin9x and module path correctly... { ! LoadModulePath(); OSVERSIONINFO osvi; |