我想在delphi里用代码调用.
哪位可以给出对应的api什么的
谢谢~~~~~~~~

解决方案 »

  1.   

    WebBrowser1.ExecWB(OLECMDID_SAVEAS, 0);就可以实现了,但是用save就没有效果,哎,这个我也没仔细研究。
    另外通过ie接口也可以实现,不过比较繁琐,也就不多说了!
      

  2.   

    我没说明白,对不起,
    我想用的是 ie中鼠标移到 URL上时点击右键出来的"目标另存为"的那个另存为
    谢谢了,不知道它的OLECMDID是什么,
    谢谢谢谢谢浪哥.......HELP~~~~!!!!!!
      

  3.   

    呵呵,理解错了,
    这个可以通过ie接口+菜单shell扩展相关的东西实现,我很久没做了,
    等我看看msdn,在给你代码!
      

  4.   

    提个思路给你(太麻烦,我太懒,就不写了 *^_^* ):
    你通过Ihtmldocument2(通过webbrowser.document可以query到)接口的onmousedown事件得到点击的link的接口IhtmlLinkElement,通过这个接口得到点击的link的url,然后再创建一个隐藏的webbrowser去navigate这个url,相应它的OnDocumentComplete事件,在这个事件处理汉书中调用我上面提到的方法就可以保存了。
    我想这不是最好的办法,ie接口里面肯定有相关接口,可是ie借口太多太复杂了,我一时也找不到,只能通过这种办法,我估计应该能行得通。
    good luck
    希望有高手能更好的解决一下了:)
      

  5.   

    我现在有别的方法得到url,
    我是想直接用它的那个下载对话框下载,懒的在做.
    不知道该怎样去查ie的接口呢?
    (不如教我怎样钓鱼先~~~~~~~~~~~~:)
      

  6.   

    浪哥,哪里去查ie接口?
    怎样query document?
      

  7.   

    msdn上查找了
    (webbrowser1。document as Ihtmldocument2)就可以得到接口了,并通过这个基本接口得到别的接口!记得包含mshtml。
      

  8.   

    一群笨蛋,如果你要用webbrowser保存用以下这个代码!
    webbrowser.ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DODEFAULT, EmptyParam,emptyParam);
      

  9.   

    不要乱说话,要说说我可以不要说浪哥!
    前面说了知道怎么用webbrowser了,
    现在是不要用webbrowser!浪哥,我就是不会用接口啊............
    该看哪方面的书呢?
      

  10.   

    webbrowser1。document as Ihtmldocument2
    如果这样用webbrowser不是就要下载页面?
    可以不让webbrowser下载页面吗?
      

  11.   

    to delphiplayer() :
     什么叫做一群笨蛋,自己看看前面的留言,你自己就明白了!:)
      

  12.   

    to  upchina(辉) :
    接口方面你得看com/activex方面的东西了哦!
      

  13.   

    试试保存网页地址吧!function DownloadFile(SourceFile, DestFile: string): Boolean; 
    begin 
      try 
        Result := UrlDownloadToFile(nil, PChar(SourceFile), 
                      PChar(DestFile), 0, nil) = 0; 
      except 
        Result := False; 
      end; 
    end; 
      

  14.   

    我现在就是用的楼上的楼上的那个urld......
    但是这个没有IE里的那个提示啊,下载一个大文件的话就定在那里了...:(还是IE那个好啊.....真想拿来就用,不知道上哪拿去.......唉.刚买了一套MSDN,3张盘的.研究中...........................................
      

  15.   

    我问外国人,他说和shell有关............
    可是shell不就那几个read,open,...命令吗?
    还有msdn没有说明的命令吗?
    ....?
      

  16.   

    我给你个思路,可以最简单实现:
    1. 用shellexec 打开你的url, 这时会进入ie, 调出页面
    2. 向ie发消息,控制ie的menu, 让它选中 file, 再选中 save as
    3. 现在就出现你要的对话框了
      

  17.   

    这个过程使用WEBBROWSER就可以实现啊.
      

  18.   

    用GetSaveFileName()MSDN解释如下:GetSaveFileName
    The GetSaveFileName function creates a Save common dialog box that lets the user specify the drive, directory, and name of a file to save. BOOL GetSaveFileName(
      LPOPENFILENAME lpofn   // address of structure with initialization 
                             // data
    );
     
    Parameters
    lpofn 
    Pointer to an OPENFILENAME structure that contains information used to initialize the dialog box. When GetSaveFileName returns, this structure contains information about the user's file selection. 
      

  19.   

    其中的 OPENFILENAME structure是:OPENFILENAME
    The OPENFILENAME structure contains information that the GetOpenFileName and GetSaveFileName functions use to initialize an Open or Save As common dialog box. After the user closes the dialog box, the system returns information about the user's selection in this structure. typedef struct tagOFN { // ofn 
        DWORD         lStructSize; 
        HWND          hwndOwner; 
        HINSTANCE     hInstance; 
        LPCTSTR       lpstrFilter; 
        LPTSTR        lpstrCustomFilter; 
        DWORD         nMaxCustFilter; 
        DWORD         nFilterIndex; 
        LPTSTR        lpstrFile; 
        DWORD         nMaxFile; 
        LPTSTR        lpstrFileTitle; 
        DWORD         nMaxFileTitle; 
        LPCTSTR       lpstrInitialDir; 
        LPCTSTR       lpstrTitle; 
        DWORD         Flags; 
        WORD          nFileOffset; 
        WORD          nFileExtension; 
        LPCTSTR       lpstrDefExt; 
        DWORD         lCustData; 
        LPOFNHOOKPROC lpfnHook; 
        LPCTSTR       lpTemplateName; 
    } OPENFILENAME; 
     
      

  20.   

    WebBrowser1.ExecWB(OLECMDID_SAVEAS, 0);MFC HtmlView.ExecWB(OLECMDID_SAVEAS, 0);