当前位置:主页>销售管理软件> 列表

如何使得QQ用SOCKS5代理上网(取得窗口句柄) 找免费财务软件

库存管理软件版1楼: QQ2005正式版登录时,可以选择用代理上网..分别是


<使用浏览器设置>
我想得到这个Combobox的句柄..可是用了好多方法都是不行的

主要的目的是自动用代理来上QQ...

2楼: 这个功能相信要的代码不是很多,请大家先自己测试好再发上来代码..
因为我一般的方法也用过了.. 如免费财务软件

3楼: 奇怪了..EnumChildWindows能得到子窗口是EDIT类的Caption..但得不到Combobox类的

4楼: 已得到句柄..现在的问题可以改为
怎么让这个Combobox自动的把itemindex改为序号1?

5楼: 还要能触发这个Combobox的change事件...

6楼: 晕!! 自己搞定了..怎么办啊..我想收回..[:(]

库存管理软件版7楼: [:)]以下是没有整理过的代码..已经可以运行~!

procedure TForm1.Timer2Timer(Sender: TObject);
var WinampHandle,tmpHandle,tmpHandle1:integer;
s,s1,s2:string;
h: integer;
add,port,other:string;
h1, hFocus : Hwnd;
textmaxlength:integer;

textcontent: array[0..20] of Char;
Buffer: array[0..20] of Char;


Buffer1: array[0..120] of Char;
begin
timer2.Enabled:=false;
try
Winlist.Clear;

Combobox:=0;
// timer2.Enabled:=false;
s := ''192.168.1.1'';
s1 := ''1080'';
s2:= ''请重输密码'';
WinampHandle:=FindWindow( nil,''QQ用户登录'');
tmpHandle1:=FindWindowEx(WinampHandle,0, nil,''高级设置↓'');
if (WinampHandle=0) or (tmpHandle1=0) then exit;

if AttachThreadInput(GetCurrentThreadId, GetWindowThreadProcessId(GetForegroundWindow(), nil), TRUE) then
begin
hFocus := GetFocus();
// label2.Caption:= inttostr(hFocus);
h1:= GetParent(hFocus);
GetClassName(h1, Buffer, 20);
GetWindowText(h1, Buffer1, 120);

// label1.Caption:=strpas(Buffer);
// label3.Caption:=strpas(Buffer1);

if strpas(Buffer)=''ComboBox'' then
begin
OK:= true;
sleep(2000);
end;
AttachThreadInput(GetCurrentThreadId, GetWindowThreadProcessId(GetForegroundWindow(), nil), False)


end
else exit;
if (strpas(Buffer)=''#32770'') and (strpas(Buffer1)='''') and (OK) then
begin


windows.SetFocus(tmpHandle1);
sleep(200);
OK:=false;

SendMessage(tmpHandle1,WM_LBUTTONDOWN,MK_LBUTTON,0);
SendMessage(tmpHandle1,WM_LBUTTONUP,MK_LBUTTON,0);
i:= tmpHandle1;
tmpHandle:=WinampHandle;
EnumChildWindows(tmpHandle,@GeteditHandle,Integer(@tmpHandle));

h:=Winlist.IndexOf(inttostr(tmpHandle));
add:=Winlist[h+2];
port:=Winlist[h+3];
other:= Winlist[h+4];

if isWindowEnabled(strtoint(add)) then
begin
showwindow(tmpHandle,0);
showwindow(strtoint(add),0);
showwindow(strtoint(port),0);
exit;
end;


enablewindow(tmpHandle1,false);


// edit2.Text:=add;
// SendMessage(strtoint(add),WM_GETTEXT,textmaxlength,lparam(@textcontent));
GetWindowText(tmpHandle,textcontent,100);
caption:=strpas(textcontent);
// edit1.Text:=strpas(textcontent);


// if strpas(textcontent)='''' then
begin
// PostMessage(tmpHandle, WM_KEYDOWN, VK_DOWN , 0);
// PostMessage(tmpHandle, WM_KEYUP, VK_DOWN , 0);
PostMessage(tmpHandle, WM_KEYDOWN, VK_DOWN , 0);
PostMessage(tmpHandle, WM_KEYUP, VK_DOWN , 0);

enablewindow(tmpHandle,false);
enablewindow(strtoint(add),false);
enablewindow(strtoint(port),false);

showwindow(tmpHandle,0);
showwindow(strtoint(add),0);
showwindow(strtoint(port),0);

sleep(200);
PostMessage(strtoint(add), WM_KEYDOWN, VK_TAB , 0);
PostMessage(strtoint(add), WM_KEYUP, VK_TAB , 0);

SendMessage(strtoint(add), wm_SetText, 0, integer(pchar(s)));
SendMessage(strtoint(port), wm_SetText, 0, integer(pchar(s1)));

showwindow(tmpHandle,1);
showwindow(strtoint(add),1);
showwindow(strtoint(port),1);

enablewindow(tmpHandle,false);
enablewindow(strtoint(add),false);
enablewindow(strtoint(port),false);

SendMessage(tmpHandle1, wm_SetText, 0, integer(pchar(s2)));
timer3.Enabled:=true;
windows.SetFocus(strtoint(other));

// showmessage(''请注意,转换代理上网成功...''+#13#10+''QQ密码请重输!有问题可找网管'');
end;
end;


// timer3.Enabled:=true;
finally
timer2.Enabled:=true;
end;

end;