< Previous PageNext Page > Hide TOC

Displaying the Spotlight Search Window

Applications can provide users direct interaction with Spotlight by displaying the standard Spotlight search interface, shown in Figure 1.


Figure 1  Spotlight search window

Spotlight search window

The Carbon HISearchWindowShow function provides a simple interface to the Spotlight search window. The following code fragment demonstrates extracting a string value from an NSSearchField and displaying the search interface.

OSStatus resultCode=noErr;
 
resultCode=HISearchWindowShow((CFStringRef)[sender stringValue],kNilOptions);
 
if (resultCode != noErr) {
    // failed to open the panel
    // present an error to the user
    }

The search window is presented using the default display settings that the user has configured in System Preferences.



< Previous PageNext Page > Hide TOC


© 2004, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-03-08)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.