Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Help with closing window

I have designed a program in Visual Basic 6, when a form opens it has a series of buttons, one of the buttons opens Internet Explorer and displays a Web Page. The problem is that i have a hyperlink to close the window in the web page, a message comes up generated by Internet Explorer saying "The web page you are viewing is trying to close the windows" This then lets you click yes or no to close the window, any ideas how to get rid of this?

Thanks people
0
NORTHBROOK
Asked:
NORTHBROOK
1 Solution
 
Ryan ChongCommented:
That is the IE behaviour, unless you using window.open to open the web page.
0
 
Richie_SimonettiIT OperationsCommented:
how do you open the IE window in first place?
0
 
NORTHBROOKAuthor Commented:
This is what im using: -

Private Sub showacp_Click()
     Dim FileName As String, Dummy As String
     Dim BrowserExec As String * 255
     Dim RetVal As Long
     Dim FileNumber As Integer
     BrowserExec = Space(255)
     FileName = "C:\temphtm.HTM"
     FileNumber = FreeFile
     Open FileName For Output As #FileNumber
         Write #FileNumber, "<HTML> <\HTML>"
     Close #FileNumber
     RetVal = FindExecutable(FileName, Dummy, BrowserExec)
     BrowserExec = Trim(BrowserExec)
     If RetVal <= 32 Or IsEmpty(BrowserExec) Then
         MsgBox "Could not find associated Browser", vbExclamation, _
           "Browser Not Found"
     Else
         RetVal = ShellExecute(Me.hwnd, "open", BrowserExec, _
           "-k http://nbcintranet/applications/circulars/file.asp?ID=78", "", SW_SHOWNORMAL)
         If RetVal <= 32 Then
             MsgBox "Web Page not Opened", vbExclamation, "URL Failed"
         End If
     End If
     Kill FileName
     End Sub
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
Richie_SimonettiIT OperationsCommented:
Well, if you use Automation, you could access the click event of the link and let your program close the window, not IE itself.
0
 
Richie_SimonettiIT OperationsCommented:
0
 
CleanupPingCommented:
Hi NORTHBROOK,
This old question (QID 20566372) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept Richie_Simonetti's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now