Solved

Run find files and folders from VB

Posted on 1998-12-23
7
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

705 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