首先给出两个链接:
http://msdn.microsoft.com/en-us/library/bb266520(VS.85).aspx
http://msdn.microsoft.com/en-us/library/cc144083(VS.85).aspx
在链接1中:
MS给出的Example是:
search-ms:query=microsoft&
search-ms:query=vacation&subquery=mydepartment.search-ms&
search-ms:query=seattle&crumb=kind:pics&
search-ms:query=seattle&crumb=folder:C:\MyFolder&
可是我试了N次,不成功。
周末,我找到了链接2:
MS给出的说法是这样的:
1、The search: protocol does not replace the proprietary search-ms: protocol. Applications can still use the search-ms: protocol to launch Window Search Explorer or to silently query the Windows Search indexer.
2、Windows Vista with SP1 use of the search: protocol
Windows Vista with SP1 has several entry points from which it calls the search: protocol. These entry points are outlined below as well as the common syntax associated with each.
--------------------------------------------------------------------------------------------------------------
Search protocol entry point | Location | Query called
--------------------------------------------------------------------------------------------------------------
Search Everywhere | Start menu | search:query= <Search Term>
Search Everywhere | Windows Explorer | search:query= <Search Term>&crumb=location: <LOCATION>
Windows logo key+F | Anywhere | search:
CTRL+F | Windows Explorer | search:query= <Search Term>&crumb=location: <LOCATION>
F3 | Start menu | search:
F3 | Windows Explorer | search:query= <Search Term>&crumb=location: <LOCATION>
--------------------------------------------------------------------------------------------------------------
The Windows Vista with SP1 search protocol entry points do not take advantage of all the possible parameters in the search protocol. Applications that are only concerned with handling search protocol calls from Windows Vista with SP1 can use the following table as a guide to the minimum they need to implement.
上面的意思是说,在vista SP1下面的命令是search:命令(用WIN+R调出运行框,然后输入search:命令,就可以把查找文件对话框弄出来)
而我原先看的第一个链接中是用search-ms:命令,而这个命令在我公司的机器上有些语法貌似不能用。
现在的命令是:search-ms:query=.sln&crumb=location:C:\
在程序中用ShellExecute(hWnd, NULL, L"search:query=*.sln&crumb=location:C:\\", NULL, NULL, SW_SHOWNORMAL);就可以实现我原先的想法了。