Solved

Run find files and folders from VB

Posted on 1998-12-23
7
279 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

776 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