[pywin32-checkins] pywin32/Pythonwin win32win.cpp,1.20,1.21
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-02-26 09:36:24
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28936 Modified Files: win32win.cpp Log Message: Fix 1815499: SetWindowPos can't work with activex control (SetWindowPos was calling ::SetWindowPos instead of CWnd::SetWindowPos) Index: win32win.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32win.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** win32win.cpp 24 Feb 2008 15:47:20 -0000 1.20 --- win32win.cpp 26 Feb 2008 09:36:22 -0000 1.21 *************** *** 2159,2169 **** &obAfter, &x, &y, &cx, &cy, &flags )) return NULL; HWND insertAfter; if (!PyWinObject_AsHANDLE(obAfter, (HANDLE *)&insertAfter)) return NULL; GUI_BGN_SAVE; // @pyseemfc CWnd|SetWindowPos ! BOOL ok = ::SetWindowPos( pWnd->GetSafeHwnd(), insertAfter, x, y, cx, cy, flags); GUI_END_SAVE; if (!ok) RETURN_ERR("SetWindowPos failed"); --- 2159,2176 ---- &obAfter, &x, &y, &cx, &cy, &flags )) return NULL; + // It appears we took the easy way above, and assume a handle rather + // than either int or PyWnd object. So we jump hoops to convert back + // to a CWnd, so we can call CWnd::SetWindowPos rather than + // ::SetWindowPos HWND insertAfter; if (!PyWinObject_AsHANDLE(obAfter, (HANDLE *)&insertAfter)) return NULL; + CWnd wndInsertAfter; + wndInsertAfter.Attach(insertAfter); GUI_BGN_SAVE; // @pyseemfc CWnd|SetWindowPos ! BOOL ok = pWnd->SetWindowPos( &wndInsertAfter, x, y, cx, cy, flags); GUI_END_SAVE; + wndInsertAfter.Detach(); if (!ok) RETURN_ERR("SetWindowPos failed"); |