数学建模社区-数学中国

标题: 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.

3 h! ^7 m8 }/ v, a$ Y! S# y

// include SHLOBJ.H in your CPP file.7 `9 {' X+ p5 P( r #include <shlobj.h>

! J4 e" B% ?5 [0 L

// Add this statement to your code.6 [' ^- D/ `: i7 K9 Z ShellExecute(Handle,"find",NULL,NULL,NULL,SW_SHOWDEFAULT);

$ H! T6 ?, W: t o+ W- m

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. - q B$ m: h! b, B9 l






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