Win32lib, bitmapped captions, David C.
Hello Euphoria Programmers, hello David Cuny,
i have included the following into your win32lib (v0.30) to enable the
user to return the exit value of a message to windows when using the
onEvent handler. i use this to return HTCAPTION after intercepting
WM_NCHITTEST and testing the mouse position. this is used to have a
bitmapped window caption. i am sure other people would be happy if you
included these changes into win32lib.
here is the code (changes ending with --HM):
--------------- snip snap -------------------------------------------
[...]
-- HM990830 now user can return the exit value of an event in an --HM
-- onEvent handler using returnValue( value ) --HM
atom message_return, exitValue --HM
global procedure returnValue( integer value ) --HM
message_return = 1 --HM
exitValue = value --HM
end procedure --HM
-- -- --HM
global function WndProc(atom hWnd, atom iMsg, atom wParam, atom lParam)
-- callback routine to handle Window class
-- This routine processes messages sent by Windows
-- NEW! 0.15 renamed "pointer" to "action"; "action" to "event"
integer id, event, action, mouseX, mouseY
sequence parms
object result
-- find the control
-- NEW! 0.20d replaced find( hWnd, window_handle ) with getId( lParam )
id = getId( hWnd )
-- save the id for getSelf()
myId = id
-- not one of mine?
if id = 0 then
-- default processing
return c_func( xDefWindowProc, { hWnd, iMsg, wParam, lParam } )
end if
-- user can process events that Win32Lib doesn't have handlers for.
-- HM990830 now user can return the event's exit value using --HM
-- returnValue() --HM
if onEvent[ id ] > 0 then
message_return = 0 --HM
-- call routine
call_proc( onEvent[ id ], {iMsg, wParam, lParam} )
-- return an exit value --HM
if message_return then --HM
return exitValue --HM
end if --HM
end if
[...]
--------------- snip snap -------------------------------------------
Best regards,
Hendrik Mundt
mailto:hm-1704 at gmx.de
|
Not Categorized, Please Help
|
|