delphi超高分求助。toolbar的按钮点击后弹出的下浮窗口按钮模拟点击。 请教大家一个问题.一个delphi的toolbar的按钮点击后弹出的按钮,我想在其它软件中模拟点击一下它.怎么解决呢?不用模拟鼠标坐标的方式,(据说这个没有句柄消息的).但是我就是想点击它,请问有其它解决办法,一定有办法。谢谢大家! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用findwindow和findwindowex找到toolbutton的handle,然后可以如下: procedure TForm1.Button2Click(Sender: TObject); var r: TRect; h: THandle; begin h:= findwindow(...); h:= findwindowex(...); .. .. GetWindowRect(h,r); SetCursorPos(r.Left+5,r.Top+5); mouse_event(MOUSEEVENTF_LEFTDOWN,r.Left+5,r.Top+5,0,0); mouse_event(MOUSEEVENTF_LEFTUP,r.Left+5,r.Top+5,0,0); end;sendmessage就行了,TToolBar(obj).Buttons[0].Click也行,但是要写dll并注入目标进程 能给个实列吗? 我用您的方法。还是点击不了。unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, ToolWin, Menus;type Ttestexe = class(TForm) ToolBar1: TToolBar; PopupMenu1: TPopupMenu; ToolButton1: TToolButton; s11: TMenuItem; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var testexe: Ttestexe;implementation{$R *.dfm}procedure Ttestexe.FormCreate(Sender: TObject);beginend;end. http://topic.csdn.net/t/20021121/14/1194556.html你到这里看看吧,反正思路是找到按钮的句柄,然后sendmessage 组件的数组属性怎么让它能下拉? 哪位高人能告诉我delphi中所有类型的基类是什么吗? ***** 高手们来一下,请教一个数据库字段进数组的问题****** 关于三层结构疑问。 急,stringgrid的一个问题 為什么能Preview,卻不能Print. csdn升级后的问题 进存销问题 谁知道哪里有关于输入法的编程介绍,如果你知道,请告知 dbgrid显示 谁能详细点给我解释下 下面的各个语句的意思!!!! 关于delphi调用word的问题
procedure TForm1.Button2Click(Sender: TObject);
var
r: TRect;
h: THandle;
begin
h:= findwindow(...);
h:= findwindowex(...);
..
..
GetWindowRect(h,r);
SetCursorPos(r.Left+5,r.Top+5);
mouse_event(MOUSEEVENTF_LEFTDOWN,r.Left+5,r.Top+5,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,r.Left+5,r.Top+5,0,0);
end;
sendmessage就行了,TToolBar(obj).Buttons[0].Click也行,但是要写dll并注入目标进程
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, Menus;type
Ttestexe = class(TForm)
ToolBar1: TToolBar;
PopupMenu1: TPopupMenu;
ToolButton1: TToolButton;
s11: TMenuItem;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
testexe: Ttestexe;implementation{$R *.dfm}procedure Ttestexe.FormCreate(Sender: TObject);
beginend;end.
你到这里看看吧,反正思路是找到按钮的句柄,然后sendmessage