Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ShellExecute()  How do I change it to open a new window everytime?

Posted on 2007-03-30
6
Medium Priority
?
663 Views
Last Modified: 2010-08-05
Expert Gurus
How do I change it to open a new window everytime?
 Please let me know.
 
Many Thanks

Ted


        Private Declare Function ShellExecute Lib _
                      "shell32.dll" Alias "ShellExecuteA" _
                      (ByVal hwnd As Long, _
                       ByVal lpOperation As String, _
                       ByVal lpFile As String, _
                       ByVal lpParameters As String, _
                       ByVal lpDirectory As String, _
                       ByVal nShowCmd As Long) As Long
                       
        Private Const SW_SHOW = 1

        Public Sub Navigate(ByVal NavTo As String)
          Dim hBrowse As Long
          hBrowse = ShellExecute(0&, "open", NavTo, "", "", SW_SHOW)
        End Sub
0
Comment
Question by:tcalbaz
  • 2
  • 2
  • 2
6 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 18826346
Well that depends...

What is in "NavTo"?
0
 
LVL 1

Author Comment

by:tcalbaz
ID: 18826443
Nav_to is the URL.

Ted
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 18826835
One way...

Click on Project --> References and check the "Microsoft Internet Controls" entry.

    Public Sub Navigate(ByVal NavTo As String)
        Dim ie As New InternetExplorer
        ie.Visible = True
        ie.Navigate NavTo
    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.

 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 18828041
That does means hardcoding IE as webbrowser.

When you say new window, is it opening in a new tab sometimes ?  IE7 / FireFox2 ?
0
 
LVL 32

Assisted Solution

by:Robberbaron (robr)
Robberbaron (robr) earned 1000 total points
ID: 18828056
see "How ShellExecute Determines Whether to Start a New Instance" in http://support.microsoft.com/kb/224816

example from MS is slightly different in that they dont use null for some reason.
   Dim r As Long
   r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1)
0
 
LVL 1

Author Comment

by:tcalbaz
ID: 18828830
IdleMind
Thanks for the solution.

robberbaron
Very insightful and useful article.

I have split the points
Thank you

Ted
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question