{"id":165,"date":"2009-08-23T18:28:12","date_gmt":"2009-08-23T10:28:12","guid":{"rendered":"http:\/\/115.29.108.60\/?p=165"},"modified":"2011-09-26T21:36:44","modified_gmt":"2011-09-26T13:36:44","slug":"%e6%96%87%e4%bb%b6%e5%a4%b9%e9%80%89%e6%8b%a9%e5%af%b9%e8%af%9d%e6%a1%86","status":"publish","type":"post","link":"http:\/\/115.29.108.60\/?p=165","title":{"rendered":"\u6587\u4ef6\u5939\u9009\u62e9\u5bf9\u8bdd\u6846"},"content":{"rendered":"<p>\u5728MusicPlayer\u91cc\u6298\u817e\u4e86\u5f88\u4e45\u7684\u6587\u4ef6\u5939\u9009\u62e9\u5bf9\u8bdd\u6846\u4ee3\u7801\uff0c\u7ec8\u4e8e\u5728SDK\u7684\u5e2e\u52a9\u4e0b\u5b8c\u6210\u4e86\u3002\u8d34\u4e0b\u4ee3\u7801\uff1a<\/p>\n<p>void SelectFolder(HWND hwnd)<br \/>\n{<br \/>\n\u00a0LPMALLOC lpMalloc = NULL;<br \/>\n\u00a0if(SUCCEEDED(SHGetMalloc(&amp;lpMalloc)))<br \/>\n\u00a0{<br \/>\n\u00a0\u00a0TCHAR szPath[MAX_PATH];<br \/>\n\u00a0\u00a0BROWSEINFO bi;<br \/>\n\u00a0\u00a0LPITEMIDLIST pidl = NULL;<br \/>\n\u00a0\u00a0ZeroMemory(szPath, sizeof(szPath));\/\/\u6ce8\u610f\u7ed3\u6784\u4f53\u7684\u7f6e\u96f6<br \/>\n\u00a0\u00a0ZeroMemory(&amp;bi, sizeof(bi));<br \/>\n\u00a0\u00a0bi.hwndOwner = hwnd;<br \/>\n\u00a0\u00a0bi.pidlRoot = NULL;<br \/>\n\u00a0\u00a0bi.pszDisplayName = szPath;<br \/>\n\u00a0\u00a0bi.lpszTitle = TEXT(&#8220;\u9009\u62e9\u76ee\u5f55\uff1a&#8221;);<br \/>\n\u00a0\u00a0bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_BROWSEFORCOMPUTER;<br \/>\n\u00a0\u00a0bi.lpfn = NULL;<br \/>\n\u00a0\u00a0bi.lParam = 0;<br \/>\n\u00a0\u00a0bi.iImage = 0;<br \/>\n\u00a0\u00a0CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);\/\/\u521d\u59cb\u5316COM\u5e93<br \/>\n\u00a0\u00a0if((pidl = SHBrowseForFolder(&amp;bi)) != NULL)\/\/\u663e\u793a\u6587\u4ef6\u5939\u9009\u62e9\u5bf9\u8bdd\u6846\u5e76\u64cd\u4f5c<br \/>\n\u00a0\u00a0{<br \/>\n\u00a0\u00a0\u00a0SHGetPathFromIDList(pidl, szPath);\/\/\u8f6c\u6362\u6587\u4ef6\u5939\u8def\u5f84<br \/>\n\u00a0\u00a0\u00a0FindAllFile(hwnd, szPath, &#8220;*.mp3&#8221;);\/\/\u67e5\u627e\u6587\u4ef6\u5939\u4e0bmp3\u6587\u4ef6<br \/>\n\u00a0\u00a0\u00a0FindAllFile(hwnd, szPath, &#8220;*.wma&#8221;);\/\/wma<br \/>\n\u00a0\u00a0\u00a0FindAllFile(hwnd, szPath, &#8220;*.wav&#8221;);\/\/wav<br \/>\n\u00a0\u00a0\u00a0\/\/MessageBox(NULL, szPath, &#8220;&#8221;, MB_OK);<br \/>\n\u00a0\u00a0}<br \/>\n\u00a0\u00a0\/\/CoTaskMemFree(pidl);<br \/>\n\u00a0\u00a0lpMalloc-&gt;Free(pidl);<br \/>\n\u00a0\u00a0lpMalloc-&gt;Release();<br \/>\n\u00a0\u00a0CoUninitialize();\/\/\u5173\u95edCOM\u5e93<br \/>\n\u00a0}<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728MusicPlayer\u91cc\u6298\u817e\u4e86\u5f88\u4e45\u7684\u6587\u4ef6\u5939\u9009\u62e9\u5bf9\u8bdd\u6846\u4ee3\u7801\uff0c\u7ec8\u4e8e\u5728SDK\u7684\u5e2e\u52a9\u4e0b\u5b8c\u6210\u4e86\u3002\u8d34\u4e0b\u4ee3\u7801\uff1a void  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-165","post","type-post","status-publish","format-standard","hentry","category-windows"],"_links":{"self":[{"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/posts\/165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165"}],"version-history":[{"count":5,"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":859,"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/posts\/165\/revisions\/859"}],"wp:attachment":[{"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}