'前台鼠标模拟
'dwFlags   =1 鼠标左键  =2鼠标右键  =3 鼠标中键
'zt                 =0  按下再释放  =1只按下  =2 只释放
Sub MouseClick(X as DWord, Y as DWord, dwFlags as Long, byval zt as long = 0) '
   Dim dl as DWord, d as DWord, U as DWord
   Dim A as Point
   GetCursorPos @a
   SetCursorPos x, y
   Select Case dwFlags '键
      Case 1
         d = &H2 'MOUSEEVENTF_LEFTDOWN: 表明接按下鼠标左键?
         U = &H4 'MOUSEEVENTF_LEFTUP: 表明松开鼠标左键?
      Case 2
         d = &H8 'MOUSEEVENTF_RIGHTDOWN: 表明按下鼠标右键?
         U = &H10 'MOUSEEVENTF_RIGHTUP: 表明松开鼠标右键?
      Case 3
         d = &H20 'MOUSEEVENTF_MIDDLEDOWN: 表明按下鼠标中键?
         U = &H40 'MOUSEEVENTF_MIDDLEUP: 表明松开鼠标中键?
      Case Else
   End Select
   If zt = 1 Or zt = 0 Then mouse_event d, X, Y, 0, 0
   If zt = 2 Or zt = 0 Then mouse_event U, X, Y, 0, 0
   
   SetCursorPos a.x, a.y
End Sub
