------------ Дoбавленo в 23.00:
Далее пример как с помощью функций winapi определять положение курсора для клиентской области окна.
Add(MainForm,9413013,168,28)
{
Color=-16777206
BorderStyle=0
Position=1
Point(Handle)
Point(MouseX)
Point(MouseY)
}
Add(InlineCode,4182753,168,77)
{
WorkPoints=#5:doGet|
EventPoints=#3:onX|3:onY|
DataPoints=#6:Handle|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|38:uses kol,Share,Debug,Windows,Messages;|3:var|21: pos_x:Integer = 0;|21: pos_y:Integer = 0;|3: |4:type|28: THiAsmClass = class(TDebug)|10: private|14: pos:TPoint;|3: |9: public|19: onX:THI_Event;|19: onY:THI_Event;|22: Handle:THI_Event;|49: procedure doGet(var Data:TData; index:word);|5: end;|0:|14:implementation|0:|56:procedure THiAsmClass.doGet(var Data:TData; index:word);|3:var|13: H: THandle;|5:begin|34: H := ReadInteger(Data,handle,0);|20: GetCursorPos(pos);|25: ScreenToClient(H, pos);|80: if ((pos.x >= 0) and (pos.x < 400)) and ((pos.y >= 0) and (pos.y < 300)) then|8: begin|20: pos_x := pos.x;|20: pos_y := pos.y;|7: end;|26: _hi_OnEvent(onX, pos_x);|26: _hi_OnEvent(onY, pos_y);|4:end;|0:|4:end.|
link(Handle,9413013:Handle,[])
link(onX,3644855:doText,[])
link(onY,1264290:doText,[(226,90)(226,125)])
}
Add(Timer,15923945,56,77)
{
Interval=20
link(onTimer,8523865:doEvent1,[])
}
Add(Edit,3644855,252,77)
{
Left=60
Top=20
Width=45
}
Add(Label,11053676,294,77)
{
Left=25
Top=20
Width=29
Height=17
Caption="pos x"
}
Add(Edit,1264290,252,119)
{
Left=60
Top=45
Width=45
}
Add(Label,10251844,294,119)
{
Left=25
Top=45
Width=30
Height=17
Caption="pos y"
}
Add(Edit,192306,252,161)
{
Left=60
Top=75
Width=45
}
Add(Label,10527506,294,161)
{
Left=25
Top=75
Width=29
Height=17
Caption="pos x"
}
Add(Edit,4029270,252,203)
{
Left=60
Top=100
Width=45
}
Add(Label,14478625,294,203)
{
Left=25
Top=100
Width=30
Height=17
Caption="pos y"
}
Add(Hub,8523865,105,77)
{
link(onEvent1,4182753:doGet,[])
link(onEvent2,7750041:doEvent1,[(129,90)(129,167)])
}
Add(DoData,5137350,175,161)
{
link(onEventData,192306:doText,[])
link(Data,9413013:MouseX,[])
}
Add(DoData,34187,182,203)
{
link(onEventData,4029270:doText,[])
link(Data,9413013:MouseY,[])
}
Add(Hub,7750041,140,161)
{
link(onEvent1,5137350:doData,[])
link(onEvent2,34187:doData,[(168,174)(168,209)])
}