| hwd:=findwindowex(parent,0,'#32770',nil); //QQ次级窗口句柄QQ2003及以前版本没有此项. if (hwd<>0) then begin hBtn := FindwindowEX(hwd,0,nil,'回讯息(&R)'); //可以以此来证明是收到的QQ消息框. if (hBtn<>0) then begin hMemo := GetDlgItem(hwd,$00000380); //RichEdit的句柄,QQ消息就存在于此处. if (hMemo<>0) then result := hMemo; end; end; end; //得到指定句柄控件中的文本. procedure TForm1.GetText(hwd: HWND); var Ret: LongInt; |