如何得到QQ中“发送消息”窗体中QQ号?(100分)

  • 主题发起人 netboy328
  • 开始时间
N

netboy328

Unregistered / Unconfirmed
GUEST, unregistred user!
如何得到QQ中“发送消息”窗体中QQ号?
 
function EnumFunc(AHwnd: THandle; AParam: Integer): Boolean; stdcall;<br>var<br>&nbsp; S: string;<br>begin<br>&nbsp; Result := True;<br>&nbsp; SetLength(S, 20);<br>&nbsp; SetLength(S, GetWindowText(AHwnd, PChar(S), 20));<br>&nbsp; if StrToIntDef(S, 0) &gt; 0 then<br>&nbsp; begin<br>&nbsp; &nbsp; ShowMessage('QQ号: ' + S);<br>&nbsp; &nbsp; Result := False;<br>&nbsp; end;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; AHwnd: THandle;<br>begin<br>&nbsp; AHwnd := FindWindow('#32770', '发送消息');<br>&nbsp; EnumChildWindows(AHwnd, @EnumFunc, 0);<br>end;<br><br>
 
语句:' &nbsp;EnumChildWindows(AHwnd, @EnumFunc, 0);'<br>为何编译没通过,提示Variable required的错误!<br><br>
 
呵呵, 就这么简单的几句话都会编译不通过? 真是奇怪了<br>我这里没有问题。
 
更简单的方法就是多用FindWindowEx找,以前我写《聊天快贴》的时候用过。<br>那个QQ的窗口包了好几层,真是麻烦。
 
顶部