{"id":1813,"date":"2024-03-07T22:39:25","date_gmt":"2024-03-07T14:39:25","guid":{"rendered":"https:\/\/blog.iotot.com\/?p=1813"},"modified":"2024-03-07T22:40:32","modified_gmt":"2024-03-07T14:40:32","slug":"%e5%9c%a8labwindows%e4%b8%ad%ef%bc%8c%e5%8f%af%e4%bb%a5%e9%80%9a%e8%bf%87%e4%bb%a3%e7%a0%81%e5%ae%9e%e7%8e%b0%e6%8e%a7%e4%bb%b6%e7%9a%84%e7%a7%bb%e5%8a%a8%e5%90%97","status":"publish","type":"post","link":"https:\/\/blog.iotot.com\/?p=1813","title":{"rendered":"\u5728LabWindows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u5b9e\u73b0\u63a7\u4ef6\u7684\u79fb\u52a8\u5417"},"content":{"rendered":"<p>\u5728LabWindows\u4e2d\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u5b9e\u73b0\u63a7\u4ef6\u7684\u79fb\u52a8\u3002LabWindows\u662f\u4e00\u4e2a\u7528\u4e8e\u5b9e\u9a8c\u5ba4\u6d4b\u91cf\u548c\u63a7\u5236\u7684\u5f00\u53d1\u73af\u5883\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u6765\u521b\u5efa\u7528\u6237\u754c\u9762\uff0c\u5e76\u901a\u8fc7\u7f16\u7a0b\u5b9e\u73b0\u63a7\u4ef6\u7684\u884c\u4e3a\u3002<\/p>\n<p>\u4f60\u53ef\u4ee5\u4f7f\u7528LabWindows\u63d0\u4f9b\u7684\u51fd\u6570\u6765\u83b7\u53d6\u548c\u8bbe\u7f6e\u63a7\u4ef6\u7684\u4f4d\u7f6e\u5750\u6807\uff0c\u4ece\u800c\u5b9e\u73b0\u63a7\u4ef6\u7684\u79fb\u52a8\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u4f60\u9700\u8981\u505a\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u4f7f\u7528LabWindows\u63d0\u4f9b\u7684\u754c\u9762\u8bbe\u8ba1\u5668\u521b\u5efa\u7528\u6237\u754c\u9762\uff0c\u5e76\u6dfb\u52a0\u9700\u8981\u79fb\u52a8\u7684\u63a7\u4ef6\u3002<\/li>\n<li>\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u76f8\u5e94\u7684\u51fd\u6570\u6765\u83b7\u53d6\u63a7\u4ef6\u7684\u4f4d\u7f6e\u4fe1\u606f\u3002<\/li>\n<li>\u6839\u636e\u9700\u8981\u4fee\u6539\u63a7\u4ef6\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u4ece\u800c\u5b9e\u73b0\u63a7\u4ef6\u7684\u79fb\u52a8\u3002<\/li>\n<li>\u66f4\u65b0\u754c\u9762\u4ee5\u663e\u793a\u63a7\u4ef6\u79fb\u52a8\u540e\u7684\u6548\u679c\u3002<\/li>\n<\/ol>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u6f14\u793a\u4e86\u5982\u4f55\u901a\u8fc7\u4ee3\u7801\u5b9e\u73b0\u63a7\u4ef6\u7684\u79fb\u52a8\uff1a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#include &lt;userint.h&gt;\r\n#include &lt;utility.h&gt;\r\n\r\nint main(int argc, char *argv[])\r\n{\r\n    if (InitCVIRTE(0, argv, 0) == 0)\r\n        return -1;  \/* out of memory *\/\r\n\r\n    int panelHandle = LoadPanel(0, \"YourPanel.uir\", PANEL);\r\n    DisplayPanel(panelHandle);\r\n\r\n    \/\/ \u83b7\u53d6\u63a7\u4ef6\u7684\u521d\u59cb\u4f4d\u7f6e\r\n    int initialLeft, initialTop;\r\n    GetCtrlAttribute(panelHandle, PANEL_YOURCONTROL, ATTR_LEFT, &amp;initialLeft);\r\n    GetCtrlAttribute(panelHandle, PANEL_YOURCONTROL, ATTR_TOP, &amp;initialTop);\r\n\r\n    \/\/ \u79fb\u52a8\u63a7\u4ef6\r\n    SetCtrlAttribute(panelHandle, PANEL_YOURCONTROL, ATTR_LEFT, initialLeft + 50);\r\n    SetCtrlAttribute(panelHandle, PANEL_YOURCONTROL, ATTR_TOP, initialTop + 50);\r\n\r\n    \/\/ \u66f4\u65b0\u754c\u9762\r\n    RefreshPanel(panelHandle);\r\n\r\n    RunUserInterface();\r\n\r\n    DiscardPanel(panelHandle);\r\n    return 0;\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u8bf7\u6ce8\u610f\uff0c\u793a\u4f8b\u4ee3\u7801\u4e2d\u7684 <code>PANEL_YOURCONTROL<\/code> \u5e94\u8be5\u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u4f7f\u7528\u7684\u63a7\u4ef6\u7684\u540d\u79f0\uff0c<code>\"YourPanel.uir\"<\/code> \u5e94\u8be5\u66ff\u6362\u4e3a\u4f60\u7684\u754c\u9762\u6587\u4ef6\u540d\u3002\u8fd9\u53ea\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff0c\u5b9e\u9645\u60c5\u51b5\u4e2d\u4f60\u53ef\u80fd\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u66f4\u590d\u6742\u7684\u63a7\u4ef6\u79fb\u52a8\u64cd\u4f5c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728LabWindows\u4e2d\u53ef\u4ee5\u901a\u8fc7\u4ee3\u7801\u5b9e\u73b0\u63a7\u4ef6\u7684\u79fb\u52a8\u3002LabWindows\u662f\u4e00\u4e2a\u7528\u4e8e\u5b9e\u9a8c\u5ba4\u6d4b\u91cf\u548c\u63a7\u5236\u7684\u5f00\u53d1\u73af\u5883\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[115],"_links":{"self":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts\/1813"}],"collection":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1813"}],"version-history":[{"count":2,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts\/1813\/revisions"}],"predecessor-version":[{"id":1816,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=\/wp\/v2\/posts\/1813\/revisions\/1816"}],"wp:attachment":[{"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iotot.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}