Dave,
In the online help for Clarion, lookup prop:LibHook and you'll see these hooks
{PROP:Libhook, 1} PROP:ColorDialogHook
{PROP:Libhook, 2} PROP:FileDialogHook
{PROP:Libhook, 3} PROP:FontDialogHook
{PROP:Libhook, 4} PROP:PrinterDialogHook
{PROP:Libhook, 5} PROP:HaltHook
{PROP:Libhook, 6} PROP:MessageHook
{PROP:Libhook, 7} PROP:StopHook
{PROP:Libhook, 8} PROP:AssertHook
{PROP:Libhook, 9} PROP:FatalErrorHook
{PROP:Libhook, 12} PROP:SystemPropHook
{PROP:Libhook, 13} PROP:AssertHook2
{PROP:Libhook, 14} PROP:InitAStringHook
{PROP:Libhook, 15) PROP:UnlockThreadHook
{PROP:Libhook, 16) PROP:LockThreadHook
{PROP:Libhook, 17) PROP:ThreadLockedHook
Now you can use that list to lookup the indivial props for more info. For instance: Prop:MessageHook says
A property of the SYSTEM built-in variable that sets the override procedure for the MESSAGE internal Clarion procedure. Equivalent to {PROP:LibHook,6}. Assign the ADDRESS of the overriding procedure, and the runtime library will call the overriding procedure instead of the MESSAGE procedure. Assign zero and the runtime library will once again call its internal procedure. The overriding procedure's prototype must be exactly the same as the MESSAGE procedure found in the BUILTINS.CLW file. (WRITE-ONLY)
You can then open builtins.clw to find the prototype for the Message() procedure and create a procedure in your app to match like this:
MessageHook PROCEDURE(STRING sMsg,<STRING sCaption>, <STRING sIcon> ,<STRING sButton>, UNSIGNED btnDefault=0, UNSIGNED mStyle=0 ),UNSIGNED,PROC
You must ensure that you don't call Message() or any other method or procedure that may call Message() from within this hook procedure. If you do it will be called recursively and GPF when it blows the stack. I log these messages to rotated text log files and send messages to notify an admin of the problem.
To enable the hook, in your program early on you set the system hook property to the address of your hook procedure to prevent the standard Message dialog from displaying:
System{Prop:MessageHook} = Address(MessageHook)
Cheers,
Larry Sand