Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Search

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB

Hi all

Is there any way I can programatically pop up the windows search screen with the directories to be searched auto-populated?

What I am trying to achieve is to list files in a number of different directories in one window/form (with icons for the associated applications). Listview does not have the associated icons.

Thanks
ITflash

 


mmm....found a way but not ideal.

Code:
DECLARE INTEGER ShellExecute IN shell32.dll ; 
 INTEGER hndWin, ;
 STRING cAction, ;
 STRING cFileName, ;
 STRING cParams, ;
 STRING cDir, ;
 INTEGER nShowWin

wndhnd = ShellExecute(0, "find", "d:\z", NULL, NULL, 0)

declare SetForegroundWindow in Win32api integer
SetForegroundWindow (wndhnd)

oWsh = CREATEOBJECT("wscript.Shell")
oWsh.SendKeys("*.jpg")
oWsh.SendKeys("{tab}{tab}")
oWsh.sendkeys("c:\;D:\z")
oWsh.SendKeys("{tab}")


would be nice if I could just do....

Code:
searchpath="C:\;D:\z;C:\testdir"
wndhnd = ShellExecute(0, "find", searchpath, NULL, NULL, 0)
Then I could just search specific directories without having to use sendkeys.
However, this syntax does not work.

Does anyone know an alternative to my workaround.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top