I looked at the favorites lists to find out that there was .url files. That makes it really easy. Consider the following code. I have tested it on two platforms (NT and 98) and it works. Utilize something similar as a function in your code.
Code:
#include <fstream>
#include <stdlib>
using namespace std;
int main()
{
ofstream url;
int i=0;
// Open file to write url.
// Needs to support many different
// file structures. (last ditch... write to C drive)
url.open("C:\\windows\\temp\\myurl.url");
if (url.fail())
{
++i;
url.open("C:\\temp\\myurl.url");
if (url.fail())
{
++i;
url.open("C:\\myurl.url");
if (url.fail())
return 1;
} // end inner if
} //end outter if
url << "[DEFAULT]\nBASEURL=http://www.yahoo.com\n"
<< "[InternetShortcut]\nURL=http://www.yahoo.com";
url.close();
// Use any file run command here...
// I used system, but some people
// frown on that.
if(i==0)
system ("C:\\windows\\temp\\myurl.url");
if(i==1)
system ("C:\\temp\\myurl.url");
if(i==2)
system ("C:\\myurl.url");
return 0;
} // end main