数学建模社区-数学中国

标题: Ask the API to find a file [打印本页]

作者: 韩冰    时间: 2005-1-26 01:23
标题: Ask the API to find a file

You can find files by using the ShellExecute function. Unfortunately, this doesn't quite work like I was hoping. Here is how you do it.

4 T: B1 g- f" ~2 k/ {

// include SHLOBJ.H in your CPP file. @0 I) j( H$ m3 W! X #include <shlobj.h>

1 ^ s: c r y; W' L

// Add this statement to your code. : j. `% a, j3 m/ K4 W+ S* z3 ^ ShellExecute(Handle,"find",NULL,NULL,NULL,SW_SHOWDEFAULT);

W5 Y! r @# Q

Note: The downfall is that you can't specify what to search for. ShellExecute usually allows you to specify a filename, but you can't specify a file when you use the "find" command. 0 g$ v- L# D5 c% O+ A# M# M$ z0 s$ h






欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5