{"id":78,"date":"2009-07-13T21:40:52","date_gmt":"2009-07-13T13:40:52","guid":{"rendered":"http:\/\/115.29.108.60\/?p=78"},"modified":"2011-09-26T21:33:27","modified_gmt":"2011-09-26T13:33:27","slug":"wavplayer%e5%af%b9%e8%af%9d%e6%a1%86%e7%89%88","status":"publish","type":"post","link":"http:\/\/115.29.108.60\/?p=78","title":{"rendered":"WavPlayer\u5bf9\u8bdd\u6846\u7248"},"content":{"rendered":"<p><span style=\"font-family: \u5b8b\u4f53;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: Georgia; mso-hansi-font-family: Georgia;\"><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u5b9a\u4e49\u5168\u5c40\u53d8\u91cf<span lang=\"EN-US\"><\/span><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\" lang=\"EN-US\">OPENFILENAME ofn;<br \/>\nTCHAR szFile[MAX_PATH];<br \/>\nint play = 0;<\/span>\n<\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u5904\u7406\u8fc7\u7a0b<span lang=\"EN-US\"><\/span><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\" lang=\"EN-US\">void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)<br \/>\n{<br \/>\n\u00a0ZeroMemory(&amp;ofn, sizeof(ofn));<br \/>\n\u00a0ofn.lStructSize = sizeof(ofn);<br \/>\n\u00a0ofn.lpstrFile = szFile;<br \/>\n\u00a0\/\/ofn.lpstrFile[0] = TEXT(&#8216;\\0&#8217;);<br \/>\n\u00a0ofn.nMaxFile = sizeof(szFile);<br \/>\n\u00a0ofn.lpstrFilter = TEXT(&#8220;*.wav\\0*.wav\\0&#8221;);<br \/>\n\u00a0ofn.nFilterIndex = 1;<br \/>\n\u00a0ofn.lpstrFileTitle = NULL;<br \/>\n\u00a0ofn.nMaxFileTitle = 0;<br \/>\n\u00a0ofn.lpstrInitialDir = NULL;<br \/>\n\u00a0ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;<br \/>\n\u00a0\u00a0\u00a0 switch(id)<br \/>\n\u00a0\u00a0\u00a0 {<br \/>\n\u00a0\u00a0\u00a0 \u00a0case IDC_BTNOPEN:<br \/>\n\u00a0\u00a0\u00a0\u00a0if(GetOpenFileName(&amp;ofn))<br \/>\n\u00a0\u00a0\u00a0 {<br \/>\n\u00a0\u00a0\u00a0 \u00a0SetDlgItemText(hwnd, IDC_EDTPATH, szFile);<br \/>\n\u00a0\u00a0\u00a0 \u00a0SetDlgItemText(hwnd, IDC_EDTSTATIC, TEXT(&#8220;<\/span><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u5df2\u6253\u5f00<span lang=\"EN-US\">&#8220;));<br \/>\n\u00a0\u00a0\u00a0 \u00a0play = 1;<br \/>\n\u00a0\u00a0\u00a0 }<br \/>\n\u00a0\u00a0\u00a0 \u00a0break;<br \/>\n\u00a0\u00a0\u00a0 \u00a0case IDC_BTNPLAY:<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0if(play)<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0{<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\/\/PlaySound(szFile, hAppInstance, SND_FILENAME | SND_ASYNC);<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0PlaySound(szFile, NULL, SND_FILENAME | SND_ASYNC);<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0SetDlgItemText(hwnd, IDC_EDTSTATIC, TEXT(&#8220;<\/span>\u64ad\u653e<span lang=\"EN-US\">&#8220;));<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0}<br \/>\n\u00a0\u00a0\u00a0 \u00a0break;<br \/>\n\u00a0\u00a0\u00a0 \u00a0case IDC_BTNSTOP:<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0if(play)<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0{<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\/\/PlaySound(szFile, hAppInstance, SND_FILENAME | SND_ASYNC);<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0PlaySound(NULL, NULL, SND_FILENAME | SND_SYNC);<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0SetDlgItemText(hwnd, IDC_EDTSTATIC, TEXT(&#8220;<\/span>\u505c\u6b62<span lang=\"EN-US\">&#8220;));<br \/>\n\u00a0\u00a0\u00a0 \u00a0\u00a0}<br \/>\n\u00a0\u00a0\u00a0 \u00a0break;<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 default:break;<br \/>\n\u00a0\u00a0\u00a0 }<br \/>\n}<\/span><\/span>\n<\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\" lang=\"EN-US\">Windows<\/span><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u7a0b\u5e8f\u4e3b\u8981\u662f<span lang=\"EN-US\">OS<\/span>\u4e0e\u51fd\u6570\u4ee5\u53ca\u51fd\u6570\u4e0e\u51fd\u6570\u7684\u76f8\u4e92\u8c03\u7528\uff0c\u56e0\u6b64\u5728\u5199<span lang=\"EN-US\">WavPlayer<\/span>\u5bf9\u8bdd\u6846\u7248\u65f6\uff0c\u8981\u6ce8\u610f\u5230\u53d8\u91cf\u7684\u4f5c\u7528\u57df\u4ee5\u53ca\u5168\u5c40\u53d8\u91cf\u7684\u5b9a\u4e49\u3002\u5728<span lang=\"EN-US\">Main_OnCommand<\/span>\u91cc\u5b9a\u4e49\u53d8\u91cf\u6253\u5f00<span lang=\"EN-US\">wav<\/span>\u6587\u4ef6\u540e\uff0c\u6309\u64ad\u653e\uff0c<span lang=\"EN-US\">ofn<\/span>\u3001<span lang=\"EN-US\">szFile<\/span>\u3001<span lang=\"EN-US\">play<\/span>\u53c8\u88ab\u521d\u59cb\u5316\uff0c\u5bfc\u81f4\u65e0\u6cd5\u64ad\u653e\u3002<span lang=\"EN-US\"><\/span><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u5168\u5c40\u53d8\u91cf\u7684\u5b9a\u4e49\u662f\u5728\u4e00\u4e2a<span lang=\"EN-US\">.cpp<\/span>\u7684\u6587\u4ef6\u4e2d\u5b9a\u4e49\uff0c\u518d\u5728\u4e00\u4e2a<span lang=\"EN-US\">.h<\/span>\u7684\u6587\u4ef6\u4e2d\u4f7f\u7528\u5173\u952e\u5b57<span lang=\"EN-US\">extern<\/span>\u8fdb\u884c\u58f0\u660e\uff0c\u5176\u4ed6\u9700\u8981\u4f7f\u7528\u8be5\u5168\u5c40\u53d8\u91cf\u7684\u6587\u4ef6<span lang=\"EN-US\">#include<\/span>\u8be5\u5934\u6587\u4ef6\u5373\u53ef\u3002<span lang=\"EN-US\"><\/span><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-family: \u5b8b\u4f53;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u7528<\/span><\/span><span style=\"font-family: Calibri;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast; mso-bidi-font-family: Calibri;\" lang=\"EN-US\">GetWindowLong<\/span><\/span><span style=\"font-family: \u5b8b\u4f53;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u4ece\u7a97\u53e3\u53e5\u67c4\u53d6\u5f97\u6267\u884c\u5b9e\u4f53\u53e5\u67c4\uff1a<\/span><\/span><span style=\"font-family: Calibri;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast; mso-bidi-font-family: Calibri;\" lang=\"EN-US\">HINSTANCE ai = (HINSTANCE)GetWindowLong(hwnd,GWL_HINSTANCE);<\/span><\/span><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\" lang=\"EN-US\"><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: x-small; font-family: Calibri;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast; mso-bidi-font-family: Calibri;\" lang=\"EN-US\">PlaySound<\/span><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast; mso-bidi-font-family: Calibri;\">\u7528\u4e8e\u64ad\u653e\u5d4c\u5165\u5f0f<span lang=\"EN-US\">wav<\/span>\u8d44\u6e90\u6587\u4ef6\u65f6\uff0c\u5176\u4e2d\u8981\u7528\u5230\u7b2c\u4e8c\u4e2a\u53c2\u6570<span lang=\"EN-US\">hmod<\/span>\uff1a<span lang=\"EN-US\">PlaySound(TEXT(&#8220;IDW_MUSIC&#8221;),appInstance,SND_RESOURCE|SND_ASYNC| SND_LOOP);<\/span><\/span><\/span><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\" lang=\"EN-US\"><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u95ee\u9898\uff1a<span lang=\"EN-US\"><\/span><\/span><\/p>\n<p style=\"line-height: 14.25pt;\"><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\" lang=\"EN-US\">ofn.lpstrFile[0] = TEXT(&#8216;\\0&#8217;);<\/span><span style=\"font-size: 10.5pt; color: black; mso-ascii-font-family: \u5b8b\u4f53; mso-ascii-theme-font: minor-fareast; mso-fareast-font-family: \u5b8b\u4f53; mso-fareast-theme-font: minor-fareast; mso-hansi-font-family: \u5b8b\u4f53; mso-hansi-theme-font: minor-fareast;\">\u8fd9\u53e5\u662f\u5c06<span lang=\"EN-US\">ofn.lpstrFile<\/span>\u6240\u6307\u5b57\u7b26\u4e32<span lang=\"EN-US\">\u201c<\/span>\u7f6e\u96f6<span lang=\"EN-US\">\u201d<\/span>\uff0c\u8d77\u5230\u521d\u59cb\u5316\u7684\u4f5c\u7528\u3002\u5728<span lang=\"EN-US\">VC6.0<\/span>\u91cc\uff0c\u901a\u8fc7\u8c03\u8bd5\u67e5\u770b\u5176\u548c<span lang=\"EN-US\">szFile<\/span>\u7684\u503c\u662f\u6b63\u786e\u7684\u8def\u5f84\u3002<span lang=\"EN-US\"><br \/>\n<\/span>\u4f46\u5728\u7528<span lang=\"EN-US\">C-Free<\/span>\u5199\u7684\u8fd9\u4e2a\u7a0b\u5e8f\u91cc\uff0c\u53d1\u73b0<span lang=\"EN-US\">X<\/span>\u76d8\u8def\u5f84\u662f<span lang=\"EN-US\">\u201c\\000:\u2026\u2026\u201d<\/span>\uff0c\u663e\u793a\u51fa\u6765\u786e\u5b9e\u662f<span lang=\"EN-US\">\u201cX:\u2026\u2026\u201d<\/span>\uff0c\u4f46\u662f\u7528\u5728<span lang=\"EN-US\">PlaySound<\/span>\u91cc\u5374\u65e0\u6cd5\u64ad\u653e<span lang=\"EN-US\">wav<\/span>\u6587\u4ef6\u3002<span lang=\"EN-US\"><br \/>\n<\/span>\u53bb\u6389\u4e86<span lang=\"EN-US\">ofn.lpstrFile[0] = TEXT(&#8216;\\0&#8217;);<\/span>\u5c31\u53ef\u4ee5\u4e86\u3002\u4e3a\u4ec0\u4e48\u5462\uff1f<span lang=\"EN-US\"><\/span><\/span>\n<\/p>\n<p style=\"line-height: 14.25pt;\">\u00a0<\/p>\n<p><\/span><\/span><\/p>\n<p style=\"line-height: 14.25pt;\">\u00a0<\/p>\n<p><a href=\"http:\/\/115.29.108.60\/wp-content\/uploads\/2009\/07\/wavplayer1.exe\">WavPlayer\u5bf9\u8bdd\u6846\u7248<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9a\u4e49\u5168\u5c40\u53d8\u91cf OPENFILENAME ofn; TCHAR szFile[MAX_PATH]; int pl [&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-78","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\/78","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=78"}],"version-history":[{"count":6,"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":845,"href":"http:\/\/115.29.108.60\/index.php?rest_route=\/wp\/v2\/posts\/78\/revisions\/845"}],"wp:attachment":[{"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/115.29.108.60\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}