I have an application without an associated database. However, I still want
the application to respond to a global find action sysAppLaunchCmdFind and
sysAppLaunchCmdFindGoto.
I was able to do this with the following code:
void PseudoFind(FindParamsPtr params)
{
const int dummyCardNo=0;
RectangleType rect;
char String[longDateStrLength];
SystemPreferencesType prefs;
if (/* params->strAsTyped is according to certain conditions */)
{
if (params->more ? FindDrawHeader(params, "AppName(cont)") :
FindDrawHeader(params, "AppName"))
return;
if (FindSaveMatch (params, year, 0, 0, 0, dummyCardNo,
DmNumDatabases(dummyCardNo)))
return;
/* initialize String */
FindGetLineBounds(params, &rect);
WinDrawChars(String, StrLen(String), rect.topLeft.x, rect.topLeft.y);
}
}
This goes fine, except that the line that I output in the Find dialog is
overwritten by the FindDrawHeader call of the next application queried. I
guess that the problem is that the OS doesn't see that I have 'found' an
item.
I guessed that telling the OS that there is a match must happen with
FindSaveMatch, but is this really so ?
If yes, is there a way to trick this function into accepting some set of
parameters even without an actual database existing ?
Thank for your response
By the way, IMHO, the reference documentation, or at least the companion
could be improved a lot if each each chapter would have a general
explanation what the relation between the different calls is by using a
simple 'typical' example. Now a lot of guessing is needed to find out why a
certain function exists, or what other function ought to be called before or
after the one you're currently studying.