{"id":9630,"date":"2024-06-13T15:10:21","date_gmt":"2024-06-13T07:10:21","guid":{"rendered":"http:\/\/www.aiersheng.cc\/?p=9609"},"modified":"2024-07-08T09:22:47","modified_gmt":"2024-07-08T01:22:47","slug":"vb%e8%be%85%e5%af%bc%e5%ae%9e%e4%be%8b%e7%bc%96%e7%a8%8b11-2","status":"publish","type":"post","link":"https:\/\/www.aiersheng.cc\/?p=9630","title":{"rendered":"VB\u8f85\u5bfc\u5b9e\u4f8b\u7f16\u7a0b(11)"},"content":{"rendered":"<p><strong>VB\u8f85\u5bfc:\u7528VB\u5b9e\u73b0\u5c4f\u5e55\u9634\u6697\u64cd\u4f5c<\/strong><\/p>\n<p>\u3000\u3000\u4f7f\u7528\u8fc7Windows 9x\u7684\u7528\u6237\u90fd\u5e94\u8be5\u77e5\u9053\uff0c\u5728\u5173\u95edWindows\u7cfb\u7edf\u65f6\uff0c\u6574\u4e2a\u5c4f\u5e55\u4f1a\u6697\u4e0b\u6765\uff0c\u90a3\u4e48\uff0c\u5982\u4f55\u5728\u81ea\u5df1\u5f00\u53d1\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4e5f\u5b9e\u73b0\u8fd9\u4e00\u6548\u679c\u5462?\u6211\u4eec\u901a\u8fc7\u8c03\u7528\u4e00\u7ec4API\u51fd\u6570\u5c31\u53ef\u4ee5\u5b9e\u73b0\uff0c\u5982\u679c\u4f60\u6709\u5174\u8da3\uff0c\u5c31\u8ddf\u6211\u6765\u5427!\u8fd9\u4e00\u7ec4\u51fd\u6570\u662f\uff1a<\/p>\n<p>\u3000\u3000GetDC \uff1a\u7528\u6765\u83b7\u53d6\u5c4f\u5e55\u7684\u8bbe\u5907\u53f7;<\/p>\n<p>\u3000\u3000ReleaseDC \uff1a\u91ca\u653e\u6307\u5b9a\u7684\u8bbe\u5907;<\/p>\n<p>\u3000\u3000CreatePatternBrush \uff1a\u521b\u5efa\u56fe\u5f62\u5237\u5b50;<\/p>\n<p>\u3000\u3000PatBlt: \u5229\u7528\u521b\u5efa\u7684\u56fe\u5f62\u5237\u5b50\u586b\u5145\u6307\u5b9a\u8bbe\u5907;<\/p>\n<p>\u3000\u3000DeleteObject \uff1a\u5220\u9664\u521b\u5efa\u7684\u5bf9\u8c61(\u4e0eCreatePatternBrush\u521b\u5efa\u7684\u5237\u5b50\u5bf9\u8c61\u547c\u5e94);<\/p>\n<p>\u3000\u3000CreateBitmap \uff1a\u521b\u5efaBMP\u5bf9\u8c61;<\/p>\n<p>\u3000\u3000SelectObject \uff1a\u9009\u62e9\u5f53\u524d\u64cd\u4f5c\u5bf9\u8c61;<\/p>\n<p>\u3000\u3000InvalidateRect \uff1a\u4f7f\u64cd\u4f5c\u65e0\u6548\uff0c\u5373\u6062\u590d\u53d8\u6697\u524d\u7684\u72b6\u6001\u3002<\/p>\n<p>\u3000\u3000\u57fa\u672c\u601d\u8def<\/p>\n<p>\u3000\u3000\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u4f4d\u56fe\u5bf9\u8c61\uff0c\u7136\u540e\uff0c\u5229\u7528\u6b64\u4f4d\u56fe\u5bf9\u8c61\u521b\u5efa\u4e00\u4e2a\u56fe\u6848\u5237\u5b50\uff0c\u9009\u62e9\u6307\u5b9a\u8bbe\u5907\u4e3a\u5f53\u524d\u8bbe\u5907\uff0c\u5229\u7528\u5df2\u7ecf\u521b\u5efa\u7684\u56fe\u6848\u5237\u5b50\u586b\u5145\u5f53\u524d\u8bbe\u5907\uff0c\u5220\u9664\u521b\u5efa\u7684\u5237\u5b50\u5bf9\u8c61\u5373\u53ef\u4f7f\u5f53\u524d\u8bbe\u5907\u53d8\u6697\u3002\u8c03\u7528InvalidateRect\u51fd\u6570\u5c31\u53ef\u4f7f\u6307\u5b9a\u8bbe\u5907\u6062\u590d\u5230\u53d8\u6697\u524d\u7684\u72b6\u6001\u3002<\/p>\n<p>\u3000\u3000\u6b65 \u9aa4<\/p>\n<p>\u3000\u30001\u3001\u521b\u5efa\u4e00\u4e2aForm1\u7a97\u4f53\uff0c\u8bbe\u7f6e2\u4e2aCommand\u6309\u94ae\uff0c\u5c06Command1\u548cCommand2\u7684Caption\u5c5e\u6027\u5206\u522b\u8bbe\u7f6e\u4e3a\uff1a\u201c\u53d8\u6697\u201d\u548c\u201c\u6062\u590d\u201d\u3002<\/p>\n<p>\u3000\u30002\u3001\u5728\u7a97\u4f53\u4ee3\u7801\u6a21\u5757\u4e2d\u58f0\u660eAPI\u51fd\u6570\u548c\u76f8\u5e94\u7684\u7c7b\u578b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>\u3000\u3000Private Type RECT<\/p>\n<p>\u3000\u3000Left As Long<\/p>\n<p>\u3000\u3000Top As Long<\/p>\n<p>\u3000\u3000Right As Long<\/p>\n<p>\u3000\u3000Bottom As Long<\/p>\n<p>\u3000\u3000End Type<\/p>\n<p>\u3000\u3000Private Declare Function GetDC Lib &#8220;user32&#8221; (ByVal hwnd As Long) As Long<\/p>\n<p>\u3000\u3000Private Declare Function ReleaseDC Lib &#8220;user32&#8221; (ByVal hwnd As Long, ByVal hdc As Long) As Long<\/p>\n<p>\u3000\u3000Private Declare Function CreatePatternBrush Lib &#8220;gdi32&#8221; (ByVal hBitmap As Long) As Long<\/p>\n<p>\u3000\u3000Private Declare Function PatBlt Lib &#8220;gdi32&#8221; (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As Long) As Long<\/p>\n<p>\u3000\u3000Private Declare Function DeleteObject Lib &#8220;gdi32&#8221; (ByVal hObject As Long) As Long<\/p>\n<p>\u3000\u3000Private Declare Function CreateBitmap Lib &#8220;gdi32&#8221; (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long<\/p>\n<p>\u3000\u3000Private Declare Function SelectObject Lib &#8220;gdi32&#8221; (ByVal hdc As Long, ByVal hObject As Long) As Long<\/p>\n<p>\u3000\u3000Private Declare Function InvalidateRect Lib &#8220;user32&#8221; (ByVal hwnd As Long, lpRect As RECT, ByVal bErase As Long) As Long<\/p>\n<p>\u3000\u30003\u3001\u7f16\u5199\u4ee3\u7801\u5b9e\u73b0\u7a0b\u5e8f\u529f\u80fd\uff0c\u7531\u4e8e\u7248\u9762\u6240\u9650\uff0c\u5177\u4f53\u4ee3\u7801\u5c06\u653e\u5230CCE\u7f51\u7ad9(http:\/\/www.cce.com.cn)\u3002<\/p>\n<p>\u3000\u3000\u4ee5\u4e0a\u5c31\u662f\u5c4f\u5e55\u53d8\u6697\u7684\u65b9\u6cd5\u3002\u5982\u679c\u8981\u4f7f\u7a97\u4f53\u3001\u56fe\u7247\u6846\u7b49\u5bf9\u8c61\u53d8\u6697\uff0c\u53ea\u8981\u4f7f\u7a97\u4f53\u6216\u56fe\u7247\u6846\u7b49\u5bf9\u8c61\u83b7\u53d6\u53e5\u67c4\u5373\u53ef\uff0c\u4fee\u6539Command1_Click\u8fc7\u7a0b\u548cCommand2_Click\u8fc7\u7a0b\u4e2d\u7684\u4ee5\u4e0b\u8bed\u53e5\u5373\u53ef\u5b9e\u73b0\u7a97\u4f53\u53d8\u6697\u3002<\/p>\n<p>\u3000\u3000hdc5=Form1.Hdc;<\/p>\n<p>\u3000\u3000Width5=Form1.width;<\/p>\n<p>\u3000\u3000height5=Form1.height;<\/p>\n<p>\u3000\u3000ReleaseDC(Form1.hwnd,hdct)<\/p>\n<p>\u3000\u3000aa=InvalidateRect (Form1.hwnd,bottom,1)\u3002<\/p>\n<p>\u3000\u3000\u4ee5\u4e0a\u7a0b\u5e8f\u5728VB6.\u4e2d\u6587\u7248\uff0cWindwos 98 \u73af\u5883\u4e2d\u8fd0\u884c\u901a\u8fc7\u3002\u6709\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u53bb\u8bd5\u4e00\u8bd5\uff0c\u770b\u5230\u8fd9\u79cd\u6548\u679c\u662f\u4e0d\u662f\u89c9\u5f97\u5f88\u60ca\u5947\u5462!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VB\u8f85\u5bfc:\u7528VB\u5b9e\u73b0\u5c4f\u5e55\u9634\u6697\u64cd\u4f5c \u3000\u3000\u4f7f\u7528\u8fc7Windows 9x\u7684\u7528\u6237\u90fd\u5e94\u8be5\u77e5\u9053\uff0c\u5728\u5173\u95edWindows\u7cfb\u7edf\u65f6\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"content_type":[],"class_list":["post-9630","post","type-post","status-publish","format-standard","hentry","category-zzjy"],"_links":{"self":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/9630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9630"}],"version-history":[{"count":0,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/9630\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9630"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcontent_type&post=9630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}