GUI移动图标

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 383, 361, 330, 191)
$Icon1 = GUICtrlCreateIcon("F:/E/17292个精品ICO图标下载(最全的图标集合)(1)/17292个精品ICO图标下载(最全的图标集合)(1)/winxp/application/Burn.ico", -1, 16, 24, 48, 48, BitOR($SS_NOTIFY,$WS_GROUP))
$Icon2 = GUICtrlCreateIcon("F:/E/17292个精品ICO图标下载(最全的图标集合)(1)/17292个精品ICO图标下载(最全的图标集合)(1)/winxp/application/Burn.ico", -1, 24, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit

 EndSwitch

If _WinAPI_GetForegroundWindow()=$Form1 Then
 Local $ckxx=WinGetPos ( $Form1),$mousezb=MouseGetPos()
       If $mousezb[0]-$ckxx[0]>$ckxx[2]/2  And   $mousezb[0]-$ckxx[0]<$ckxx[2]  And  $mousezb[1]-$ckxx[1]>20 And  $mousezb[1]-$ckxx[1]<$ckxx[3] Then
    ;MsgBox(0,"","")
    Local $tpoint = DllStructCreate("int X;int Y")
     $pos = MouseGetPos()
   DllStructSetData($tpoint, "X", $pos[0])
   DllStructSetData($tpoint, "Y", $pos[1])
    If _WinAPI_WindowFromPoint($tpoint)<>$Icon2 Then
     For $i=1 To 300 Step 1
      $mos=GUIGetCursorInfo ( $Form1)
      If $mos[4] = $Icon2 Then ExitLoop
    GUICtrlSetPos ( $Icon2,$i,-1)
    Sleep(10)
    Next
    EndIf
     EndIf

EndIf
WEnd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值