dcsimg
Results 1 to 7 of 7

Thread: Explore and Search

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,110

    Explore and Search

    Code:
    Private Sub Command1_Click()
    ExploreIt ("H:\Shared")
    End Sub
    
    Sub ExploreIt(p)
    Call Shell("Explorer.exe /select," & p, vbNormalFocus)
    End
    End Sub
    
    Private Sub Command2_Click()
    ExploreIt ("N:\Data4")
    End Sub
    I'm using the above code to explore to certain folders.

    It is possible to add something so the Folder Opens showing the Windows Search Dialog ?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,234

    Re: Explore and Search

    Search dialog? What ancient Windows version are you using?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,110

    Re: Explore and Search

    Windows XP and you don't have to be insulting !

  4. #4
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,098

    Re: Explore and Search

    It's cool. I've only recently moved everything I own to win10, and gave up my XP sandbox. XP was just too limiting for development purposes.
    You should be able to find an old Windows 7/8 license to use to upgrade to Win10. MS is still allowing you to register Win10 with these old licenses with clean installs.

    There's pretty much no excuse not to be on win10. Some companies move slow though... even with events like WannaCry.
    Last edited by DEXWERX; Nov 9th, 2018 at 08:15 AM.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,110

    Re: Explore and Search

    I have a win 10 machine as well as XP. Much prefer XP though. Lots of reasons, not the least being all the apps that in use.

  6. #6
    Lively Member
    Join Date
    Jun 2018
    Posts
    90

    Re: Explore and Search

    Hi,

    The following code will open search results interface in XP with the focus on the specific path. Perhaps, it may help you in whatever manner.

    Code:
    Option Explicit
    
    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
    
    Private Sub Command1_Click()
    SearchIt("H:\Shared\")
    End Sub
    
    Private Sub Command2_Click()
    SearchIt("N:\Data4\")
    End Sub
    
    Sub SearchIt(path as string)
        ShellSearch 0, "Find", path, "", "", SW_SHOWNORMAL
    End Sub
    You can also check other command line switches of Explorer in XP.
    https://ss64.com/nt/explorer.html

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,110

    Re: Explore and Search

    Great stuff PGB, I spent many hours trying to sort this. Your routine does it perfectly, many thanks.
    I've a big job on and this will speed it up enormously.

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width