用ppt制作一个随意拖动的杯子

来源:百度知道 编辑:UC知道 时间:2024/05/29 08:34:58
我想用ppt制作一个课件,我想实现这样的效果:在播放状态时,拖动杯子到画面的任意位置,不知能否实现!

能拖动。
1.新建一个ppt空白文档。
2.点击菜单:“工具——宏——宏”,出现对话框。
3.对话框中“宏名”随意写个,比如:move,再点“创建”,就进入代码模式。
4.删去所有的代码,把下面的代码全拷贝进去。

Option Explicit

Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Public Declare Function MonitorFromPoint Lib "user32.dll" (ByVal x As Long, ByVal y As Long, ByVal dwFlags As Long) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private Const SM_SCREENX = 0
Private Const SM_S