faq19.htm
来自「C++builder学习资料C++builder」· HTM 代码 · 共 42 行
HTM
42 行
<HTML>
<HEAD>
<TITLE>the API to find a file</TITLE>
<META NAME="Author" CONTENT="Harold Howe">
</HEAD>
<BODY BGCOLOR="WHITE">
<CENTER>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="640">
<TR>
<TD>
<H3>
the API to find a file.
</H3>
<P>
You can find files by using the <tt>ShellExecute</TT> function. Unfortunately, this
doesn't quite work like I was hoping. Here is how you do it.
</P>
<pre>
<font color="navy">// include SHLOBJ.H in your CPP file.</font>
<font color="green">#include <shlobj.h></font>
<font color="navy">// Add this statement to your code.</font>
ShellExecute<b>(</b>Handle<b>,</b><font color="blue">"find"</font><b>,</b>NULL<b>,</b>NULL<b>,</b>NULL<b>,</b>SW_SHOWDEFAULT<b>)</b><b>;</b>
</pre>
<P>
<B>Note:</B> The downfall is that you can't specify what to search for. <tt>ShellExecute</TT> usually
allows you to specify a filename, but you can't specify a file when you use the <TT>"find"</TT> command.
</P>
</TD> </TR>
</TABLE>
</CENTER>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?