1. parameter in win32lib ??
How do I get a Pointer for a sequence(or array) to pass as the LPARAM
to use sendmessage function in win32lib.
Bernie
2. Re: parameter in win32lib ??
Bernie Ryan wrote:
>How do I get a Pointer for a sequence(or array) to pass
> as the LPARAM to use sendmessage function in win32lib.
Something like this should work:
function pokeWordArray( sequence s )
atom address, pokeAt
sequence bytes
-- allot bytes for each element
address = allot( length( s ) * 2 )
-- start poking at address
pokeAt = address
-- poke the values into the address
for i = 1 to length( s ) do
-- convert number to bytes
bytes = int_to_bytes( s[i] )
-- poke word into memory
poke( pokeAt, bytes[1..size] )
-- move ahead
pokeAt += 2
end for
return address
end function
So you could do something like this:
address = createWordArray( {1,2,3,4} )
... your code here
free( result )
-- David Cuny