我做了一个和IE一样的浏览器(注意是IE,不是腾训那种多页面的)
可是在打开一个新页面的时候不知道怎么写了(不能用create(self)),求助解决办法!还有我不知道如何实现像IE一样打开历史栏的功能!大家帮忙,谢谢!!!
可是在打开一个新页面的时候不知道怎么写了(不能用create(self)),求助解决办法!还有我不知道如何实现像IE一样打开历史栏的功能!大家帮忙,谢谢!!!
解决方案 »
- BCB过来求救:在条码机上打印条码,可是从来没有弄过。求救思路或者源代码!急!!!
- 在DLL中如何HOOK加载该DLL的应用程序的消息
- WebBrowser问题
- 关于ClientSocket&ServerSocket的问题,请大家帮忙!
- 想找一个学Delphi的老师
- 问题:如何实现ClientSocket连接多个ServerSocket??
- Access violation at address 0047BCCC6 in module 'prj1.exe'.Read of address 00000
- ========出100分,请各位顺手帮忙,简单却常用的问题。=======
- 菜青虫的困难,大伙帮忙!
- 是DELPHI的BUG吗?
- 如何在paradox表中导入或导出文本文件?谢谢
- 问个最基本的问题,关于memo和treeview控件
如果创造一个新的进程且不用onnewwindow,那么点开新链接就会自动打开IE
var ppDisp: IDispatch; var Cancel: WordBool);
begin
Form1:=TForm1.Create(Application);
Form1.Show;
ppDisp:=Form1.WebBrowser1.ControlInterface;
end;试试,这就可以了~~~
http://www.euromind.com/iedelphi/上有很多现成控件可供学习
好象也不行
uses DdeMan,
{$IFDEF WIN32}
Registry; {We will get it from the registry}
{$ELSE}
IniFiles; {We will get it from the win.ini file}
{$ENDIF}
{$IFNDEF WIN32}
const MAX_PATH = 144;
{$ENDIF}
function GetProgramAssociation (Ext : string) : string;
var
{$IFDEF WIN32}
reg: TRegistry;
s : string;
{$ELSE}
WinIni : TIniFile;
WinIniFileName : array[0..MAX_PATH] of char;
s : string;
{$ENDIF}
begin
{$IFDEF WIN32}
s := '';
reg := TRegistry.Create;
reg.RootKey := HKEY_CLASSES_ROOT;
if reg.OpenKey('.' + ext + '\shell\open\command',
false) <> false then begin
{The open command has been found}
s := reg.ReadString('');
reg.CloseKey;
end else begin
{perhaps thier is a system file pointer}
if reg.OpenKey('.' + ext,
false) <> false then begin
s := reg.ReadString('');
reg.CloseKey;
if s <> '' then begin
{A system file pointer was found}
if reg.OpenKey(s + '\shell\open\command',
false) <> false then
{The open command has been found}
s := reg.ReadString('');
reg.CloseKey;
end;
end;
end;
{Delete any command line, quotes and spaces}
if Pos('%', s) > 0 then
Delete(s, Pos('%', s), length(s));
if ((length(s) > 0) and
(s[1] = '"')) then
Delete(s, 1, 1);
if ((length(s) > 0) and
(pos('"', s) > 0)) then
Delete(s, pos('"', s), Length(s));
while ((length(s) > 0) and
(s[length(s)] = #32)) do
Delete(s, Length(s), 1);
{$ELSE}
GetWindowsDirectory(WinIniFileName, sizeof(WinIniFileName));
StrCat(WinIniFileName, '\win.ini');
WinIni := TIniFile.Create(WinIniFileName);
s := WinIni.ReadString('Extensions',
ext,
'');
WinIni.Free;
{Delete any command line}
if Pos(' ^', s) > 0 then
Delete(s, Pos(' ^', s), length(s));
{$ENDIF}
result := s;
end;procedure StartNewBrowserWindow(URL : string);
var
DDEConv : TDDEClientConv;
URLFired : bool;
App : string;
UpApp : string;
p : array[0..MAX_PATH] of char;
begin
UrlFired := false;
App := GetProgramAssociation('HTM');
UpApp := Uppercase(App);
Delete(App, Pos('.EXE', UpAPP), length(App));
if Pos('NETSCAPE.EXE',
UpApp) > 0 then begin
DDEConv:=TDDEClientConv.Create(nil);
DDEConv.ServiceApplication := App;
if DDEConv.SetLink('NETSCAPE' , 'WWW_OpenURL') then
if DDEConv.RequestData(URL +
',,0x0,0x0') <> nil then
if DDEConv.SetLink('NETSCAPE', 'WWW_Activate') then
URLFired := DDEConv.RequestData('0xFFFFFFFF,0x0') <> nil;
DDEConv.Free;
end else
if Pos('IEXPLORE.EXE',
UpApp) > 0 then begin
DDEConv:=TDDEClientConv.Create(nil);
DDEConv.ServiceApplication := App;
if DDEConv.SetLink('iexplore', 'WWW_OpenURL') then
if DDEConv.RequestData(URL + ',,0') <> nil then
if DDEConv.SetLink('iexplore', 'WWW_Activate') then
URLFired := DDEConv.RequestData('0,0') <> nil;
DDEConv.Free;
end;
if UrlFired = false then
WinExec(StrPCopy(@p, URL), SW_SHOWNORMAL);
end;procedure TForm1.Button1Click(Sender: TObject);
begin
StartNewBrowserWindow('http://www.borland.com');
StartNewBrowserWindow('http://www.yahoo.com');
end;