• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

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.
0
jbil
Asked:
jbil
1 Solution
 
MirkwoodCommented:
Would you believe me if I tell you that it is impossible to do it without sendkeys?
0
 
jbilAuthor Commented:
I believe all things are possible, except maybe "run the find files and folders (like from the start button) from VB" <G>

0
 
mark2150Commented:
And the problem with "sendkeys" is what?

M

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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

M

0
 
bear454Commented:
Here's the classID for ShellFind :
{61E218E0-65D3-101B-9F08-061CEAC3D50D}
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
0
 
blwatkinsCommented:
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.

Blwatkins@achievesolutions.com

0
 
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

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now