[python-win32] Dereferencing lParam pointer

Ulrich Mierendorff ulrich.mierendorff at gmx.net
Thu Feb 25 18:17:01 CET 2010


Tim Roberts wrote:
>> but I am not sure. Is there a way to get the array/list?
>>     
> You will have to use a package like ctypes to do that.  Something like this:
>
> lst = ctypes.cast(lParam, ctypes.POINTER(ctypes.c_int))
> print lst[0]
> print lst[1]
>
>   
Thanks. This works! I was experimenting with ctypes before, but using 
different methods (the from_address function) and that resulted in 
crashes. But your solution works.

-Ulrich


More information about the python-win32 mailing list