Results 1 to 2 of 2

Thread: Opening a URL to a specific target window/named instance?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    1

    Opening a URL to a specific target window/named instance?

    Hi all,

    I'm currently developing a desktop news application for the company I work for. This is in no way a web based application, however, it will open into our with our Intranet when a user clicks an article, and is linked to the corresponding page.

    Now, this is the problem:

    In one of the forms, I have a "mini" description of the current XML news article. The title of this article is a clickable LinkLabel. What I want to do, is open the LinkLabel into a new browser window BUT specifically target the browser named instance of "Intranet" (i.e. one that has been named when opening via JS). We do not want more than one instance of the Intranet window open.

    This would be similar to how Javascript works when you target a window by name - you either create a new instance (if non-existing) or focus the old one. We use this typically when opening the Intranet from the Application System. Users can't open a second instance due to the check in place via JS.

    Is there a way round this i.e. invoking some sort of Javascript or system process call / shell? I have been Googling this for ages, and it doesn't seem like anyone on the entire Internet has done this yet

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Opening a URL to a specific target window/named instance?

    There may be a much easier way but the only way I can think of would be to just use the WebBrowser control to run your javascript code that you already use to target a specific window.
    I'm not even sure if it would work but you could have a go
    All you would do is drag a WebBrowser control from the toolbox in VS onto your form and then make it invisible (I mean I'm assuming you wouldnt need the user to see it). Then when someone clicks the linklabel you would use this:

    vb Code:
    1. WebBrowser1.Navigate("javascript:your_javascript_goes_here")
    I dont know how well it would work and like I said, others are bound to have a better suggestion but I thought I'd just mention it in case its useful
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width