AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Windows Suche starten

Ein Thema von Björn Ole · begonnen am 19. Jan 2011 · letzter Beitrag vom 21. Jan 2011
Antwort Antwort
Benutzerbild von Björn Ole
Björn Ole

Registriert seit: 10. Jul 2008
166 Beiträge
 
Delphi XE Professional
 
#1

Windows Suche starten

  Alt 19. Jan 2011, 18:49
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 ShellExecute(0, 'open', PChar(Pfad), nil, nil, SW_SHOWNORMAL); öffne ich ein Explorer Fenster.
Wie starte ich jetzt die Suche? Oder brauchts einen ganz anderen Ansatz?

Betriebssystem: Windows 7, ab XP wäre optimal.


Gruß,
Björn
  Mit Zitat antworten Zitat
NikB

Registriert seit: 19. Jan 2011
1 Beiträge
 
#2

AW: Windows Suche starten

  Alt 19. Jan 2011, 19:12
1. Make one reg file (example):
Code:
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\"
2. Exec reg file (double click)
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.
  Mit Zitat antworten Zitat
Benutzerbild von Björn Ole
Björn Ole

Registriert seit: 10. Jul 2008
166 Beiträge
 
Delphi XE Professional
 
#3

AW: Windows Suche starten

  Alt 19. Jan 2011, 19:23
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.
  Mit Zitat antworten Zitat
Benutzerbild von Aphton
Aphton

Registriert seit: 31. Mai 2009
1.198 Beiträge
 
Turbo Delphi für Win32
 
#4

AW: Windows Suche starten

  Alt 19. Jan 2011, 19:34
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.

    print

        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.
(...)
Source
das Erkennen beginnt, wenn der Erkennende vom zu Erkennenden Abstand nimmt
MfG
  Mit Zitat antworten Zitat
Benutzerbild von Björn Ole
Björn Ole

Registriert seit: 10. Jul 2008
166 Beiträge
 
Delphi XE Professional
 
#5

AW: Windows Suche starten

  Alt 19. Jan 2011, 20:02
Ah, danke, das hatte ich übersehen.
Aber ich hänge immer noch.

Mein Versuch:
ShellExecute(0, 'find', nil, nil, PChar('C:\'), SW_SHOWNORMAL);
  • Ich kann nur im .exe-Verzeichnis suchen.
    Anscheinend gibt es da eine zeitliche Verzögerung?? Ich hatte versucht, auf C:\ zu suchen, er listete mir beim Suchbegriff * aber nur alle Dateien aus dem .exe-Verzeichnis auf. Vorm Abschicken dieser Antwort hatte ich es noch ein letztes mal versucht, dann gings auch auf C:\. Keine Änderungen am Quelltext, nicht neu kompiliert.
  • Es gibt anscheinend keine Möglichkeit, den Such-String zu übergeben. Man muss ihn manuell eintippen.
  • Die Suche muss ebenfalls manuell gestartet werden.
  Mit Zitat antworten Zitat
Benutzerbild von Aphton
Aphton

Registriert seit: 31. Mai 2009
1.198 Beiträge
 
Turbo Delphi für Win32
 
#6

AW: Windows Suche starten

  Alt 19. Jan 2011, 20:17
Ah, danke, das hatte ich übersehen.
Aber ich hänge immer noch.
  • Es gibt anscheinend keine Möglichkeit, den Such-String zu übergeben. Man muss ihn manuell eintippen.
Versuch mal, lpParameters als den Such-string zu verwenden!
das Erkennen beginnt, wenn der Erkennende vom zu Erkennenden Abstand nimmt
MfG
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz