I am trying to use IExec->SetFunction() but can't seem to get it to work.
I want to catch when someone opens a Workbench window (double click on DH0: icon or a drawer) to open my own window. The offset is from the pragmas. The examples I found use both positive and negative values. Tried both.
Is "OpenWorkbenchObjectA" the correct function to be patching?
I tried to also patch DisplayBeep() from IntuitionBase to make sure it was the right function to patch. Can't get that to work either.
Any ideas? OS4 examples?
VOID SetUpSetFunction() { IExec->Forbid(); OldOpenWorkbenchObject=(ULONG)IExec->SetFunction(WorkbenchBase,(long)-0x60,(unsigned long (*)())WEOpenWorkbenchObject); IExec->Permit(); } BOOL WEOpenWorkbenchObject(STRPTR Name,Tag tag1,...) { IDOS->Printf("WEOpenWorkbenchObject() %s\n",Name); return(TRUE); } VOID ShutDownSetFunction() { if (!OldOpenWorkbenchObject) return; IExec->Forbid(); IExec->SetFunction(WorkbenchBase,(long)-0x60,(unsigned long (*)())OldOpenWorkbenchObject); IExec->Permit(); }