{"id":1684,"date":"2024-08-19T08:00:00","date_gmt":"2024-08-19T00:00:00","guid":{"rendered":"http:\/\/www.wyrcad.com\/?p=1684"},"modified":"2024-08-19T10:00:51","modified_gmt":"2024-08-19T02:00:51","slug":"%e6%8b%96%e5%8a%a8%e7%aa%97%e4%bd%93","status":"publish","type":"post","link":"https:\/\/www.wyrcad.com\/?p=1684","title":{"rendered":"\u62d6\u52a8\u7a97\u4f53"},"content":{"rendered":"\n<p>Option Explicit<br>Private Declare Function GetCursorPos Lib &#8220;user32&#8221; (lpPoint As POINTAPI) As Long<br>Private Type POINTAPI<br>X As Long<br>Y As Long<br>End Type<br>Dim bMoveForm As Boolean, LastPoint As POINTAPI<\/p>\n\n\n\n<p>Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)<br>Dim POINT As POINTAPI<br>GetCursorPos POINT<br>LastPoint.X = POINT.X<br>LastPoint.Y = POINT.Y<br>bMoveForm = True<br>End Sub<\/p>\n\n\n\n<p>Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)<br>Dim iDX As Long, iDY As Long<br>Dim iTPPX As Long, iTPPY As Long<br>iTPPX&amp; = Screen.TwipsPerPixelX<br>iTPPY&amp; = Screen.TwipsPerPixelY<br>Dim POINT As POINTAPI<br>If Not bMoveForm Then Exit Sub<br>GetCursorPos POINT<br>iDX&amp; = (POINT.X &#8211; LastPoint.X) * iTPPX&amp;<br>iDY&amp; = (POINT.Y &#8211; LastPoint.Y) * iTPPY&amp;<br>LastPoint.X = POINT.X<br>LastPoint.Y = POINT.Y<br>Me.Move Me.Left + iDX&amp;, Me.Top + iDY&amp;<br>End Sub<\/p>\n\n\n\n<p>Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)<br>bMoveForm = False<br>End Sub<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Option ExplicitPrivate Declare Function GetCursorPos Li &hellip; <a href=\"https:\/\/www.wyrcad.com\/?p=1684\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u62d6\u52a8\u7a97\u4f53\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[24,17],"class_list":["post-1684","post","type-post","status-publish","format-standard","hentry","category-bianchengyuandi","tag-vb","tag-biancheng"],"_links":{"self":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1684"}],"version-history":[{"count":1,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1684\/revisions"}],"predecessor-version":[{"id":1685,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1684\/revisions\/1685"}],"wp:attachment":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}