Solved

Run find files and folders from VB

Posted on 1998-12-23
7
283 Views
Last Modified: 2012-06-22
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
Comment
Question by:jbil
7 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1452164
Would you believe me if I tell you that it is impossible to do it without sendkeys?
0
 
LVL 3

Author Comment

by:jbil
ID: 1452165
I believe all things are possible, except maybe "run the find files and folders (like from the start button) from VB" <G>

0
 
LVL 12

Expert Comment

by:mark2150
ID: 1452166
And the problem with "sendkeys" is what?

M

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 
LVL 12

Expert Comment

by:mark2150
ID: 1452167
Would you prefer a version that does a SHELL to DOS and runs a DIR command?

M

0
 
LVL 1

Accepted Solution

by:
bear454 earned 20 total points
ID: 1452168
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
 
LVL 1

Expert Comment

by:blwatkins
ID: 1452169
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
 
LVL 3

Author Comment

by:jbil
ID: 1452170
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question