如何设置一个网站,网页在IE,火狐,Chrome和Safari与C ++? [英] How set a website as homepage in IE, Firefox, Chrome and Safari with C++?

查看:152
本文介绍了如何设置一个网站,网页在IE,火狐,Chrome和Safari与C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过C ++或C设置如google.com网站为首页?怎么样?

Is there a way to set a website like google.com as homepage through C++ or C ? How ?

推荐答案

不知道你的动机是什么,但我不认为这是我想要的东西在我的系统上的任何code是从下列明我。这听起来像那种事情的广告软件/恶意软件,会做你的祖父母(谁不知道如何解决它,一旦它的设置)。注意负面评论时,有人问如何从JavaScript做到这一点:

Not sure what your motive is, but I don't think of this as something I want any code on my system to be setting out from under me. It sounds like the kind of thing adware/malware would do to your grandparents (who wouldn't know how to fix it once it's set). Note the negative comments when the question was asked of how to do it from JavaScript:

<一个href=\"http://stackoverflow.com/questions/946189/how-can-i-set-default-homepage-in-ff-and-chrome-via-javascript\">How我可以通过javascript设置默认主页在FF和铬?

这是更好的做它自己的指示点的人。特别提醒的横幅它说,并链接到的东西沿着这些路线让我们为您的主页!

It's better to point people at instructions for doing it themselves. Remind with a banner which says "Make us your homepage!", and link to something along these lines:

HTTP://www.makeuseof的.com /标签/如何对变化的 - 首页 - 在-5的浏览器/

如果不是为了审美的原因,也有技术方面的原因,不要试图写code吧。每个浏览器存储在其自己的位置信息。在IE浏览器的情况下,似乎有一个注册表设置

If not for the aesthetic reasons, there are technical reasons not to try and write code for it. Each browser stores this information in its own place. In IE's case, there appears to be a registry setting:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page

所以,你会用电话向的 Windows注册表API 进行查询和设置。但Firefox不会保存此注册表,这样可以节省它<一个href=\"http://forums.winamp.com/showpost.php?s=aec27aebeeeba3cbb8cc37651bbdb754&p=1850806&postcount=5\"相对=nofollow>在一种叫做 prefs.js ,你要寻找的:

So you'd use calls to the Windows Registry API to query it and set it. But Firefox doesn't save this in the registry, it saves it in something called prefs.js and you'll be looking for:

user_pref("browser.startup.homepage", .... );

此外,还有歌剧,Safari,Chrome浏览器等。总而言之,最好只给人们的方向,并把他们在他们的经验控制!

Then there's Opera, Safari, Chrome, etc. All told, better to just give people directions and put them in control of their experience!

这篇关于如何设置一个网站,网页在IE,火狐,Chrome和Safari与C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆