473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

What is wrong in this script

24
Dear All,

First I am sorry to put this question here.
I have just finish one program using VB.NET to capture html file and convert it to image file, and I put it in IE context menu using the following registration code.
Expand|Select|Wrap|Line Numbers
  1. Windows Registry Editor Version 5.00
  2.  
  3. [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Capture this page with html Capture]
  4. @="C:\\Program Files\\html Capture\\html Capture.htm"
  5. "Contexts"=dword:0000003f
  6. "Flags"=dword:00000000
  7.  
Also I create html file which contain the script to run the program.
Expand|Select|Wrap|Line Numbers
  1. <script language="vbscript">
  2.     Dim Shell
  3.     Set Shell = CreateObject("WScript.Shell")
  4.     Shell.run Chr(34) & "C:\Program Files\html Capture\html Capture.exe" & Chr(34) & " " & Chr(34) & window.external.menuArguments.location.href & Chr(34), 1, False
  5.     Set Shell = Nothing
  6. </script>
  7.  
But finally when I start the program from IE menu it halts just before saving the file, but it works perfectly if I start it manually.
Do you have any Ideas regarding this issue please?
Finally, I am sorry about my bad English.

Thanks and Best Regards
Jul 13 '10 #1
1 1089
hdbbdh
24
Dear Friends,

I found the problem, actually the script sends URL as “http://bytes.com” not as http://bytes.com, so the URL becomes invalid.
But unfortunately, I stuck in other problem which is that WebBrowser_DocumentComplete is not fired when the URL is invalid.
Then my new question is:
What is the event which is fired when WebBrowser complete loading the page or showing “This program connot display the webpage”.
Please find below what I tried.

The following code will be fired if the webpage is found.
Expand|Select|Wrap|Line Numbers
  1. Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  2. GetImage()
  3. End Sub
  4.  
The following code will be fired if the webpage is found but before complete view, and also it will fired if the webpage is not found, the case of “This program cannot display the webpage”.
Expand|Select|Wrap|Line Numbers
  1. Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
  2. If WebBrowser1.ReadyState = WebBrowserReadyState.Complete Then
  3. GetImage()
  4. End If
  5. End Sub
  6.  
Any help please.

Thanks and Best Regards
Jul 15 '10 #2

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

Similar topics

2
by: Sparrow | last post by:
I need to get a print return of db_namelog01 for the script I have written below: select @cmd=@db_name+'to dump'+@db_name+'log'+right(stuff(convert(char(2),@log_number),1,0,'0'),2) What I get...
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
4
by: Hal | last post by:
Can someone please tell me what is wrong with this script? <script language="JavaScript"> <!-- function HF_CloseAllChildren() { if (g_win1) != undefined { if ((g_win1) && !(g_win1.closed))...
6
by: Wow | last post by:
var abc=64; document.write(abc^2); then it display 66 var abc=66; document.write(abc^2); then it displays 64 What is the ^2 ? 66^2=4365 not 64. even I mod 128 or 256, I got 4, not 64
2
by: abuse | last post by:
this script is on a web page i visit i am not a java or any other code programmer. is this malicious? should i be leary of this site? thanks. <script language="ShonenScript 712.0"><!-- {var...
5
by: Cylix | last post by:
this.menus = { root: new Array };
8
by: VickyVirgo2k | last post by:
Could someone please give me some idea what this script is doing. It might be some malicious script that might have been used to spread virus or to hack username/ password, hence it has been ###...
10
by: Ohmster | last post by:
I am trying to use this cool script that some MIT guy wrote and it just does not work, I get a stream of errors when I try to run it. It is supposed to visit a URL and snag all of the pictures on...
3
by: sigkill9 | last post by:
I've been working on this script all weekend and am almost done with it accept for one last detail; implementing a "process another number?" prompt after a user input is processed. The script...
12
by: vijayarl | last post by:
Hi All, Thanks in Advance !!!! I have one config file & am reading that file.later i am using one of the value specified in the config file & trying to get the files placed in the directory...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.