调用dll实现软件里水波荡漾的效果
By
admin
at 2019-02-23 • 0人收藏 • 1868人看过
import win.ui; /*DSG{{*/ mainForm = win.form(text="水波荡漾效果展示";right=675;bottom=509;image=$"C:\Users\popdes\Desktop\固态说明.jpg";bgcolor=15780518) mainForm.add() /*}}*/ var dll = ..raw.loadDll("\res\WaterDll.dll"); WaterInit = dll.api("WaterInit","int(INT bitmap)" ) WaterMouseAction = dll.api("WaterMouseAction","int(int hdc,int sx,int sy,int mx,int my,int half,int deep)" ) WaterTimer = dll.api("WaterTimer","int(int hdc,int sx,int sy)" ) WaterInit(tonumber(mainForm.image)); mainForm.wndproc = function(hwnd,message,wParam,lParam){ select( message ) { case 0x200/*_WM_MOUSEMOVE*/{ //鼠标右键弹起,下面获取坐标 var x,y = win.getMessagePos(lParam); WaterMouseAction(tonumber(::GetWindowDC(mainForm.hwnd)),10,10,x,y,5,80); } case 0x201/*_WM_LBUTTONDOWN*/{ var x,y = win.getMessagePos(lParam); WaterMouseAction(tonumber(::GetWindowDC(mainForm.hwnd)),10,10,x,y,60,500); } else{ } } //无返回值则继续调用默认回调函数 } tmid = mainForm.addtimer( 10/*毫秒*/, function(hwnd,msg,id,tick){//定时执行代码 WaterTimer(tonumber(::GetWindowDC(mainForm.hwnd)),10,10); } ); mainForm.show(); return win.loopMessage();
从vb的论坛里看到的这个dll , 完整工程下载地址:
链接:https://pan.baidu.com/s/1tAT3xZ7X0UEycJg6sT_4EA
提取码:aoji
登录后方可回帖