Indigo Rose Software
  #1  
Old 09-16-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Responding to Scrolling HTML links.

I have a scrolling html screen. in it is a hyperlink; who's target frame is _blank

I want to close down the true update screen when the hperlink is clicked.

Code:
if e_CtrlID == CTRL_SCROLLTEXT_BODY and e_MsgID == MSGID_ONNAVIGATE then
  Application.Exit(0);
end
But OnCtrlMessage does not get fired when you double click on the hyperlink.... (which, by the way, does open a page...)
__________________
Reply With Quote
  #2  
Old 09-16-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Hi Josh,

this works fine for me here. Using your code in On Ctrl Message of a Scrolling HTML dialog does indeed shut down my updater, as expected. I was not able to double click, as my first click already hides the dialog. I am using version 3.0.1.0.

Ulrich
Reply With Quote
  #3  
Old 09-16-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by upeters View Post
Hi Josh,

this works fine for me here. Using your code in On Ctrl Message of a Scrolling HTML dialog does indeed shut down my updater, as expected. I was not able to double click, as my first click already hides the dialog. I am using version 3.0.1.0.

Ulrich
Thanks Ulrich.
Was your hyperlink targeted to _blank?
__________________
Reply With Quote
  #4  
Old 09-16-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Quote:
Originally Posted by jassing View Post
Thanks Ulrich.
Was your hyperlink targeted to _blank?
Oops. I have no target for that link. If a target is set, then the click event is ignored, which is kind of expected because the navigation happens in a new instance, not in the current one. There is no "On Navigate" event happening in the current browser, and no event can be fired. If, however, you set the target to "_self", or have no target at all, it works.

Ulrich
Reply With Quote
  #5  
Old 09-16-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by upeters View Post
Oops. I have no target for that link. If a target is set, then the click event is ignored, which is kind of expected because the navigation happens in a new instance, not in the current one. There is no "On Navigate" event happening in the current browser, and no event can be fired. If, however, you set the target to "_self", or have no target at all, it works.

Ulrich
I would disagree -- the navigation IS happening; it's happening away from the current link in a new window -- regardless of where; the navigation is happening.... This would make complete sense if the message was "OnPageContentsChange" but it's OnNavigate; and it is...

Got any thoughts on how to work around it? My only thought it is to have a refresh page that gets clicked; on it's load opens a new page in a new window; triggers the pagecontent change; then issues a "back"...

but that doesn't make me happy...
__________________
Reply With Quote
  #6  
Old 09-16-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
I understand, but it seems that in this case a "DWebBrowserEvents::NavigateComplete Event" isn't fired. To get what you want, you would probably need to intercept the "DWebBrowserEvents::NewWindow Event", which occurs when you create a new WebBrowser or Internet Explorer object, but it wasn't implemented in that web control we have today.

In your case, upon clicking the link you want to open the web page and shut down the updater. Unless I am missing something, why don't you simply perform this directly in the script? Place no target on your hyperlink at all, and make a On Ctrl Message handler it work like this:

Code:
if (e_CtrlID == CTRL_SCROLLTEXT_BODY and e_MsgID == MSGID_ONNAVIGATE) then
    Shell.Execute(e_Details.URL, "open", "", "", SW_SHOWNORMAL);
    Application.Exit(0);
end
You can even make this behave for a specific link only, not closing the updater for others.

Ulrich
Reply With Quote
  #7  
Old 09-16-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Quote:
Originally Posted by upeters View Post
I understand, but it seems that in this case a "DWebBrowserEvents::NavigateComplete Event" isn't fired. To get what you want, you would probably need to intercept the "DWebBrowserEvents::NewWindow Event", which occurs when you create a new WebBrowser or Internet Explorer object, but it wasn't implemented in that web control we have today.

In your case, upon clicking the link you want to open the web page and shut down the updater. Unless I am missing something, why don't you simply perform this directly in the script? Place no target on your hyperlink at all, and make a On Ctrl Message handler it work like this:

Code:
if (e_CtrlID == CTRL_SCROLLTEXT_BODY and e_MsgID == MSGID_ONNAVIGATE) then
    Shell.Execute(e_Details.URL, "open", "", "", SW_SHOWNORMAL);
    Application.Exit(0);
end
You can even make this behave for a specific link only, not closing the updater for others.

Ulrich
On win2008 this ( I recall, but will test again) pops up a message "do you want to open ...." which just confuses the user even more...

thank -- I'll give it a try to confirm that my recollection is accurate.
__________________
Reply With Quote
  #8  
Old 09-16-2008
jassing's Avatar
jassing jassing is offline
Indigo Rose Customer
 
Join Date: Jan 2001
Location: Anderson Island, WA, USA
Posts: 1,899
Brilliant! Thank you Ulrich for the suggestion... indeed; my memory was faulty; win2008 didn't ask. I imagine vista will; but for now; I'm not worried about vista...

Thanks
-josh
__________________
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Html editing: useful links & questions travisperkins AutoPlay Media Studio 6.0 3 03-09-2006 01:37 AM
How to insert bullet in a paragraph object jrak AutoPlay Media Studio 6.0 13 12-29-2005 11:53 AM
trouble with html links compass AutoPlay Media Studio 4.0 13 10-30-2004 02:21 AM
making links between to pages, printing frames (html) diablo AutoPlay Media Studio 5.0 2 12-06-2003 01:04 PM


All times are GMT -6. The time now is 06:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software