Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< 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


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.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice