Вверх ↑
Ответов: 5227
Рейтинг: 587
#1: 2015-12-22 13:31:51 ЛС | профиль | цитата
Вот полезный IC
ищет текст под курсором (в браузере тоже работает) code_36665.txt

вариант с позиционрованием по x,y
Add(MainForm,6083612,161,112)
{
Width=477
Height=288
Point(Handle)
link(onCreate,3016103:doPopup,[(205,132)(205,160)(149,160)(149,188)])
}
Add(InlineCode,12351837,217,245)
{
WorkPoints=#5:doGet|
EventPoints=#8:onResStr|
DataPoints=#3:inX|3:inY|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|29:uses kol,windows,Share,Debug;|0:|4:type|36: IAccessible = interface(IDispatch)|46: ['{618736E0-3C3D-11CF-810C-00AA00389B71}']|48: function Get_accParent: IDispatch; safecall;|50: function Get_accChildCount: Integer; safecall;|69: function Get_accChild(varChild: OleVariant): IDispatch; safecall;|69: function Get_accName(varChild: OleVariant): WideString; safecall;|70: function Get_accValue(varChild: OleVariant): WideString; safecall;|76: function Get_accDescription(varChild: OleVariant): WideString; safecall;|69: function Get_accRole(varChild: OleVariant): OleVariant; safecall;|70: function Get_accState(varChild: OleVariant): OleVariant; safecall;|69: function Get_accHelp(varChild: OleVariant): WideString; safecall;|100: function Get_accHelpTopic(out pszHelpFile: WideString; varChild: OleVariant): Integer; safecall;|81: function Get_accKeyboardShortcut(varChild: OleVariant): WideString; safecall;|48: function Get_accFocus: OleVariant; safecall;|52: function Get_accSelection: OleVariant; safecall;|78: function Get_accDefaultAction(varChild: OleVariant): WideString; safecall;|78: procedure accSelect(flagsSelect: Integer; varChild: OleVariant); safecall;|90: procedure accLocation(out pxLeft: Integer; out pyTop: Integer; out pcxWidth: Integer; |82: out pcyHeight: Integer; varChild: OleVariant); safecall;|86: function accNavigate(navDir: Integer; varStart: OleVariant): OleVariant; safecall;|77: function accHitTest(xLeft: Integer; yTop: Integer): OleVariant; safecall;|65: procedure accDoDefaultAction(varChild: OleVariant); safecall;|85: procedure Set_accName(varChild: OleVariant; const pszName: WideString); safecall;|87: procedure Set_accValue(varChild: OleVariant; const pszValue: WideString); safecall;|53: property accParent: IDispatch read Get_accParent;|59: property accChildCount: Integer read Get_accChildCount;|73: property accChild[varChild: OleVariant]: IDispatch read Get_accChild;|90: property accName[varChild: OleVariant]: WideString read Get_accName write Set_accName;|93: property accValue[varChild: OleVariant]: WideString read Get_accValue write Set_accValue;|86: property accDescription[varChild: OleVariant]: WideString read Get_accDescription;|72: property accRole[varChild: OleVariant]: OleVariant read Get_accRole;|74: property accState[varChild: OleVariant]: OleVariant read Get_accState;|72: property accHelp[varChild: OleVariant]: WideString read Get_accHelp;|108: property accHelpTopic[out pszHelpFile: WideString; varChild: OleVariant]: Integer read Get_accHelpTopic;|96: property accKeyboardShortcut[varChild: OleVariant]: WideString read Get_accKeyboardShortcut;|52: property accFocus: OleVariant read Get_accFocus;|60: property accSelection: OleVariant read Get_accSelection;|90: property accDefaultAction[varChild: OleVariant]: WideString read Get_accDefaultAction;|6: end;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|33: onResStr,inX,inY: THI_Event;|47: procedure doGet(var dt: TData; idx: word);|0:|5: end;|1: |98:function AccessibleObjectFromPoint(Pt: TPoint; var Acc: IAccessible; var Child: Variant): HRESULT;|68: stdcall; external 'OleAcc.dll' name 'AccessibleObjectFromPoint';|0:|1: |0:|14:implementation|0:|3:var|19: OldPoint: TPoint;|0:|28:procedure THiAsmClass.doGet;|3:var|12: P: TPoint;|17: A: IAccessible;|13: V: Variant;|12: s: string;|5:begin|29: P.X := ToIntegerEvent(inX);|29: P.Y := ToIntegerEvent(inY);|52: if (P.X <> OldPoint.X) or (P.Y <> OldPoint.Y) then|7: begin|18: OldPoint := P;|57: if Succeeded(AccessibleObjectFromPoint(P, A, V)) then|9: begin|24: s := A.accName[V];|31: _hi_onEvent(onResStr, s);|39: end else _hi_onEvent(onResStr, '');|6: end;|4:end;|0:|4:end.|
link(onResStr,7735698:doText,[])
link(inX,5775252:MouseX,[])
link(inY,5775252:MouseY,[])
}
Add(Button,4443932,161,350)
{
Left=20
Top=60
Caption="Stop"
}
Add(Button,15997001,161,308)
{
Left=20
Top=30
Caption="Start"
}
Add(Memo,7735698,287,224)
{
Left=105
Top=20
Width=350
Height=220
}
Add(WinTools,3016103,161,175)
{
link(Handle,6083612:Handle,[])
}
Add(MouseEvent,5775252,217,175)
{
}
Add(Timer,6981899,161,245)
{
Interval=300
link(onTimer,12351837:doGet,[])
}


карма: 4
Мой форум - http://hiasm.bbtalk.me/ схемы, компоненты...
0
файлы: 1code_36665.txt [4.9KB] [616]