Re: sendMessage() problem

new topic     » goto parent     » topic index » view thread      » older message » newer message

Alexander Toresson wrote:
> 
> I would like to send a message to a control that is not created through
> win32lib, and
> therefore hasn't got any win32lib id (which sendMessage is expecting), but I
> know the
> windows id. Is this possible without altering win32lib.ew?

Yes.  You basically have to wrap the call to Sendmessage.  If you look
at the sendMessage() in win32lib, probably all you'd need to do is
supply a handle rather than a win32lib id.  This should work for you:
global function sendMessageHwnd( atom hwnd, atom pCmd, object wParm, object
lParm )
    -- send a command to a control
    atom memset
    atom lRetVal

        memset = 0
        -- Check for text being passed.
        if sequence(wParm) then
            memset = w32new_memset()
            wParm = w32acquire_mem(memset, wParm)
        end if
        if sequence(lParm) then
            if memset = 0 then
                memset = w32new_memset()
            end if
            lParm = w32acquire_mem(memset, lParm)
        end if

        lRetVal = c_func( qSendMessage, { hwnd, pCmd, wParm, lParm } )
        if memset != 0 then
            w32release_mem(memset)
        end if
        return lRetVal
end function


Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu