取得鼠标位置的问题
我的这段代码是想向鼠标指向的窗口发送WM_gettext 消息,我想在我的EDit窗口显示出来怎么办啊??
Vb中像DIM Point As POINTAPI
DIM lParam As string *256这样的定义是什么意思啊?
还有Dim hwnd as long这样的定义到底是定义一个窗口柄还是长型数啊?
include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
POINT pos;
String Lparam;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
HWND hwnd;
GetCursorPos (pos);
hwnd=WindowFromPoint(pos.x,pos.y);
SendMessage(hwnd,WM_GETTEXT,255,Lparam);
Edit1->Text=Lparam;
}