免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
關(guān)于delphiwebbrowser二次點(diǎn)擊來路問題

webbrowser二次點(diǎn)擊webb可以實(shí)現(xiàn)二次點(diǎn)擊但是二次點(diǎn)擊的來路為空。這里先說明一下為什么是沒有來路的。
二次點(diǎn)擊的代碼本質(zhì)是2個(gè)內(nèi)置瀏覽器webbrowser,webb1點(diǎn)擊的網(wǎng)頁(yè)的時(shí)候把新打開的網(wǎng)頁(yè)地址賦值給webb2去打開。就相當(dāng)于webb是從新打開了一個(gè)新的地址,來路當(dāng)然是空的。下面的代碼附上解決的辦法。

代碼比較長(zhǎng) 我把關(guān)鍵的地方標(biāo)注一下
var
  curUrl:string;///定義的地址變量
implementation
{$R *.dfm}
procedure TForm1.EmbeddedWB1NewWindow3(ASender: TObject;
  var ppDisp: IDispatch; var Cancel: WordBool; dwFlags: Cardinal;
  const bstrUrlContext, bstrUrl: WideString);
begin
  Cancel := True;
  curUrl:=bstrUrl;///這里是解決2次來路不統(tǒng)一的地方
  self.Timer12.Interval:=100;
  self.Timer12.Enabled:=true;
end;

procedure TForm1.Timer12Timer(Sender: TObject);
begin
  self.Timer12.Enabled:=false;
  MyNavigate (curUrl);////這里比較關(guān)鍵
end;

procedure TForm1.Button3Click(Sender: TObject);
begin

 DelCookie;
  DeleteIECache;
swzjl := EmbeddedWB1.LocationURL;
  if swzjl <> swz then
  begin
    timer5.Enabled := true;
  end;
  if swzjl = swz then
  begin
    timer6.Enabled := true;
  end;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
  self.Timer11.Enabled:=true;
  self.Timer13.Interval:=5000;  //停留等鼠標(biāo)移動(dòng)幾秒后,開始點(diǎn)擊///////////////////////////////////////////////////////////////
  self.Timer13.Enabled:=true;
end;

procedure TForm1.MyNavigate(url: string);
var
  Flags, Headers, TargetFrameName, PostData: OLEVariant;
begin
  Flags := ”;
  TargetFrameName := ”;
  PostData := ”;
  EmbeddedWB1.Stop;//這是設(shè)置來路的函數(shù)
  Headers := ‘Referer:’+self.EmbeddedWB1.LocationURL+#10#13;
  EmbeddedWB1.Navigate(url,Flags, TargetFrameName, PostData, Headers);
end;

procedure TForm1.CloseSound;
var
  hDSound: Cardinal;
  pDirectSoundCreate: Pointer;
  hWinmm: Cardinal;
  pmidiStreamOpen: Pointer;
  pwaveOutWrite: Pointer;
  lp: Cardinal;
begin
  try
    hDSound := LoadLibrary(‘DSound.dll’);
    if hDSound > 0 then
      pDirectSoundCreate := GetProcAddress(hDSound, ‘DirectSoundCreate’);
    if pDirectSoundCreate <> nil then
    begin
      VirtualProtect(pDirectSoundCreate, 3, PAGE_EXECUTE_READWRITE, lp);
      Move(#$C2#$0C#$00, pDirectSoundCreate^, 3);
    end;

    hWinmm := LoadLibrary(‘Winmm.dll’);
    if hWinmm > 0 then
      pmidiStreamOpen := GetProcAddress(hWinmm, ‘midiStreamOpen’);
    if pmidiStreamOpen <> nil then
    begin
      VirtualProtect(pmidiStreamOpen, 3, PAGE_EXECUTE_READWRITE, lp);
      Move(#$C2#$04#$00, pmidiStreamOpen^, 3);
    end;

    if hWinmm > 0 then
      pwaveOutWrite := GetProcAddress(hWinmm, ‘waveOutWrite’);
    if pwaveOutWrite <> nil then
    begin
      VirtualProtect(pwaveOutWrite, 3, PAGE_EXECUTE_READWRITE, lp);
      Move(#$C2#$0C#$00, pwaveOutWrite^, 3);
    end;
  except
  end;
end;

procedure TForm1.EmbeddedWB1NavigateComplete2(ASender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);
var
  Doc2:IHTMLDocument2;
begin
  Doc2:=EmbeddedWB1.Document as IHTMLDocument2;
  Doc2.parentWindow.execScript(‘function open(){return;}’,'Javascript’);
  Doc2.parentWindow.execScript(‘function alert(){return;}’,'Javascript’);
  Doc2.parentWindow.execScript(‘function confirm(){return;}’,'Javascript’);
  Doc2.parentWindow.execScript(‘function showModalDialog(){return;}’,'Javascript’);
  Doc2.parentWindow.execScript(‘function attachEvent(){return;}’,'Javascript’); //禁止動(dòng)態(tài)添加事件
  Doc2.parentWindow.execScript(‘function document.createElement(){return;}’,'Javascript’);//禁止動(dòng)態(tài)創(chuàng)建
end;
function TForm1.EmbeddedWB1ShowMessage(Sender: TObject; HWND: Cardinal;
  lpstrText, lpstrCaption: PWideChar; dwType: Integer;
  lpstrHelpFile: PWideChar; dwHelpContext: Integer;
  var plResult: Integer): HRESULT;
begin
  result:=s_OK;     //禁止彈出各種腳本對(duì)話框
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
  //self.EmbeddedWB1.Navigate(‘http://www.jlrenti.com/html/ribenrentiyishu/200912/03-1095.html’);
self.EmbeddedWB1.Navigate(‘http://180.123.89.103/’);
  DeleteIECache;
end;

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
如何用彈出窗口顯示進(jìn)度
不用hook,取得QQ密碼
【轉(zhuǎn)】怎么檢測(cè)用戶多長(zhǎng)時(shí)間沒有鼠標(biāo)與鍵盤操作
Delphi 7 中的隨機(jī)函數(shù)
Cookies 修改
如何用Delphi在TWebBrowser中調(diào)用JavaScript
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服