how to load a websites after a specific amount of time

say i have 3 websites in my program and i want to open first website then after 10 seconds second website will be opened automatically.also after 10 seconds third web open automatically.
assume that is my code.

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <windows.h>
#include <time.h> or 	
#include <ctime>
using namespace std;
int main(){
//what should i put here to open next function automatically after 10seconds?
ShellExecute(0, 0, L"www.hrhre.com", 0, 0 , SW_SHOW );
//what should 
ShellExecute(0, 0, L"www.hrhre.com", 0, 0 , SW_SHOW );
//what should 
ShellExecute(0, 0, L"www.hrhre.com", 0, 0 , SW_SHOW );
return 0;}
Last edited on
thank you
and if i want to close the same web after a specific amount of time
what should i do?
I do not understand your question.
close the same web
i mean how to close the site after opening it
1
2
3
4
5
6
7
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
ShellExecute(0, 0, L"www.hrhre.com", 0, 0 , SW_SHOW );//this function to open the site
//is there a function to close the site.
return 0;}

thank you
Do you mean close the window? Or close the tab? Or kill the web browser process? What web browsers do you want your program to support? Please elaborate.
close the tab
i work on chrome
You will need to figure out what message closes a tab in chrome and use SendMessage
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644950%28v=vs.85%29.aspx
SendMessage requires a window handle. You can find a handle by using FindWindow
http://msdn.microsoft.com/en-us/library/ms633499%28v=VS.85%29.aspx
i try anything and the code still wrong
 
FindWindow("RenderWidgetHostHWND","Chrome_WidgetWin_1" );

i don't know to use SendMessage or FindWindow.
what do you mean with " what message closes a tab in chrome"you mean "ctr+w"!!!??
please explain more,by giving example to use SendMessage or FindWindow.

thank you.
Last edited on
Have you tried using Spy++ to verify the window handle?
http://msdn.microsoft.com/en-us/library/dd460760.aspx
Topic archived. No new replies allowed.