Вверх ↑
Ответов: 1926
Рейтинг: 172
#1: 2017-10-24 23:56:19 ЛС | профиль | цитата
Просто запустите, сверните и продолжайте работать с компьютером. Через час посмотрите - что получилось. ЛКМ - сохранить в файл.


Add(MainForm,2953706,133,175)
{
Position=1
link(onCreate,4168703:doEvent1,[])
}
Add(InlineCode,10339731,112,441)
{
@Hint=#24:Глобальный перехват мыши|
EventPoints=#11:onMouseMove|13:onLButtonDown|11:onLButtonUp|13:onRButtonDown|11:onRButtonUp|11:onWheelDown|9:onWheelUp|8:onScroll|14:onX1ButtonDown|11:onX1BttonUp|14:onX2ButtonDown|11:onX2BttonUp|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|38:uses kol,Share,Debug,windows,messages;|0:|4:type|27: tagMSLLHOOKSTRUCT = record|12: pt:TPoint;|18: mouseData:dword;|14: flags:dword;|13: time:dword;|23: dwExtraInfo:^Cardinal|5: end;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|26: onMouseMove:THI_Event;|28: onLButtonDown:THI_Event;|26: onLButtonUp:THI_Event;|28: onRButtonDown:THI_Event;|26: onRButtonUp:THI_Event;|26: onWheelDown:THI_Event;|24: onWheelUp:THI_Event;|23: onScroll:THI_Event;|29: onX1ButtonDown:THI_Event;|27: onX1ButtonUp:THI_Event;|29: onX2ButtonDown:THI_Event;|27: onX2ButtonUp:THI_Event;|0:|23: constructor Create;|33: destructor Destroy; override;|0:|5: end;|0:|14:var H:THandle;|20: hac:THiAsmClass;|0:|14:implementation|0:|49:function hook(code,w,l:integer):Lresult; stdcall;|15:var str:string;|25: ll:tagMSLLHOOKSTRUCT;|15: d:LongWord;|5:begin|38: ll := tagMSLLHOOKSTRUCT(pointer(l)^);|0:|26: d := ll.mouseData shr 16;|46: if d and $8000 ‹› 0 then d := d or $FFFF0000;|0:|42: //str := Int2Str(w)+ ' ' + Int2Str(d);|10: case w of|36: 512: _hi_OnEvent(hac.onMouseMove);|38: 513: _hi_OnEvent(hac.onLButtonDown);|36: 514: _hi_OnEvent(hac.onLButtonUp);|38: 516: _hi_OnEvent(hac.onRButtonDown);|36: 517: _hi_OnEvent(hac.onRButtonUp);|36: 519: _hi_OnEvent(hac.onWheelDown);|34: 520: _hi_OnEvent(hac.onWheelUp);|45: 522: _hi_OnEvent(hac.onScroll, int2str(d));|12: 523: begin|17: case d of|44: 1: _hi_OnEvent(hac.onX1ButtonDown);|44: 2: _hi_OnEvent(hac.onX2ButtonDown);|12: end;|11: end;|12: 524: begin|17: case d of|42: 1: _hi_OnEvent(hac.onX1ButtonUp);|42: 2: _hi_OnEvent(hac.onX2ButtonUp);|12: end;|11: end;|5: end;|27: //_hi_OnEvent(hac.ev,str);|38: result := CallNextHookEx(H,code,w,l);|4:end;|0:|31:constructor THiAsmClass.Create;|5:begin|18: inherited Create;|13: hac := self;|48: H := SetWindowsHookEx(14, @hook, hInstance, 0);|82: if H = 0 then messagebox(ReadHandle,'Ошибка перехвата мыши','ERROR',mb_iconhand);|4:end;|0:|31:destructor THiAsmClass.Destroy;|5:begin|24: UnhookWindowsHookEx(H);|19: inherited Destroy;|4:end;|0:|4:end.|
link(onMouseMove,13412928:doDraw,[])
}
Add(Bitmap,3544458,420,175)
{
FillColor=16777215
Point(doCreate)
Point(HWidth)
Point(HHeight)
link(HWidth,9620391:Width,[])
link(HHeight,9620391:Height,[])
}
Add(Image,4402905,420,245)
{
Width=392
Height=272
Align=5
Color=16777215
link(onClick,14677764:doExecute,[])
link(Bitmap,2772593:Var2,[])
}
Add(TrayIcon,1392108,140,112)
{
Hint="рисо!"
link(onClick,1392108:doShow,[(184,118)(184,106)(128,106)(128,118)])
}
Add(MouseEvent,5854767,238,280)
{
}
Add(Img_Line,13412928,231,441)
{
Point(Point1)
Point(Point2)
link(onDraw,159235:doWork3,[(275,447)(275,421)(214,421)])
link(Bitmap,2772593:Var1,[(237,222)])
link(Point1,4974980:Value,[])
link(Point2,8133710:Var3,[(251,369)])
}
Add(PointXY,1280470,238,322)
{
link(X,5854767:MouseX,[])
link(Y,5854767:MouseY,[])
}
Add(Memory,4974980,238,385)
{
Point(Data)
link(Data,8133710:Var2,[])
}
Add(Hub,4168703,182,189)
{
link(onEvent1,3544458:doCreate,[])
link(onEvent2,159235:doWork1,[(214,202)])
}
Add(GetDataEx,2772593,420,217)
{
link(Data,3544458:Bitmap,[])
}
Add(GetDataEx,8133710,238,364)
{
link(Data,1280470:Point,[])
}
Add(HubEx,159235,210,385)
{
link(onEvent,4974980:doValue,[])
}
Add(Timer,12860868,371,245)
{
Interval=5000
link(onTimer,4402905:doLoad,[])
}
Add(PictureStream,6198238,518,238)
{
link(Bitmap,2772593:Var3,[(531,222)])
}
Add(SDialog,14677764,469,245)
{
Filter="bmp|*.bmp"
StartDir=""
FileName=""
link(onExecute,6198238:doSave,[])
}
Add(Screen,9620391,420,119)
{
}

У меня такой получился за пару часов:

карма: 9
1
Голосовали:ili4yov_ika