Win32Lib please fix msg handler

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

in win32lib:

START CODE QUOTE:
  -- user can process events that Win32Lib doesn't have handlers for.
  if onEvent[ id ] > 0 then
    -- call routine
    call_proc( onEvent[ id ], {iMsg, wParam, lParam} ) --why not a function?

  -- NEW! 0.41 allow user to override
  if myReturn[length(myReturn)] != 0 then
      return popSelf()
  end if
:END CODE QUOTE

The problem is, an event handler often has to return a value of 0 to tell
  Windows it is processing the event.  Since 'popSelf()' only happens
  with non-zero values, its impossible to override without
  modifying the win32lib file.

  How about fixing that in your various versions?
  The simplest is:

  if onEvent[id]>0 then
    retv={0,0}
    retv=call_func(onEvent[id],{iMsg,wParam,lParam})
    if retv[1]>0 then
      return retv[2]
    end if

  If you want to stick with the current method, make each ret stack
  member a two dimensional value:
    {0,0}
  the first value indicating whether or not to return the second value.

  This is a fairly important functionality!

  Thanks,
    Al

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

Search



Quick Links

User menu

Not signed in.

Misc Menu