www.pudn.com > DualDisplay.rar > aygshell.h
// // Copyright (c) Microsoft Corporation. All rights reserved. // // // Use of this source code is subject to the terms of the Microsoft end-user // license agreement (EULA) under which you licensed this SOFTWARE PRODUCT. // If you did not accept the terms of the EULA, you are not authorized to use // this source code. For a copy of the EULA, please see the LICENSE.RTF on your // install media. // #ifndef _AYGSHELL_H_ #define _AYGSHELL_H_ // aygshell.h - exported functions from aygshell' #include#include // USED BY SHDONEBUTTON // // Disable the navigation button bestowed by the Shell // (NOTE: this only works if WS_CAPTION is not set) #define WS_NONAVDONEBUTTON WS_MINIMIZEBOX //++++++ // // SHEnumPropSheetHandlers // // this is the maximum number of extension pages that can be added // to a property sheet #define MAX_EXTENSION_PAGES 6 // For property sheet extension - enumerates the subkeys under the // class key hkey. For each handler, the class is instantiated, // queried for IShellPropSheetExt and AddPages is called. The // handle to the page is inserted in the array prghPropPages, and // the pointer to the IShellPropSheetExt is added to prgpispse // with one reference from the caller (these should be released // by the caller after PropertySheet() is called). These two arrays // should be allocated before calling SHEnumPropSheetHandlers. // // Typical usage of this function would be: // // - allocate an array of HPROPSHEETPAGEs for the standard pages plus // MAX_EXTENSION_PAGES extension pages // - fill a PROPSHEETPAGE struct and call CreatePropertySheetPage() on each // standard page // - store the HPROPSHEETPAGE for the standard pages at the beginning of // the array // - open a registry key where the app has defined ISV extension // - allocate an array of MAX_EXTENSION_PAGES IShellPropSheetExt interface // pointers // - call SHEnumPropSheetHandlers(), passing in the hkey, a pointer to the // first free HPROPSHEETPAGE array element, and a pointer to the array of // IShellPropSheetExt interface pointers // - call PropertySheet() to display the property sheet // - Release each interface pointer in the array of interface pointers // - free both arrays // SHEnumPropSheetHandlers assumes that prghPropPages and prgpispse have been // allocated with enough space for up to MAX_EXTENSION_PAGES elements. The // number of pages added is returned in *pcPages. BOOL SHEnumPropSheetHandlers(HKEY hkey, int *pcPages, HPROPSHEETPAGE *prghPropPages, IShellPropSheetExt **prgpispse); // // End SHEnumPropSheetHandlers // //------ // used by SHCreateNewItem #undef INTERFACE #define INTERFACE INewMenuItemServer DECLARE_INTERFACE_(INewMenuItemServer, IUnknown) { // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; STDMETHOD(CreateNewItem) (THIS_ HWND hwndParent) PURE; }; ////////////////////////////////////////////////////////////////////////////// // // Input Context API // // These are definitions and APIs for the interacting with the input context // properties of individual windows // // { // Word correct Options enum SHIC_FEATURE { SHIC_FEATURE_RESTOREDEFAULT = 0, SHIC_FEATURE_AUTOCORRECT = 0x00000001L, SHIC_FEATURE_AUTOSUGGEST = 0x00000002L, SHIC_FEATURE_HAVETRAILER = 0x00000003L, SHIC_FEATURE_CLASS = 0x00000004L }; typedef enum SHIC_FEATURE SHIC_FEATURE; // Predefined input context classes #define SHIC_CLASS_DEFAULT TEXT("") #define SHIC_CLASS_EMAIL TEXT("email") #define SHIC_CLASS_URL TEXT("url") #define SHIC_CLASS_PHONE TEXT("phone") #define SHIC_CLASS_NAME TEXT("name") #define SHIC_CLASS_MAXLEN (MAX_PATH - 11) //@topic Input Context Features | // The input context API supports the following features and their corresponding values: // //@flag SHIC_FEATURE_RESTOREDEFAULT | Restore original input context state. (no corresponding value) //@flag SHIC_FEATURE_AUTOCORRECT | Turn auto-corrections on and off. (TRUE, FALSE) //@flag SHIC_FEATURE_AUTOCOMPLETE | Turn dictionary suggestions on and off. (TRUE, FALSE) //@flag SHIC_FEATURE_HAVETRAILER | Specify whether to append trailer characters after replacing words. // (TRUE, FALSE) //@flag SHIC_FEATURE_CLASS | Make this control behave like a specific semantic type. // (SHIC_CLASS_DEFAULT, SHIC_CLASS_EMAIL, SHIC_CLASS_URL, // SHIC_CLASS_PHONE, SHIC_CLASS_NAME) // //@comm All SHIC_FEATUREs are inherited from parent if undefined. That is, if they are not defined in // a window or the window's SHIC class, the API looks at the parent chain to find the setting // that applies to the window. // //@xref // //++++++ // //@func HRESULT | SHSetInputContext | Changes the state of an input context feature // //@parm HWND | hwnd | IN - Window whose context will be set //@parm DWORD | dwFeature | IN - Input context feature to change //@parm const LPVOID | lpValue | IN - New value assigned to feature // //@rdesc Returns one of the following values: //@flag S_OK | If everything went well //@flag ERROR_INVALID_PARAMETER | if hwnd was NULL or lpValue was NULL for a feature // that does not support it, such as SHIC_FEATURE_AUTOCORRECT, // SHIC_FEATURE_AUTOCOMPLETE and SHIC_FEATURE_HAVETRAILER. //@flag ERROR_NOT_SUPPORTED | If the feature specified was invalid //@flag ERROR_INVALID_DATA | If the specified value is not a legal option // //@xref // HRESULT SHSetInputContext( HWND hwnd, DWORD dwFeature, const LPVOID lpValue ); // // End SHSetInputContext // //------ //++++++ // //@func HRESULT | SHGetInputContext | Retrieves current state of an input context feature // //@parm HWND | hwnd | IN - Window whose context will be retrieved //@parm DWORD | dwFeature | IN - Input context feature to retrieve //@parm LPVOID | lpValue | OUT - Buffer to hold current value of feature //@parm LPDWORD | pdwSize | IN/OUT - size of the buffer passed in to retrieve the value // //@rdesc Returns one of the following values: //@flag S_OK | If everything went well //@flag ERROR_INVALID_PARAMETER | If hwnd or lpdwSize passed were NULL //@flag ERROR_NOT_SUPPORTED | If the feature specified was invalid //@flag ERROR_INSUFFICIENT_BUFFER | If buffer passed is too small // //@comm Retrieves the current state/value of the specified // input context feature. If the value is not explicitly set, it // looks at the features set by the context class. If no class was // set explicitly, or the class didn't set that value, it returns // the default value for that feature, which would be the // currently active one. // If lpValue is NULL and lpdwSize is not NULL, it returns the // size of the buffer needed in lpdwSize. // //@xref // HRESULT SHGetInputContext( HWND hwnd, DWORD dwFeature, LPVOID lpValue, LPDWORD lpdwSize ); // // End SHGetInputContext // //------ // } // // end Input Context API // ////////////////////////////////////////////////////////////////////////////// #endif // _AYGSHELL_H_