![]() |
Windows Suche starten
Huhu,
vielleicht suche ich gerade nur nach den falschen Begriffen, denn ich finde absolut nichts. Ich würde gerne aus meiner Delphi-Anwendung heraus eine Windows Suche starten. D.h. ich habe einen Button und beim Klicken soll sich ein Explorer Fenster öffnen und nach bestimmten Dateien gesucht werden. Mit
Delphi-Quellcode:
öffne ich ein Explorer Fenster.
ShellExecute(0, 'open', PChar(Pfad), nil, nil, SW_SHOWNORMAL);
Wie starte ich jetzt die Suche? Oder brauchts einen ganz anderen Ansatz? Betriebssystem: Windows 7, ab XP wäre optimal. Gruß, Björn |
AW: Windows Suche starten
1. Make one reg file (example):
Code:
2. Exec reg file (double click)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\MyFind] @="YourFind" [HKEY_CLASSES_ROOT\Folder\shell\MyFind\command] @="C:\\Programs\\YourFind.exe %1\" 3. Make your program in C:\Programs\YourFind.exe (or other :)) 4. Assign command line parameters in your program (%1 is file, click in WinExplorer). Command line parameter in Delphi: ParamCount, ParamStr. |
AW: Windows Suche starten
Sorry, but I'm afraid you didn't understand my problem. ;)
But first, welcome and thanks for trying to help me! Here's what I'm trying to achieve: In my application, I have an Edit and a Button. In the Edit, you find something like created:yesterday size:>100mb *.avi When I click the Button, an Explorer window should appear (being at a specific directory) and the text from the Edit should be placed into the search box, so that it automatically starts searching. |
AW: Windows Suche starten
Lies dir die Dokumentation doch mal genauer durch:
Code:
ShellExecute Function
Performs an operation on a specified file. Syntax HINSTANCE ShellExecute( __in_opt HWND hwnd, __in_opt LPCTSTR lpOperation, __in LPCTSTR lpFile, __in_opt LPCTSTR lpParameters, __in_opt LPCTSTR lpDirectory, __in INT nShowCmd ); Parameters (...) lpOperation [in, optional] Type: LPCTSTR A pointer to a null-terminated string, referred to in this case as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. The following verbs are commonly used: edit Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail. explore Explores a folder specified by lpFile. find Initiates a search beginning in the directory specified by lpDirectory. open Opens the item specified by the lpFile parameter. The item can be a file or folder. Prints the file specified by lpFile. If lpFile is not a document file, the function fails. NULL In systems prior to Windows 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used. In Windows 2000 and later, the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry. (...) ![]() |
AW: Windows Suche starten
Ah, danke, das hatte ich übersehen.
Aber ich hänge immer noch. Mein Versuch:
Delphi-Quellcode:
ShellExecute(0, 'find', nil, nil, PChar('C:\'), SW_SHOWNORMAL);
|
AW: Windows Suche starten
Zitat:
|
AW: Windows Suche starten
Wenn ich lpParameters '*' angebe, zeigt sich keine Änderung.
Wenn ich lpParameters PChar('*') angebe, kommt folgendes: Zitat:
Ich bin immer noch ratlos. |
AW: Windows Suche starten
Gibt es eine Grund warum Du über Shellexecute gehst?
Weil, ich frage mich, wenn ich in delphi proge, dann kann ich doch solche suche selber schreiben und mir in einer Listbox anzeigen lassen!? Gruss alfold |
AW: Windows Suche starten
Zitat:
Ein durch Dienst gepflegten Index ist mit dabei, Sucheingaben wie "created:yesterday size:>100mb *.avi" muss man auch erst einmal auswerten und dann auch noch effizient suchen. Sicher sind da auch noch tausend Kleinigkeiten, an die man jetzt gar nicht denkt. Bist man das alleine implementiert hat, sind vermutlich schon ein paar neue Delphiversionen erschienen :mrgreen: |
AW: Windows Suche starten
Exakt.
Ich habe ![]()
Code:
Jetzt hab ich Folgendes versucht:
ShellExecute(hwnd, "find", "c:\\MyPrograms", NULL, NULL, 0);
Delphi-Quellcode:
ShellExecute(0, 'find', 'C:\\', nil, nil, 0);
und Eingabe in das Suchfeld: * Es werden alle Dateien auf C:\ aufgelistet. Dann ändere ich den Pfad:
Delphi-Quellcode:
ShellExecute(0, 'find', 'D:\\', nil, nil, 0);
Ins Suchfeld wieder: * Es werden immer noch alle Dateien auf C:\ aufgelistet?? :? Wo liegt der Fehler? Hab ich was vergessen? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:55 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz