21,458
社区成员
发帖
与我相关
我的任务
分享
.if ax == IDC_CAPTURE ;初始状态捕获窗口左上坐标
invoke FindWindow,NULL,offset szGameTitle
mov hGame,eax
invoke GetWindowRect,hGame,addr @rect
invoke SetDlgItemInt,hWnd,IDC_POXEDIT,@rect.left,FALSE
invoke SetDlgItemInt,hWnd,IDC_POYEDIT,@rect.top,FALSE
.elseif ax == IDC_STGAME ;按开始键后,鼠标移动到指定位置,即游戏窗口的开始游戏
;invoke Sleep,1000
invoke SetCursorPos,@rect.left+654,@rect.top+574
.elseif ax == IDC_STGAME ;按开始键后,鼠标移动到指定位置,即游戏窗口的开始游戏
push eax
mov eax,654
add @rect.left,eax
mov eax,574
add @rect.top,eax
pop eax
invoke SetCursorPos,@rect.left,@rect.top
将此分支结构加法提前写出来!
我就纳闷了,为什么不能直接在SetCursorPos函数里,对参数进行加法呢?