473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Win32 API for Search!

Hi All, Planning to call the same search API which windows Search uses for
searching , when u launch with Ctrl+F,you have the flexibility to provide a
containing text!

VB/C# any thing would work

My search wants to use Containing text

Thanks
Preferred OS:Win2k3
Apr 10 '07 #1
13 5933
Vai2000,

You are going to have to make calls to the Win32 API through the
P/Invoke layer. Specifically, the API functions you want are
FindFirstFileEx, FindNextFile and FindClose.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Vai2000" <no****@microsoft.comwrote in message
news:OL****************@TK2MSFTNGP03.phx.gbl...
Hi All, Planning to call the same search API which windows Search uses for
searching , when u launch with Ctrl+F,you have the flexibility to provide
a
containing text!

VB/C# any thing would work

My search wants to use Containing text

Thanks
Preferred OS:Win2k3


Apr 10 '07 #2
Vai2000 wrote:
Hi All, Planning to call the same search API which windows Search uses for
searching , when u launch with Ctrl+F,you have the flexibility to provide
a containing text!

VB/C# any thing would work

My search wants to use Containing text

Thanks
Preferred OS:Win2k3
You might also be interested in
http://addins.msn.com/devguide.aspx#...sktopSearchApi.
--
Tom Porterfield

Apr 10 '07 #3
It should be noted that this approach has some caveats, those being:

- The machine that this is run on has to have Windows Desktop Search
installed, located at:

http://www.microsoft.com/windows/des...h/default.mspx

- The directories that the documents reside in have to be indexed by Windows
Desktop Search. If they are not, then a search using these APIs will
produce nothing.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Tom Porterfield" <tp******@mvps.orgwrote in message
news:eW**************@TK2MSFTNGP02.phx.gbl...
Vai2000 wrote:
>Hi All, Planning to call the same search API which windows Search uses
for
searching , when u launch with Ctrl+F,you have the flexibility to provide
a containing text!

VB/C# any thing would work

My search wants to use Containing text

Thanks
Preferred OS:Win2k3

You might also be interested in
http://addins.msn.com/devguide.aspx#...sktopSearchApi.
--
Tom Porterfield

Apr 10 '07 #4
Nicholas Paldino [.NET/C# MVP] wrote:
It should be noted that this approach has some caveats, those being:

- The machine that this is run on has to have Windows Desktop Search
installed, located at:

http://www.microsoft.com/windows/des...h/default.mspx
Seems obvious that if you want to use the windows desktop search API that it
needs to be installed, but thanks for stating such. WDS is included in
Vista and is supposed to be in Longhorn Server as well.
- The directories that the documents reside in have to be indexed by
Windows Desktop Search. If they are not, then a search using these APIs
will produce nothing.
Yes, but the interface is much more robust than FindFirstFileEx, if it meets
your needs. Don't know if the API will be advanced for Vista and LH Server
but in Vista using the built in search interface you can via advanced
options also have it search non-indexed locations.
--
Tom Porterfield

Apr 10 '07 #5
"Tom Porterfield" <tp******@mvps.orgwrote in message
news:eU**************@TK2MSFTNGP03.phx.gbl...
Nicholas Paldino [.NET/C# MVP] wrote:
> It should be noted that this approach has some caveats, those being:

- The machine that this is run on has to have Windows Desktop Search
installed, located at:

http://www.microsoft.com/windows/des...h/default.mspx

Seems obvious that if you want to use the windows desktop search API that it needs to be
installed, but thanks for stating such. WDS is included in Vista and is supposed to be in
Longhorn Server as well.
>- The directories that the documents reside in have to be indexed by
Windows Desktop Search. If they are not, then a search using these APIs
will produce nothing.

Yes, but the interface is much more robust than FindFirstFileEx, if it meets your needs.
Don't know if the API will be advanced for Vista and LH Server but in Vista using the
built in search interface you can via advanced options also have it search non-indexed
locations.
--
Tom Porterfield

The search engine in Vista is not related to the MSN Desktop Search nor is the API.

Willy.

Apr 10 '07 #6
Willy Denoyette [MVP] wrote:
>
The search engine in Vista is not related to the MSN Desktop Search nor
is the API.
Interesting and not what I have been told by other sources.
--
Tom Porterfield
Apr 10 '07 #7
"Tom Porterfield" <tp******@mvps.orgwrote in message
news:et**************@TK2MSFTNGP03.phx.gbl...
Willy Denoyette [MVP] wrote:
>>
The search engine in Vista is not related to the MSN Desktop Search nor
is the API.

Interesting and not what I have been told by other sources.
--
Tom Porterfield

Windows Desktop Search, which is installed with MSN Search Toolbar and Windows Desktop
Search built into Vista have similar functionality but they are not the same. The SDK and
the sample you are referring to in your initial reply do not work on Vista, apparently the
COM component that comes with MSN's Desktop Search is not the same as Vista's Search COM
server (MSSCTLB and MSSITLB - mssrch.dll and mssitlb.dll).

Willy.
Apr 10 '07 #8
The search feature in Windows has supported searching files for text strings
since at least Windows 95, well before either indexing or WDS. What it does
is uses the FindFirst/NextFile APIs to match the file template and then
opens the found files for ascii (as opposed to unicode) binary read to scan
for the requested text.

Mike Ober.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:OE****************@TK2MSFTNGP06.phx.gbl...
It should be noted that this approach has some caveats, those being:

- The machine that this is run on has to have Windows Desktop Search
installed, located at:

http://www.microsoft.com/windows/des...h/default.mspx

- The directories that the documents reside in have to be indexed by
Windows Desktop Search. If they are not, then a search using these APIs
will produce nothing.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Tom Porterfield" <tp******@mvps.orgwrote in message
news:eW**************@TK2MSFTNGP02.phx.gbl...
>Vai2000 wrote:
>>Hi All, Planning to call the same search API which windows Search uses
for
searching , when u launch with Ctrl+F,you have the flexibility to
provide
a containing text!

VB/C# any thing would work

My search wants to use Containing text

Thanks
Preferred OS:Win2k3

You might also be interested in
http://addins.msn.com/devguide.aspx#...sktopSearchApi.
--
Tom Porterfield


Apr 11 '07 #9
Willy Denoyette [MVP] wrote:
Windows Desktop Search, which is installed with MSN Search Toolbar and
Windows Desktop Search built into Vista have similar functionality but
they are not the same.
That seems to contradict the following statement:

"Windows Search is a standard component of Microsoft Windows Vista enabled
by default and an add-in for Windows XP which allows instant search
capabilities for most common file and data types such as e-mail, contacts,
calendar appointments, documents, photos, multimedia, and other formats
extended by third-parties. These capabilities enable consumers and
Information Workers to more efficiently find, manage, and organize the
increasing amount of data common in home and enterprise environments."

http://msdn2.microsoft.com/en-us/library/aa965362.aspx

The SDK and the sample you are referring to in
your initial reply do not work on Vista, apparently the COM component
that comes with MSN's Desktop Search is not the same as Vista's Search
COM server (MSSCTLB and MSSITLB - mssrch.dll and mssitlb.dll).
I see that now. Should have pointed to
http://msdn2.microsoft.com/en-us/library/bb331575.aspx instead.
--
Tom Porterfield

Apr 11 '07 #10
"Tom Porterfield" <tp******@mvps.orgwrote in message
news:OE*************@TK2MSFTNGP05.phx.gbl...
Willy Denoyette [MVP] wrote:
>Windows Desktop Search, which is installed with MSN Search Toolbar and
Windows Desktop Search built into Vista have similar functionality but
they are not the same.

That seems to contradict the following statement:

"Windows Search is a standard component of Microsoft Windows Vista enabled by default and
an add-in for Windows XP which allows instant search capabilities for most common file and
data types such as e-mail, contacts, calendar appointments, documents, photos, multimedia,
and other formats extended by third-parties. These capabilities enable consumers and
Information Workers to more efficiently find, manage, and organize the increasing amount
of data common in home and enterprise environments."

http://msdn2.microsoft.com/en-us/library/aa965362.aspx
True, but "Windows Search" != "Windows Desktop Search" which is what you were refering to
and confused me.
Windows Search is standard in Vista and optional in XP, they offer similar functionality but
they aren't exactly the same, Vista has more features.

>
>The SDK and the sample you are referring to in
your initial reply do not work on Vista, apparently the COM component
that comes with MSN's Desktop Search is not the same as Vista's Search
COM server (MSSCTLB and MSSITLB - mssrch.dll and mssitlb.dll).

I see that now. Should have pointed to
http://msdn2.microsoft.com/en-us/library/bb331575.aspx instead.
--
This is brand new (Microsoft Windows Search 3.x SDK Date Published: 3/9/2007 ), I have
installed the SDK on Vista, and the samples seems to work, be it only on indexed scopes.
The SDK comes with an hand made Interop Assembly (Microsoft.Search.Interop), so you don't
need to set a reference to the underlying COM server. However, the IA is hand tuned, and
exposes only the common COM interfaces available on XP and W2K3 and Vista. However, if you
compare the IA with the COM server (mssrch) Interfaces on Vista you will see that the IA is
missing some Interfaces.

Willy.
Apr 11 '07 #11
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
True, but "Windows Search" != "Windows Desktop Search" which is what you
were refering to and confused me.
Windows Search is standard in Vista and optional in XP, they offer similar
functionality but they aren't exactly the same, Vista has more features.

Again, this doesn't match what I have been told from other sources. The GUI
is different and allows more options in Vista but the underlying technology
is the same.
--
Tom Porterfield

Apr 12 '07 #12
"Michael D. Ober" <obermd.@.alum.mit.edu.nospamwrote in message
news:OL**************@TK2MSFTNGP04.phx.gbl...
The search feature in Windows has supported searching files for text
strings since at least Windows 95, well before either indexing or WDS.
What it does is uses the FindFirst/NextFile APIs to match the file
template and then opens the found files for ascii (as opposed to unicode)
binary read to scan for the requested text.

Yes, a fairly inefficient way to search for text in files, but if it's all
you got it's all you got.
--
Tom Porterfield

Apr 12 '07 #13
"Tom Porterfield" <tp******@mvps.orgwrote in message
news:00**********************************@microsof t.com...
"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>True, but "Windows Search" != "Windows Desktop Search" which is what you were refering
to and confused me.
Windows Search is standard in Vista and optional in XP, they offer similar functionality
but they aren't exactly the same, Vista has more features.


Again, this doesn't match what I have been told from other sources. The GUI is different
and allows more options in Vista but the underlying technology is the same.
I stand corrected, you are right, I thought that the "Property System" was only available on
Vista, but I see that now it's also been made available to XP and W2K3 through "Windows
Search 3.0" and up.

So the underlying technology is identical.

mssrch.dll
mssitlb.dll
mssprxy.dll
SearchIndexer.exe
SearchFilterHost.exe
SearchProtocolHost.exe

are common for XP, W2K3 and Vista.

The Interop Assembly that comes with the "Windows Search 3.0 SDK" only reflects part of the
search functionality. The IA is hand made subset from the interface definitions in
searchAPI.h, however it doesn't expose all interfaces, notably it doesn't expose any of the
Sink interfaces.
Note that the Property System as used by the Explorer *Search* is not exposed through COM,
you need to PInvoke propsys.dll exported functions for this.

Willy.

Apr 12 '07 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David Douard | last post by:
Hi everybody, let me explain by problem: I am working on an application which consists in a C++ dll (numeric computations) and a Python IHM (Python/Tk), which must run under Linux and win32. My...
1
by: RL | last post by:
Hi all, I am new and am lost with Win32::Process stuff. I want on perl script to start a process, then another perl script to terminate the same process. I can start a process using......
6
by: Rajesh | last post by:
I am a System Administrator and do some programming (Admin Utlities) in VB6 & C#.net. I am interested in Win32 and thought of learning C++ (as it is a pre-requsite) and read 13 chapters from C++.Net...
13
by: dumpingrounds | last post by:
Hi, I must be going nutty, but I can't seem to find anywhere where I can get just the binaries for, say, 2.3.5 for win32. I've googled high and low and all I come up with is installer (MSI/EXE)...
48
by: Daniele C. | last post by:
As soon as my sourceforge.net project gets approved, I am going to build a ncurses port to win32 bindable to sockets, e.g. allowing VT100/ANSI terminals and the creation of simple terminal servers...
4
by: rob | last post by:
Is there a relatively easy way to send text from a Win32 process to a ..NET process, preferably in VC++ for the Win32 side and C# for .NET.
0
saranjegan
by: saranjegan | last post by:
Hello, Am using win32::serial port module to communicate with my serial port, from CPAN i found that communication is done through file handle by tie with configuration file, i need to...
1
by: Sin Jeong-hun | last post by:
The .NET BCL is great but not always sufficient. We need Win32 API's to do certain tasks. It's not impossible. We can manually write extern function signatures by hand or copy and paste from a site...
6
by: Perl Beginner | last post by:
Good morning all, I had to reinstall Perl (ActivePerl 5.10.0 Build 1004) on my computer (Windows XP), the install went fine. however, I'm having issues loading Win32-GuiTest using the repository in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.