[Contents] [Index] [Help] [Retrace] [browse <] [Browse >]


NAME
    CallHook -- Invoke a hook given a message on the stack.  (V36)

SYNOPSIS
    result = CallHook( hookPtr, obj, ... )

    ULONG CallHook( struct hook *, object *, ... );

FUNCTION
    Like callhooka(), callhook() invoke a hook on the supplied
    hook-specific data (an "object") and a parameter packet ("message").
    However, CallHook() allows you to build the message on your stack.

INPUTS
    hookPtr - A system-standard hook
    obj - hook-specific data object
    ... - The hook-specific message you wish to send.  The hook is
        expecting a pointer to the message, so a pointer into your
        stack will be sent.

RESULT
    result - a hook-specific result.

NOTES
    While this function requires V36 or higher intuition.library,
    it first appeared in V37 amiga.lib.

EXAMPLE
    If your hook's message was

        struct myMessage
        {
            ULONG mm_FirstGuy;
            ULONG mm_SecondGuy;
            ULONG mm_ThirdGuy;
        };

    You could write:

        result = CallHook( hook, obj, firstguy, secondguy, thirdguy );

    as a shorthand for:

        struct myMessage msg;

        msg.mm_FirstGuy = firstguy;
        msg.mm_SecondGuy = secondguy;
        msg.mm_ThirdGuy = thirdguy;

        result = CallHookA( hook, obj, &msg );

SEE ALSO
    callhooka(), utility.library/callhookpkt(), <utility/hooks.h>