*****五星级问题***** 用ShellExecute 打开一个IE页面后,IE成了被激活的窗体了,如何在程序中打开一个IE连接后,让程序仍然保持激活状态。愁啊,兄弟们! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你在ShellExecute 之后,加上下面的代码:SetForegroundWindow(Handle); procedure TForm1.Button1Click(Sender: TObject);begin ShellExecute(self.Handle,'open','http://community.csdn.net/Expert/topic/4692/4692400.xml?temp=.702984','','',SW_SHOWNOACTIVATE); BringToFront;end; procedure SwitchToThisWindow(h1: hWnd; x: bool); stdcall; external user32 Name 'SwitchToThisWindow'; {x = false: Size unchanged, x = true: normal size}procedure TForm1.Button2Click(Sender: TObject);begin ShellExecute(....... ... Application.ProcessMessage; SwitchToThisWindow(FindWindow('notepad', nil), True);end; SwitchToThisWindow(Application.Handle, true); handle: THandle;begin ShellExecute(Handle,'open',pchar('http://mail.tom.com'), '','',SW_SHOWNOACTIVATE); handle := GetActiveWindow; sleep(1000); //handle := GetForegroundWindow; SetForegroundWindow(handle);我搞定了。谢谢各位了 to:aiirii(ari-http://spaces.msn.com/members/aiirii/)这个函数是API嘛,我怎么无法使用呢? excelquerytable控件使用 edit怎么样判断扫描枪扫描还是键盘输入。(100分相送) idhttp组件问题? 各位大侠帮帮忙呀很简单的一个问题. speedbutton问题 如何防止单元间的循环引用? 从数据库读取图片呀为何看不见呀急呀 关于COM+提交数据时的事务问题。分不够可再开贴。 创建VCL出现的问题:动态创建的对象不能动态赋给事件,请高手相助。 delphi怎样禁止IE修改收藏夹??? delphi可以实现类似oa这样的公文流转的功能吗? 有谁装过crystal report 9.2
SetForegroundWindow(Handle);
begin
ShellExecute(self.Handle,'open','http://community.csdn.net/Expert/topic/4692/4692400.xml?temp=.702984','','',SW_SHOWNOACTIVATE);
BringToFront;
end;
external user32 Name 'SwitchToThisWindow';
{x = false: Size unchanged, x = true: normal size}
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(.......
... Application.ProcessMessage; SwitchToThisWindow(FindWindow('notepad', nil), True);
end;
begin
ShellExecute(Handle,'open',pchar('http://mail.tom.com'), '','',SW_SHOWNOACTIVATE); handle := GetActiveWindow; sleep(1000);
//handle := GetForegroundWindow;
SetForegroundWindow(handle);
我搞定了。谢谢各位了
这个函数是API嘛,我怎么无法使用呢?