T
Tipsyeye
Unregistered / Unconfirmed
GUEST, unregistred user!
我试图用sendmessage带EM_CHARFROMPOS来返回当前鼠标下字符的位置 <br>var<br> mPos:tpoint; <br> res:integer; <br> Wnd:longint; <br>begin <br> getcursorpos(mPos); <br> Wnd:=windowfrompoint(mPos); <br> res:=sendmessage(Wnd,EM_CHARFROMPOS,0,mPos);//在这里报错 <br>end <br>错误信息 <br>[Error] untMain.pas(134):Incompatible types:'Integer' and 'TPoint' <br><br>我查阅了msdn,说明中是这样定义的: <br>SendMessage( <br> (HWND) hWnd, //handle to destination window <br> EM_CHARFROMPOS, //message to send <br> (wparam) wParam, //not used;must be zero <br> (lparam) lparam //point coordinates <br> ); <br>这里第四个参数是相应的point,那为什么我的mPos不行啊,另外,我是刚从vb转向delphi的,同样的sendmessage,vb里怎么就可以呢?是不是delphi里有不同的用法呢? <br> 请帮忙看看。谢谢! <br>