如何在VB.NET程序中实现启动Windows搜索功能?

2026-05-06 11:421阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计263个文字,预计阅读时间需要2分钟。

如何在VB.NET程序中实现启动Windows搜索功能?

如何使用Visual Basic为应用程序中特定文件夹打开Windows Search Companion或Windows Basic Search?

我找到了这篇文章,但这不是我想找的。类似这样?

VBA / VB6代码 Option Explicit ~ API声明

如何使用Visual Basic为应用程序中的特定文件夹打开“ Windows Search Companion”或“Windows Basic Search”?

我找到了this article,但这不是我想要的.

像这样?

VBA / VB6代码

Option Explicit '~~> API declaration for the windows "Search Results" dialog Private Declare Function ShellSearch& Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) Private Const SW_SHOWNORMAL = 1 Const drv As String = "C:\" Sub Sample() ShellSearch 0, "Find", drv, "", "", SW_SHOWNORMAL End Sub

在VBA中测试过

在Win XP中

在Win 7中

VB.NET(在Visual Studio Ultimate 64位上测试)

如何在VB.NET程序中实现启动Windows搜索功能?

'~~> API declaration for the windows "Search Results" dialog Private Declare Function ShellSearch Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Integer, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Integer) As Integer Private Const SW_SHOWNORMAL = 1 Const drv As String = "C:\" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ShellSearch(0, "Find", drv, "", "", SW_SHOWNORMAL) End Sub

本文共计263个文字,预计阅读时间需要2分钟。

如何在VB.NET程序中实现启动Windows搜索功能?

如何使用Visual Basic为应用程序中特定文件夹打开Windows Search Companion或Windows Basic Search?

我找到了这篇文章,但这不是我想找的。类似这样?

VBA / VB6代码 Option Explicit ~ API声明

如何使用Visual Basic为应用程序中的特定文件夹打开“ Windows Search Companion”或“Windows Basic Search”?

我找到了this article,但这不是我想要的.

像这样?

VBA / VB6代码

Option Explicit '~~> API declaration for the windows "Search Results" dialog Private Declare Function ShellSearch& Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Long) Private Const SW_SHOWNORMAL = 1 Const drv As String = "C:\" Sub Sample() ShellSearch 0, "Find", drv, "", "", SW_SHOWNORMAL End Sub

在VBA中测试过

在Win XP中

在Win 7中

VB.NET(在Visual Studio Ultimate 64位上测试)

如何在VB.NET程序中实现启动Windows搜索功能?

'~~> API declaration for the windows "Search Results" dialog Private Declare Function ShellSearch Lib "shell32.dll" _ Alias "ShellExecuteA" (ByVal hwnd As Integer, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _ ByVal nShowCmd As Integer) As Integer Private Const SW_SHOWNORMAL = 1 Const drv As String = "C:\" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ShellSearch(0, "Find", drv, "", "", SW_SHOWNORMAL) End Sub