Have the program read an ini file to select and activate different windows

301 Views Asked by At

I want to write a small app that switches between different windows at 6 second intervals. It will all be explorer url's but they will change from time to time (daily), therefore I want to create a ini file where I can update the url daily, and then have the app switch between active windows based on the ini file description. The url will be something like

http://servername.test.lab:8081/OVPM?ACTION=LOADSTATE&STATENAME=domain_Servers_Disk_Utilization&CUSTOMER=

I have OMW urls for disk utilization, memory cpu etc and want to switch between them. So my question is

  1. how can I use SetForegroundWindow() based on url (will the windows title work for a webpage)?
  2. how can I have C# use the ini to the read the url to use SetForegroundWindow()
  3. should I use a different method
1

There are 1 best solutions below

2
On

Here is how I would do it: WPF or windows forms app with webbrowser control and a timer. Drop the ini Create a little database with a table. URL Interval Set your timer interval from the interval propperty on the db. on tick() event; grab next url, set the webbrowser control, and reload.

Later you can build a nice front end to edit the cycles configured in the db.