Pythonwin, DefWindowProc bug?

Mark Hammond mhammond at skippinet.com.au
Sat Feb 2 08:09:27 CET 2002


Keith Farmer wrote:
> I'm trying to intercept the WM_NCHITTEST message, to selectively disallow
> resize for given window edges. The following code results in
> 
>     (216, 661)
>     43319512
>     Traceback (most recent call last):
>     File "D:\Python\wxAppBar\PyAppBar.py", line 52, in _OnWMNCHitTest
>         self._LowHighWordsToLparam(win32api.GetCursorPos())
>     TypeError: an integer is required

Given your code:

>     def _OnWMNCHitTest(self, params):
>         lr = win32gui.DefWindowProc(self._GetAppBarWnd(),
>                                                         WM_NCHITTEST,
>                                                         0,
> 
> self._LowHighWordsToLparam(win32api.GetCursorPos())

It appears that the error is actually in trying to call 
win32gui.DefWindowProc, rather than anything to do with the:

       self._LowHighWordsToLparam(win32api.GetCursorPos())

code.  Are you sure _GetAppBatWnd() returns an integer?

Mark.




More information about the Python-list mailing list