1. [Win32Lib] Equivalent of Screen for setWinMsgHandler()

Hi!

Does anyone know an equivalent of Screen for setWinMsgHandler()?  I'm trying
to set a low-level handler for my entire application.  If I were using
setHandler(), I'd just use Screen; but Screen doesn't seem to work for
setWinMsgHandler().  Here's what I'm doing for now:

function getIds()
  sequence
    handles,
    ids
  handles = getHandles()
  ids = {}
  for i = 1 to length(handles) do
    if handles[i] > 0 then
      ids &= getId(handles[i])
    end if
  end for
  return ids
end function

function AllCtrls_onKEYDOWN(integer pSource, atom hWnd, atom iMsg, atom
wParam, atom lParam)
  ...
end function
setWinMsgHandler(getIds(), WM_KEYDOWN, routine_id("AllCtrls_onKEYDOWN"))


Is there a more elegant way to do this?

Andrew

new topic     » topic index » view message » categorize

2. Re: [Win32Lib] Equivalent of Screen for setWinMsgHandler()

Andrew Hall wrote:
> 
> Hi!
> 
> Does anyone know an equivalent of Screen for setWinMsgHandler()?  I'm trying
> to set a low-level handler for my entire application.  If I were using
> setHandler(), I'd just use Screen; but Screen doesn't seem to work for
> setWinMsgHandler(). 

That would be a bug then. I'll fix that.

In the meantime, you could just try ...

procedure AllCtrls_onKEYDOWN(integer self, integer event, sequence parms)
  ...
end procedure
setHandler(Screen, w32HKeyDown, routine_id("AllCtrls_onKEYDOWN"))

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu