Run find files and folders from VB

Can I run the find files and folders (like from the start button) from VB? Without using sendkeys please.
If it is an exe. file I can't seem to find it.
Who is Participating?
bear454Connect With a Mentor Commented:
Here's the classID for ShellFind :
The in process server is shell32.dll

Saved Searches (.fnd files) use DDE to call Explorer.exe
The DDE message is: [OpenFindFile("%1", %I)]
The Application is: Folders
The Topic is: AppProperties
Would you believe me if I tell you that it is impossible to do it without sendkeys?
jbilAuthor Commented:
I believe all things are possible, except maybe "run the find files and folders (like from the start button) from VB" <G>

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

And the problem with "sendkeys" is what?


Would you prefer a version that does a SHELL to DOS and runs a DIR command?


I have a Find files control I'm working on.  It works just like the windows find files, but gives you the control of all its functions, and allows you to call it within your program.

If you are interested email me.

jbilAuthor Commented:
Thanks bear454

I also figured out how to use Explorer and a few API calls to do it.

This is the code so far.........

Private Sub cmdFind_Click()
Dim lMyHandle As Long
lMyHandle = FindWindow(vbNullString, "Exploring -  (C:)")
SetActiveWindow lMyHandle
sendstrings lMyHandle
End Sub

Sub sendstrings(ByVal lrecwin As Long)
SetForegroundWindow lrecwin
SetFocusAPI lrecwin
'Sleep 5
Call PostMessage(lrecwin, WM_KEYDOWN, VK_F3, 0&)
End Sub

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.