Share via


Enabling Shell Callback Functions (Windows Embedded CE 6.0)

1/6/2010

Windows Embedded CE enables custom shells to register callback functions, which forward the appropriate functions to your custom shell. These callback functions can intercept a limited number of shell function calls, such as tray icon notifications. You can register a shell callback function with the ShellRegisterCallbacks function. Before implementing this function, you must first include the Shellcb.h header file and link with the Shellcb.lib library file. Then you must allocate a SHELLCALLBACKS structure, which consists of a DWORD that specifies the size of the structure and pointers to the appropriate callback functions.

Once you have registered the shell callback functions for your custom shell, Windows Embedded CE forwards the Shell_NotifyIcon and SHAddToRecentDocs functions to your custom shell through these callbacks. Also, the IsAPIReady function always returns TRUE when any application calls with the SH_SHELL flag.

Because Windows Embedded CE performs no thread switching during these callbacks, the thread belongs to the client process. Therefore, the callback functions should perform only a minimal amount of processing. Typically, a callback function saves a copy of the parameter data and defers any required processing to a separate thread belonging to the shell. The callback function must fully copy the parameter data because any pointers passed to the callback function will be invalid on another thread or at a later callback.

See Also

Other Resources

Shell OS Design Development