By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,919 Members | 1,587 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,919 IT Pros & Developers. It's quick & easy.

bho for ie6 tutorial in vb6

P: 3
i want to write a bho for ie6 using vb6 which can save a particular image,which when right clicked and select an option,in webpage to local harddisk.
i serched a lot,but was nt able to see simple and step by step explaining tutorials,PLEASE GUIDE ME
Jan 23 '08 #1
Share this Question
Share on Google+
4 Replies


P: 58
Here's a start.

http://www.vbaexpress.com/forum/printthread.php?t=578

Expand|Select|Wrap|Line Numbers
  1. Sub Main()
  2.    Dim IE As Object, item As Variant
  3.    Dim web_site As String, path_name As String, file_name As String
  4.  
  5.    web_site = "http://www.yahoo.com"
  6.    path_name = "C:\Documents and Settings\WinblowsME\Desktop\Temp\"
  7.  
  8.    Set IE = CreateObject("InternetExplorer.Application")
  9.  
  10.    With IE
  11.       .Visible = True
  12.       .Navigate web_site
  13.    End With
  14.  
  15.    Call Wait(IE)
  16.  
  17.    For Each item In IE.Document.Images
  18.       file_name = Mid(item.src, InStrRev(item.src, "/") + 1)
  19.       Call Copy_HTTP_File(item.src, path_name, file_name)
  20.    Next
  21.  
  22.    IE.Quit
  23.    Set IE = Nothing
  24. End Sub
  25.  
  26. Private Sub Copy_HTTP_File(http_file As String, path_name As String, file_name As String)
  27.    Dim win_http As Object, downloaded_bytes() As Byte
  28.  
  29.    Set win_http = CreateObject("WinHttp.WinHttpRequest.5.1")
  30.  
  31.    win_http.Open "GET", http_file, False
  32.    win_http.Send
  33.  
  34.    Open path_name & file_name For Binary As #1
  35.       downloaded_bytes() = win_http.ResponseBody
  36.       Put #1, 1, downloaded_bytes()
  37.    Close
  38.  
  39.    Set win_http = Nothing
  40. End Sub
  41.  
  42. Private Sub Wait(IE As Object)
  43.    While IE.Busy
  44.       DoEvents
  45.    Wend
  46.  
  47.    While IE.Document.ReadyState <> "complete"
  48.       DoEvents
  49.    Wend
  50. End Sub
  51.  
Jan 23 '08 #2

Expert 5K+
P: 8,434
What is a bho?

Anyway, isn't that save-image functionality already built into IE?
Jan 24 '08 #3

kadghar
Expert 100+
P: 1,295
What is a bho?

Anyway, isn't that save-image functionality already built into IE?
A browser helper object (those anoying things that get installed in the IE when you are sleepy and click an "accept" you shouldnt), DLLs like The Yahoo bar, now i've one of Dealio i dont know how it get there.

Yes, they pretty much have funcionalities already built into IE, but they seem to be popular. And it seems interesting the way they work and how to make them. We can make TSDN tool bar!!

I'll keep subscribed here
Jan 24 '08 #4

P: 3
A browser helper object (those anoying things that get installed in the IE when you are sleepy and click an "accept" you shouldnt), DLLs like The Yahoo bar, now i've one of Dealio i dont know how it get there.

Yes, they pretty much have funcionalities already built into IE, but they seem to be popular. And it seems interesting the way they work and how to make them. We can make TSDN tool bar!!

I'll keep subscribed here
TSDN tool bar!!??
sorry,what is it realy?
Jan 24 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.