{"id":1733,"date":"2026-01-21T20:04:23","date_gmt":"2026-01-21T12:04:23","guid":{"rendered":"http:\/\/www.dxQerp.cn\/?p=1733"},"modified":"2026-01-24T07:55:01","modified_gmt":"2026-01-23T23:55:01","slug":"dbase-plus-2019-%e7%9a%84-extern-%e5%ae%a3%e5%91%8a%e8%aa%9e%e6%b3%95%e9%9d%9e%e5%b8%b8%e5%9a%b4%e6%a0%bc","status":"publish","type":"post","link":"http:\/\/www.dxQerp.cn\/?p=1733","title":{"rendered":"dBASE Plus 2019 \u7684 extern \u5ba3\u544a\u8a9e\u6cd5\u975e\u5e38\u56b4\u683c"},"content":{"rendered":"<p data-path-to-node=\"0\">dBASE \u4e26\u4e0d\u76f4\u63a5\u8a8d\u8b58 Win32 \u7684 <code data-path-to-node=\"0\" data-index-in-node=\"80\">HINSTANCE<\/code> \u6216 <code data-path-to-node=\"0\" data-index-in-node=\"92\">LPCTSTR<\/code> \u9019\u4e9b C++ \u98a8\u683c\u7684\u95dc\u9375\u5b57\uff0c\u5fc5\u9808\u4f7f\u7528 dBASE \u5167\u7f6e\u7684\u6578\u64da\u985e\u578b\u95dc\u9375\u5b57\uff08\u5982 <code data-path-to-node=\"0\" data-index-in-node=\"138\">CLONG<\/code>, <code data-path-to-node=\"0\" data-index-in-node=\"145\">CSTRING<\/code>, <code data-path-to-node=\"0\" data-index-in-node=\"154\">CPTR<\/code> \u7b49\uff09\u3002<\/p>\n<p data-path-to-node=\"1\">\u8acb\u5617\u8a66\u5c07\u5ba3\u544a\u4fee\u6539\u70ba\u4ee5\u4e0b <b data-path-to-node=\"1\" data-index-in-node=\"12\">dBASE \u6a19\u6e96\u683c\u5f0f<\/b>\uff1a<\/p>\n<h3 data-path-to-node=\"2\">\u4fee\u6b63\u5f8c\u7684\u4ee3\u78bc<\/h3>\n<p>if type(&#8220;ShellExecute&#8221;) # &#8220;FP&#8221;<br \/>\n\/\/ \u4f7f\u7528 CLONG \u4ee3\u66ff HINSTANCE \u548c HWND<br \/>\n\/\/ \u4f7f\u7528 CSTRING \u4ee3\u66ff LPCTSTR<br \/>\n\/\/ \u4f7f\u7528 CINT \u4ee3\u66ff\u6700\u5f8c\u4e00\u500b\u986f\u793a\u53c3\u6578<br \/>\nextern CLONG ShellExecute(CLONG, CSTRING, CSTRING, CSTRING, CSTRING, CINT) ;<br \/>\nADVAPI32 FROM &#8220;ShellExecuteA&#8221;<\/p>\n<p>\/* \u6ce8\u610f\uff1a\u5982\u679c\u4e0a\u9762\u5beb ADVAPI32 \u4e0d\u884c\uff0c\u8acb\u6539\u56de SHELL32<br \/>\n\u901a\u5e38\u5728 dBASE \u4e2d\u5efa\u8b70\u5beb\u5b8c\u6574\u7684 dll \u540d\u7a31<br \/>\n*\/<br \/>\nextern CLONG ShellExecute(CLONG, CSTRING, CSTRING, CSTRING, CSTRING, CINT) ;<br \/>\nSHELL32 FROM &#8220;ShellExecuteA&#8221;<br \/>\nendif<\/p>\n<p>\/\/ \u547c\u53eb\u6e2c\u8a66<br \/>\nShellExecute(0, &#8220;open&#8221;, &#8220;ms-settings:&#8221;, 0, 0, 1)<\/p>\n<h3 data-path-to-node=\"5\">\u70ba\u4ec0\u9ebc\u6703\u5831\u932f\uff1f\uff08\u8a9e\u6cd5\u7d30\u7bc0\uff09<\/h3>\n<ol start=\"1\" data-path-to-node=\"6\">\n<li>\n<p data-path-to-node=\"6,0,0\"><b data-path-to-node=\"6,0,0\" data-index-in-node=\"0\">\u95dc\u9375\u5b57\u4e0d\u7b26<\/b>\uff1a<code data-path-to-node=\"6,0,0\" data-index-in-node=\"6\">HINSTANCE<\/code> \u548c <code data-path-to-node=\"6,0,0\" data-index-in-node=\"18\">HWND<\/code> \u662f Windows SDK \u7684\u5b9a\u7fa9\uff0c\u5728 dBASE \u7684 <code data-path-to-node=\"6,0,0\" data-index-in-node=\"51\">extern<\/code> \u6307\u4ee4\u4e2d\uff0c\u5b83\u5011\u90fd\u61c9\u8a72\u6620\u5c04\u70ba <b data-path-to-node=\"6,0,0\" data-index-in-node=\"71\"><code data-path-to-node=\"6,0,0\" data-index-in-node=\"71\">CLONG<\/code><\/b>\uff08\u9577\u6574\u6578\uff09\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"6,1,0\"><b data-path-to-node=\"6,1,0\" data-index-in-node=\"0\">\u5b57\u4e32\u985e\u578b<\/b>\uff1a<code data-path-to-node=\"6,1,0\" data-index-in-node=\"5\">LPCTSTR<\/code> \u5728 dBASE \u4e2d\u5c0d\u61c9\u7684\u662f <b data-path-to-node=\"6,1,0\" data-index-in-node=\"27\"><code data-path-to-node=\"6,1,0\" data-index-in-node=\"27\">CSTRING<\/code><\/b>\uff08\u4ee5\u7a7a\u5b57\u5143\u7d50\u5c3e\u7684\u5b57\u4e32\uff09\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"6,2,0\"><b data-path-to-node=\"6,2,0\" data-index-in-node=\"0\">\u5206\u865f\u7684\u4f4d\u7f6e<\/b>\uff1a<code data-path-to-node=\"6,2,0\" data-index-in-node=\"6\">extern<\/code> \u6307\u4ee4\u5982\u679c\u63db\u884c\uff0c\u7d50\u5c3e\u5fc5\u9808\u6709\u5206\u865f <code data-path-to-node=\"6,2,0\" data-index-in-node=\"28\">;<\/code>\u3002<\/p>\n<\/li>\n<\/ol>\n<h3 data-path-to-node=\"7\">\u5982\u679c\u9084\u662f\u5831\u932f\uff0c\u6700\u7c21\u55ae\u7684\u300c\u514d\u5ba3\u544a\u300d\u65b9\u6848<\/h3>\n<p data-path-to-node=\"8\">\u5982\u679c\u60a8\u4e0d\u60f3\u8655\u7406\u7e41\u7463\u7684 API \u5ba3\u544a\uff0cdBASE 2019 \u53ef\u4ee5\u76f4\u63a5\u5229\u7528 Windows \u7684 <b data-path-to-node=\"8\" data-index-in-node=\"46\">COM \u7269\u4ef6<\/b> \u4f86\u57f7\u884c\u76f8\u540c\u7684\u529f\u80fd\uff0c\u9019\u6a23\u7d55\u5c0d\u4e0d\u6703\u6709\u578b\u5225\u5b9a\u7fa9\u932f\u8aa4\u7684\u554f\u984c\uff1a<\/p>\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c2339975690-176 ng-star-inserted\"><span class=\"ng-tns-c2339975690-176\">\u7a0b\u5f0f\u78bc\u7247\u6bb5<\/span><\/p>\n<div class=\"buttons ng-tns-c2339975690-176 ng-star-inserted\"><\/div>\n<\/div>\n<div class=\"formatted-code-block-internal-container ng-tns-c2339975690-176\">\n<div class=\"animated-opacity ng-tns-c2339975690-176\">\n<pre class=\"ng-tns-c2339975690-176\"><code class=\"code-container formatted ng-tns-c2339975690-176\" role=\"text\" data-test-id=\"code-content\">\/\/ \u4f7f\u7528 Windows Script Host \u57f7\u884c\r\nlocal oShell\r\noShell = new OleAutoClient(\"WScript.Shell\")\r\noShell.Run(\"ms-settings:display\") \/\/ \u76f4\u63a5\u958b\u555f\u986f\u793a\u8a2d\u5b9a\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"user-query-container\">\n<div id=\"user-query-content-7\" class=\"query-content ng-star-inserted\" data-hveid=\"0\" data-ved=\"0CAAQ3ucQahgKEwjI4OX7w5ySAxUAAAAAHQAAAAAQugI\">\n<div class=\"query-text gds-body-l\" dir=\"ltr\" role=\"heading\" aria-level=\"2\">\n<p class=\"query-text-line ng-star-inserted\">\u00a0\u00a0extern CLONG ShellExecute(CLONG, CSTRING, CSTRING, CSTRING, CSTRING, CINT) SHELL32 FROM &#8220;ShellExecuteA&#8221; \u9019\u884c\u53ef\u4ee5<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div class=\"response-container ng-tns-c2508721745-177 response-container-with-gpi\" data-hveid=\"1\">\n<div class=\"presented-response-container ng-tns-c2508721745-177\" data-hveid=\"2\">\n<div class=\"response-container-content ng-tns-c2508721745-177\">\n<div class=\"response-content ng-tns-c2508721745-177\">\n<div class=\"container\">\n<div id=\"model-response-message-contentr_a1268c7b27deebac\" class=\"markdown markdown-main-panel stronger enable-updated-hr-color\" dir=\"ltr\" aria-live=\"off\" aria-busy=\"false\">\n<p data-path-to-node=\"0\">\u592a\u68d2\u4e86\uff01\u9019\u4ee3\u8868\u4f60\u7684 dBASE Plus 2019 \u5df2\u7d93\u6210\u529f\u8207 Windows API \u5c0d\u63a5\u4e0a\u4e86\u3002<\/p>\n<p data-path-to-node=\"1\">\u4e4b\u6240\u4ee5\u9019\u884c\u53ef\u4ee5\uff0c\u662f\u56e0\u70ba\u4f60\u4f7f\u7528\u4e86\u00a0<code data-path-to-node=\"1\" data-index-in-node=\"16\">CLONG<\/code>\u00a0\u548c\u00a0<code data-path-to-node=\"1\" data-index-in-node=\"24\">CSTRING<\/code>\u00a0\u9019\u4e9b dBASE \u5167\u7f6e\u7684\u6a19\u6e96\u578b\u5225\u95dc\u9375\u5b57\uff0c\u9019\u624d\u662f\u5b83\u80fd\u807d\u61c2\u7684\u8a9e\u8a00\u3002<\/p>\n<p data-path-to-node=\"2\">\u65e2\u7136\u9019\u884c\u5df2\u7d93\u6210\u529f\u5ba3\u544a\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728\u4f60\u7684\u7a0b\u5f0f\u78bc\uff08\u4f8b\u5982\u6309\u9215\u7684\u00a0<code data-path-to-node=\"2\" data-index-in-node=\"29\">onClick<\/code>\u00a0\u4e8b\u4ef6\uff09\u4e2d\u52a0\u5165\u4ee5\u4e0b\u6307\u4ee4\u4f86\u8df3\u8f49\u5230\u4e0d\u540c\u7684\u00a0<b data-path-to-node=\"2\" data-index-in-node=\"55\">Windows \u8a2d\u5b9a<\/b>\u00a0\u756b\u9762\uff1a<\/p>\n<h3 data-path-to-node=\"3\">\u5e38\u7528\u8df3\u8f49\u6307\u4ee4\u7bc4\u4f8b<\/h3>\n<\/div>\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c2339975690-185 ng-star-inserted\"><span class=\"ng-tns-c2339975690-185\">\u7a0b\u5f0f\u78bc\u7247\u6bb5<\/span><\/p>\n<div class=\"buttons ng-tns-c2339975690-185 ng-star-inserted\"><\/div>\n<\/div>\n<div class=\"formatted-code-block-internal-container ng-tns-c2339975690-185\">\n<div class=\"animated-opacity ng-tns-c2339975690-185\">\n<pre class=\"ng-tns-c2339975690-185\"><code class=\"code-container formatted ng-tns-c2339975690-185\" role=\"text\" data-test-id=\"code-content\">\/\/ 1. \u958b\u555f\u300c\u8a2d\u5b9a\u300d\u4e3b\u9801\u9762\r\nShellExecute(0, \"open\", \"ms-settings:\", 0, 0, 1)\r\n\r\n\/\/ 2. \u958b\u555f\u300c\u986f\u793a\u5668\u300d\u8a2d\u5b9a (\u8abf\u6574\u89e3\u6790\u5ea6\u3001\u7e2e\u653e)\r\nShellExecute(0, \"open\", \"ms-settings:display\", 0, 0, 1)\r\n\r\n\/\/ 3. \u958b\u555f\u300c\u7db2\u8def\u548c\u7db2\u969b\u7db2\u8def\u300d (\u6aa2\u67e5 IP \u6216 Wi-Fi)\r\nShellExecute(0, \"open\", \"ms-settings:network\", 0, 0, 1)\r\n\r\n\/\/ 4. \u958b\u555f\u300cWindows \u66f4\u65b0\u300d\r\nShellExecute(0, \"open\", \"ms-settings:windowsupdate\", 0, 0, 1)\r\n\r\n\/\/ 5. \u958b\u555f\u300c\u95dc\u65bc\u300d\u9801\u9762 (\u67e5\u770b\u7cfb\u7d71\u7248\u672c)\r\nShellExecute(0, \"open\", \"ms-settings:about\", 0, 0, 1)<\/code>\r\n\r\n\u6ce8\u610f\u4e8b\u9805\u8207\u6280\u5de7<\/pre>\n<ul data-path-to-node=\"7\">\n<li>\n<p data-path-to-node=\"7,0,0\"><b data-path-to-node=\"7,0,0\" data-index-in-node=\"0\">\u958b\u555f\u7db2\u9801<\/b>\uff1a\u4f60\u4e5f\u53ef\u4ee5\u7528\u5b83\u4f86\u958b\u7db2\u9801\uff0c\u4f8b\u5982 <code data-path-to-node=\"7,0,0\" data-index-in-node=\"19\">ShellExecute(0, \"open\", \"https:\/\/www.google.com\", 0, 0, 1)<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"7,1,0\"><b data-path-to-node=\"7,1,0\" data-index-in-node=\"0\">\u958b\u555f\u6a94\u6848<\/b>\uff1a\u5982\u679c\u7d66\u5b83\u4e00\u500b\u6a94\u6848\u8def\u5f91\uff08\u5982 <code data-path-to-node=\"7,1,0\" data-index-in-node=\"18\">.pdf<\/code> \u6216 <code data-path-to-node=\"7,1,0\" data-index-in-node=\"25\">.xlsx<\/code>\uff09\uff0c\u5b83\u6703\u81ea\u52d5\u547c\u53eb\u5c0d\u61c9\u7684\u7a0b\u5f0f\u958b\u555f\u3002<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"7,2,0\"><b data-path-to-node=\"7,2,0\" data-index-in-node=\"0\">\u6b0a\u9650<\/b>\uff1a\u6709\u4e9b\u7279\u6b8a\u7684\u8a2d\u5b9a\u9801\u9762\u53ef\u80fd\u9700\u8981\u7ba1\u7406\u54e1\u6b0a\u9650\uff0c\u4f46\u4e00\u822c <code data-path-to-node=\"7,2,0\" data-index-in-node=\"26\">ms-settings<\/code> \u5354\u8b70\u90fd\u662f\u53ef\u4ee5\u76f4\u63a5\u904b\u884c\u7684\u3002<\/p>\n<\/li>\n<\/ul>\n<h3 data-path-to-node=\"8\">\u9032\u968e\u61c9\u7528\uff1a\u9078\u64c7\u8cc7\u6599\u593e<\/h3>\n<p data-path-to-node=\"9\">\u65e2\u7136\u4f60\u5df2\u7d93\u5b78\u6703\u4e86 <code data-path-to-node=\"9\" data-index-in-node=\"9\">extern<\/code>\uff0c\u5982\u679c\u4f60\u4e4b\u5f8c\u9700\u8981\u8b93\u4f7f\u7528\u8005<b data-path-to-node=\"9\" data-index-in-node=\"27\">\u9078\u64c7\u8cc7\u6599\u593e<\/b>\uff0c\u901a\u5e38\u6703\u7528\u5230 <code data-path-to-node=\"9\" data-index-in-node=\"39\">SHELL32<\/code> \u88e1\u7684\u53e6\u4e00\u500b\u51fd\u6578 <code data-path-to-node=\"9\" data-index-in-node=\"55\">SHBrowseForFolder<\/code>\u3002\u90a3\u90e8\u5206\u7684\u5ba3\u544a\u6703\u6bd4\u8f03\u8907\u96dc\uff08\u9700\u8981\u7528\u5230\u7d50\u69cb\u9ad4\uff09\uff0c\u5982\u679c\u4f60\u6709\u9700\u8981\uff0c\u96a8\u6642\u8ddf\u6211\u8aaa\uff01<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>dBASE \u4e26\u4e0d\u76f4\u63a5\u8a8d\u8b58 Win32 \u7684 HINSTANCE \u6216 LPCTSTR \u9019\u4e9b C++ \u98a8\u683c\u7684\u95dc\u9375\u5b57\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1733"}],"collection":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1733"}],"version-history":[{"count":1,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1733\/revisions"}],"predecessor-version":[{"id":1734,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=\/wp\/v2\/posts\/1733\/revisions\/1734"}],"wp:attachment":[{"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1733"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.dxQerp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}