请教高手,如像腾讯浏览器一样在win2000的开始菜单中添加一个菜单
注册表中找不到开始菜单中腾讯浏览器选项,不知藏在什么地方了。

解决方案 »

  1.   

    可能是我没说清楚,我说的开始菜单是点“开始”后,系统的有“win2000 sever"竖条的那个,在”程序“菜单的上头。
      

  2.   

    楼主说的是不是在开始菜单中加一个菜单呢?其实开始菜单和桌面上的快捷方式都是一个文件!你可以创建一个快捷方式文件!程序组其实是一个特殊的目录而已,你只要在StartMenu目录下创建一个目录就创建了一个程序组呢!如果楼主是说在程序启动时自动运行程序,我认为有几个地方可以做到:
    1、在注册表的Run子键下新增运行程序子键即可
    2、在Win.ini中加入
    3、做成服务程序,Install进去(对Windows NT,2000有效)
    欢迎各位补充!
      

  3.   

    楼主说的是那个菜单呢!好多控件可以实现,至于原理楼主自己好好去看源码吧!我介绍几个:Venus控件组,ThemeEngine控件组,如果楼主找不到的话可以问我要呢!
      

  4.   

    你说的很有道理,我找到了程序组的目录,里面有”新建office文档“之类的快捷方式,可是没有腾讯浏览器的快捷方式,我很想知道这个浏览器的菜单是如何加上去了,让我想删却无从下手,我也想做一个类市的菜单项,该如何做?谢谢各位指点!
      

  5.   

    讲原理的源码很少的,一般都要自己去看代码的!不过好象很多的菜单控件都是写了菜单的DrawItem事件!我也没去研究,不好意思啦!
      

  6.   

    原理:先取得开始菜单的目录,再该目录里创建快捷方式,就会在开始菜单的‘程序’上面出现菜单。
    取得开始菜单的目录:
    uses ShlObj;
    var
      aPath: array [0..MAX_PATH] of Char;
    begin
      // CSIDL_STARTMENU取当前用户,CSIDL_COMMON_STARTMENU取所有用户
      SHGetSpecialFolderPath(0, aPath, CSIDL_STARTMENU, False);
      ShowMessage(string(aPath));  // 开始菜单路径
    end;关于创建快捷方式见下贴。
      

  7.   

    要建立快捷方式,并不是直接调用哪个API函数,而是要利用CreateComObject(CLSID_ShellLink)建立对象ShellLink。下面就是一段程序,它可以在Win95启动目录下建立快捷方式。如果想知道C++和VB怎么做这一工作,可以参考QA000083 "使用IShellLink来控制快捷方式文件"和QA000154 "用VB创建快捷方式"。 
        要使用有关对象,不要忘记在引用单元部分加上ShlObj和ComOb。 
        unit Unit1; 
         
        interface 
         
        uses 
         Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, 
         Dialogs, StdCtrls; 
         
        type 
         TForm1 = class(TForm) 
         Button1: TButton; 
         procedure Button1Click(Sender: TObject); 
         private 
         { Private declarations } 
         public 
         { Public declarations } 
         end; 
         
        var 
         Form1: TForm1; 
         
        implementation 
         
        {$R *.DFM} 
         
        uses 
         ShlObj, ActiveX, ComObj, Registry; 
         
        procedure TForm1.Button1Click(Sender: TObject); 
        var 
         MyObject : IUnknown; 
         MySLink : IShellLink; 
         MyPFile : IPersistFile; 
         FileName : String; 
         Directory : String; 
         WFileName : WideString; 
         MyReg : TRegIniFile; 
        begin 
         MyObject := CreateComObject(CLSID_ShellLink); 
         MySLink := MyObject as IShellLink; 
         MyPFile := MyObject as IPersistFile; 
         FileName := 'NOTEPAD.EXE'; 
         with MySLink do begin 
         SetArguments('C:\AUTOEXEC.BAT'); 
         SetPath(PChar(FileName)); 
         SetWorkingDirectory(PChar(ExtractFilePath(FileName))); 
         end; 
         MyReg := TRegIniFile.Create( 
         'Software\MicroSoft\Windows\CurrentVersion\Explorer'); 
         
        // Use the next line of code to put the shortcut on your desktop 
         Directory := MyReg.ReadString('Shell Folders','Desktop',''); 
         
        // Use the next three lines to put the shortcut on your start menu 
        // Directory := MyReg.ReadString('Shell Folders','Start Menu','')+ 
        // '\Whoa!'; 
        // CreateDir(Directory); 
         
         WFileName := Directory+'\FooBar.lnk'; 
         MyPFile.Save(PWChar(WFileName),False); 
         MyReg.Free; 
        end; 
         
        end. 
        如果要得到快捷文件的属性,则先应调用IPersistFile对象的Load,然后调用IShellLink的GetPath等函数以获得各种属性(详见Win32 API帮助)。如: 
         // Load .lnk file 
         WFileName := ExpandFileName(Sr.Name); 
         MyPFile.Load(PWChar(WFileName), STGM_DIRECT); 
         
         // Retrieve the hotkey. 
         MySLink.GetHotKey(wHotKey); 
         
         // Retrieve the icon. 
         MySLink.GetIconLocation(Filename, 255, nIndex); 
         if strLen(Filename) <> 0 then 
         begin 
         MyIcon := TIcon.Create; 
         MyIcon.Handle := ExtractIcon(hInstance, Filename, nIndex); 
         ListItem.ImageIndex := frmMain.ImageList1.AddIcon(MyIcon); 
         MyIcon.Free; 
         end 
         else 
         begin 
         MySLink.GetPath(Filename, 255, fd, SLGP_UNCPRIORITY); 
         MyIcon := TIcon.Create; 
         nIndex2 := 0; 
         MyIcon.Handle := ExtractAssociatedIcon(hInstance, Filename, nIndex2); 
         ListItem.ImageIndex := frmMain.ImageList1.AddIcon(MyIcon); 
         MyIcon.Free; 
         end; 
        另外,可以在http://delphi.icm.edu.pl/ftp/d30free/PDJ_Shortcut.zip下载免费的建立快捷方式的VCL控件。