如何得到QQ登录窗口中下拉框的内容?急!急!急!(高分送出)(200分)

  • 主题发起人 主题发起人 wz_hzb
  • 开始时间 开始时间
W

wz_hzb

Unregistered / Unconfirmed
GUEST, unregistred user!
如何用程序得到QQ登录窗口时“用户号码”下拉框中的QQ号码?急!急!急!
 
很感兴趣,但是我不知道,呵呵.
 
你想干什么?[:D][:D][:)]<br>我同事做过。。。<br>
 
如果是你自己的程序中的下拉框,要获得里面的内容能做到吗?<br>如果能,那么QQ的也不难!
 
that is easy<br>findwindow<br>findwindowex<br>getwindowtext &nbsp;or other api<br>...<br>that is enough
 
找出QQ下拉框的HANDLE 然后向之发消息就OK了嘛<br>(findwindow、findwindowex、getwindowtext...)<br>旧资料中也有相关资料的....
 
下拉框是ComboBox类型控件,查一下winapi资料,用sendmessage可以逐条取出它的item。<br><br>参考:<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=758599<br><br>还不行,mail me。<br>
 
查QQ目录,一个用户一个目录的。
 
怎么一个有用的也没有啊
 
大家好!<br>我的代码是这样的,假设hFocus已经取得:<br><br>GetWindowText(hFocus,szTitle,256); &nbsp;//此行能取得窗口标题<br>HWND hComboBox;<br>hComboBox=FindWindowEx(hFocus,0,"ComboBox",NULL);<br>if (hComboBox!=NULL)  //跟踪到此行时hComboBox不为NULL<br>{<br>&nbsp; &nbsp;char szLoginName[256];<br>&nbsp; &nbsp;GetWindowText(hComboBox,szLoginName,256);  //是不是这里有问题?<br>}<br>:结果szLoginName为空,为什么?<br><br><br>
 
to nunimao:你的EMAIL是地址?
 
取得目录,逐条读出,嘻嘻。<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; s:TstringList;<br>&nbsp; i:Integer;<br>begin<br>&nbsp; s:=TstringList.Create();<br>&nbsp; ReadDirectoryNames('C:/program files/Tencent',s);<br>&nbsp; for i:=0 to s.Count-1 do<br>&nbsp; &nbsp; if AnsiLastChar(s)^ in ['0'..'9'] then<br><br>&nbsp; &nbsp; &nbsp;showmessage(s);<br>&nbsp; &nbsp; &nbsp;<br><br>end;<br>function SlashSep(const Path, S: String): String;<br>begin<br>&nbsp; if AnsiLastChar(Path)^ &lt;&gt; '/' then<br>&nbsp; &nbsp; Result := Path + '/' + S<br>&nbsp; else<br>&nbsp; &nbsp; Result := Path + S;<br>end;<br>function Tform1.ReadDirectoryNames(const ParentDirectory: string;<br>&nbsp; DirectoryList: TStringList): Integer;<br>var<br>&nbsp; Status: Integer;<br>&nbsp; SearchRec: TSearchRec;<br>begin<br>&nbsp; Result := 0;<br>&nbsp; Status := FindFirst(SlashSep(ParentDirectory, '*.*'), faDirectory, SearchRec);<br>&nbsp; try<br>&nbsp; &nbsp; while Status = 0 do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; if (SearchRec.Attr and faDirectory = faDirectory) then<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; if (SearchRec.Name &lt;&gt; '.') and (SearchRec.Name &lt;&gt; '..') then<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DirectoryList.Add(SearchRec.Name);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Inc(Result);<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; Status := FindNext(SearchRec);<br>&nbsp; &nbsp; end;<br>&nbsp; finally<br>&nbsp; &nbsp; FindClose(SearchRec);<br>&nbsp; end;<br>end;<br>
 
重复一下<br>查QQ目录,一个用户一个目录的。<br>
 
我记得qq目录中有一个文件里面有登陆过的qq的号码,好像在dat目录里面,我用记事本打开过<br>,不知道你能不能取到这个文件里面,呵呵~~~~~~~~~
 
补充一下,c:/program files/tencent是你的QQ目录.里面的那些数字目录是曾经登录过的<br>号码.
 
不要想得太复杂。<br>dat目录里有oicq2000.cfg文件,里面有相关信息。<br>
 
哈哈,楼上所言及是,只是一开始没有找到那个文件就想多了.
 
不好意思,开始提问题时我没说清楚,取QQ的用户号只是我举的一个例子而以,<br>我还想用程序取其它应用程序窗口的组合框信息,至于你们说的取目录之类并非我的本意。<br>请大家继续给我帮助,谢谢!
 
其实你有空看看帮助早就出来了:<br>在FORM上放一EDIT,再加一MEMO,EDIT里输入ComboBOX的Handle,点Button1就把里面的<br>Item取出来了!<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; CBHandle: THandle;<br>&nbsp; Count, I: Integer;<br>&nbsp; S: string;<br>begin<br>&nbsp; CBHandle := StrToInt(Edit1.Text);<br>&nbsp; SetLength(S, 255);<br>&nbsp; Count := SendMessage(CBHandle, CB_GETCOUNT, 0, 0);<br>&nbsp; for I := 0 to Count - 1 do<br>&nbsp; begin<br>&nbsp; &nbsp; SendMessage(CBHandle, CB_GETLBTEXT, I, Integer(Pointer(S)));<br>&nbsp; &nbsp; Memo1.Lines.Add(Trim(S));<br>&nbsp; end;<br>end;<br><br>
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部