-
June 4th, 2020, 07:50 AM
#1
Knowing when a web page has been opened or closed
Is there any way to know for sure when a web page (let say www.test.com) has been opened, and when this page has been closed ? I need this feature for a VC++/MFC project.
Last edited by mesajflaviu; June 4th, 2020 at 08:48 AM.
-
June 4th, 2020, 02:33 PM
#2
Re: Knowing when a web page has been opened or close
And how this "web page" is about to use in your VC++/MFC project?
Victor Nijegorodov
-
June 4th, 2020, 02:56 PM
#3
Re: Knowing when a web page has been opened or close
There is a way if your app is acting like a browser and displays the web oage (there is a browser control that lets you do this).
If your app doesn't display the web page, there is no way.
Btw, why does your app care if a web page is opened?
-
June 5th, 2020, 12:26 PM
#4
Re: Knowing when a web page has been opened or close
Originally Posted by VictorN
And how this "web page" is about to use in your VC++/MFC project?
From a button is starting a web page in default browser.
-
June 5th, 2020, 12:27 PM
#5
Re: Knowing when a web page has been opened or close
Originally Posted by Arjay
There is a way if your app is acting like a browser and displays the web oage (there is a browser control that lets you do this).
If your app doesn't display the web page, there is no way.
Btw, why does your app care if a web page is opened?
Because a part of application job is made it online, in a web page.
-
June 5th, 2020, 06:32 PM
#6
Re: Knowing when a web page has been opened or close
Originally Posted by mesajflaviu
Because a part of application job is made it online, in a web page.
I still don't know what you are taking about. Help me to understand where the web page is hosted.
Is it hosted on a web server (like google.com would be)?
Is it hosted locally by the C++ application (i.e. in a browser control within the C++ app like some apps do to display local help files).
If you answer these questions I may be able to help further.
-
June 5th, 2020, 06:38 PM
#7
Re: Knowing when a web page has been opened or close
Based on you reply to Victor, "From a button is starting a web page in default browser" it isn't possible.
The reason is the default browser is a separate process and you can't 'hook' into its events.
On the other hand is if rather than using the default browser, you load up the page in a browser control hosted inside your app, then you will have access to the browser control's event and be able to handle the page load completed event.
-
June 9th, 2020, 06:07 AM
#8
Re: Knowing when a web page has been opened or close
Originally Posted by Arjay
I still don't know what you are taking about. Help me to understand where the web page is hosted.
Is it hosted on a web server (like google.com would be)?
Is it hosted locally by the C++ application (i.e. in a browser control within the C++ app like some apps do to display local help files).
If you answer these questions I may be able to help further.
Yes, a part of app job is hosted on a foreign site, as you said, google.com. I'll try to host this web page as part of my app. Thank you.
-
June 9th, 2020, 06:20 AM
#9
Re: Knowing when a web page has been opened or close
I was thinking to trace the history folder for default browser. But I guess this is not the easy thing ... how can I identify this folder ?
-
June 9th, 2020, 08:49 AM
#10
Re: Knowing when a web page has been opened or close
Originally Posted by mesajflaviu
I was thinking to trace the history folder for default browser. But I guess this is not the easy thing ... how can I identify this folder ?
Um, are we now onto solving a different problem?
-
June 10th, 2020, 11:34 AM
#11
Re: Knowing when a web page has been opened or close
Originally Posted by Arjay
Um, are we now onto solving a different problem?
Sorry, I thought aloud. I guess is not a good idea.
-
June 10th, 2020, 12:12 PM
#12
Re: Knowing when a web page has been opened or close
Originally Posted by mesajflaviu
I was thinking to trace the history folder for default browser. But I guess this is not the easy thing ... how can I identify this folder ?
Not every browser maintains history. Perhaps you could do something with EnumWindows.
-
June 11th, 2020, 07:07 AM
#13
Re: Knowing when a web page has been opened or close
Originally Posted by GCDEF
Not every browser maintains history. Perhaps you could do something with EnumWindows.
Not a bad idea, but the browser can have already has opened tabs, and when I open a new tab from my app, or when user close the tab which has been open within my app, EnumWindows doesn't help me ...
Last edited by mesajflaviu; June 12th, 2020 at 01:42 AM.
-
June 12th, 2020, 03:12 AM
#14
Re: Knowing when a web page has been opened or close
> Because a part of application job is made it online, in a web page.
So, are you expecting the user to do something (more than just look at something) when they get to the website?
If so, then perhaps you can just launch the browser with some URL from within your app, then asynchronously poll the website to look for some state change that the user performs.
Is this your website, or some third party?
If it's third party, are you doing anything which is against their terms of service?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|