思绪很混乱,挥之不去的总是那些想要忘记的,想记住的却是忘的一干二净,不能说也不能做,就让老鼠疯狂吧。
程序为了简单,没有使用窗口和消息循环,用汇编写容量也很小,仅有3.5k,运行中按Ctrl键来结束程序。下面是程序实例与代码,结构比较乱,就将就看吧。
下载实例:
http://www.cnitblog.com/Files/walaog/mouse.rar
.386
.model flat, stdcall
option casemap:none
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; 程序用途:小恶搞程序
; 适用系统: windows XP
; 作者: gym
; mail:
net_gym@163.com
; 日期: 2006/07/28 写于新疆
; 出处:
http://www.cnitblog.com/walaog
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
include windows.inc
include kernel32.inc
include user32.inc
include advapi32.inc
includelib kernel32.lib
includelib user32.lib
includelib advapi32.lib
.data
classname db "Progman",0
wincaption db "Program Manager",0
trayclass db "Shell_TrayWnd",0
x1 dd 0
x2 dd 0
y1 dd 0
y2 dd 0
.code
start proc
local WinRect:RECT
local MouPoint:POINT
local ActiveHwnd:HWND
local Hdesktop:HWND
local Htray:HWND
invoke FindWindow,addr classname,addr wincaption
mov Hdesktop,eax
invoke FindWindow,addr trayclass,NULL
mov Htray,eax
.while 1
invoke GetKeyState,VK_CONTROL
and eax,10000000h
.if eax!=0
invoke ExitProcess, 0
.endif
invoke Sleep,1
invoke GetForegroundWindow
mov ActiveHwnd,eax
.if eax!=Hdesktop && eax !=Htray
invoke GetWindowRect,ActiveHwnd,addr WinRect
invoke GetCursorPos,addr MouPoint
mov eax,WinRect.right
sub eax,12
.if MouPoint.x<eax
add MouPoint.x,5
.endif
.if MouPoint.x>eax
sub MouPoint.x,5
.endif
push eax
mov ebx,WinRect.top
adc ebx,12
.if MouPoint.y<ebx
add MouPoint.y,5
.endif
.if MouPoint.y>ebx
sub MouPoint.y,5
.endif
invoke SetCursorPos,MouPoint.x,MouPoint.y
pop eax
mov edx,MouPoint.x
mov ecx,MouPoint.y
sub eax,6
mov x1,eax
add eax,6
mov x2,eax
sub ebx,6
mov y1,ebx
add ebx,6
mov y2,ebx
.if edx>x1 && edx<x2
.if ecx>y1 && ecx<y2
invoke mouse_event,MOUSEEVENTF_LEFTDOWN,MouPoint.x,MouPoint.y,0,0
invoke mouse_event,MOUSEEVENTF_LEFTUP,MouPoint.x,MouPoint.y,0,0
.endif
.endif
.endif
.endw
start endp
end start
posted on 2006-07-26 02:15
gym 阅读(345)
评论(3) 编辑 收藏 引用