请问如何改变一个程序的Ico图标
在不知道源代码的情况下 请问用什么工具和原理可以实现

解决方案 »

  1.   

    delphi 例子的里有要不就去下工具 。
      

  2.   

    可以用eXeScope工具来替换图标资源。要自己实现的话,用UpdateResource之类的API吧
      

  3.   

    自己下一个做.ico图标工具做一个.ico图标或是下载一个ico图标,再在project->options->Application里的ico把图标改成你做的ico图标运行就可以了
      

  4.   

    下一个AveIcon 可以把普通的图片转换成ICO图标
      

  5.   

    菜单project->options->Application里,把ICO改掉就可以了.
      

  6.   

    我有真正能更改其他Exe图标的Delphi代码和C++代码。呵呵。
      

  7.   

    q153527663() zhongxueming() zbaba() 请管理员把上面的这几个无知的人删了,让他永远不要进csdn.net.你看清题目再说,你那样改谁不会.妈的,无知又想当牛B的人,没那个技术不要说话,跟老子一样.占了别人帖的地方.
      

  8.   

    一个ico文件可以包含多幅 图像
    一个exe文件的图标 也是多个。
    delphi 的TIcon有缺陷。
    ChageExeIcon目前只支持
    单帧 的ico文件
    另外:
    The ExtractIcon function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file. HICON ExtractIcon(    HINSTANCE hInst, // instance handle
        LPCTSTR lpszExeFileName, // filename of file with icon
        UINT nIconIndex  // index of icon to extract
       );
     ParametershInstIdentifies the instance of the application calling the function. lpszExeFileNamePoints to a null-terminated string specifying the name of an executable file, DLL, or icon file. nIconIndexSpecifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file.
     If this value is -1, the function returns the total number of icons in the specified file. 
    "value is -1" 但是 他可是  UINT类型的
    复件 Project2.exe   就是修改过的多个图标的exe,在大图标和小图标 两种浏览方式 下  完全不一样
    procedure TForm1.Button4Click(Sender: TObject);
    var
      IconFileName, EXEFileName: string;
    begin
      if OpenDialog2.Execute then
        begin
          IconFileName := OpenDialog2.FileName;
        end;
      if OpenDialog1.Execute then
        begin
          EXEFileName := OpenDialog1.FileName;
        end;
      ChageExeIcon(IconFileName, EXEFileName);
    end;
    procedure ChageExeIcon(IconFileName, EXEFileName: string);
    var
      NewIcon: TIcon;
      NewSize: integer;
      NewIcon_ms: TMemoryStream;  fn: string;
      ResOffset,
        ms_size: Longint;
      t, t2: Longint;  Exe: TExeImage;
      ms: TMemoryStream;  fs: TFileStream;
      i: integer;
      b: byte;  procedure LoadResources(ResList: TResourceList);
      var
        I: Integer;
      begin
        for I := 0 to ResList.Count - 1 do
          with ResList[I] do
            begin
              if IsList then
                begin
                  if sametext('Icon', ResList[I].Name) or sametext('MAINICON',
                    ResList[I].Name) then
                    LoadResources(List);
                end
              else
                begin              ms_size := ResList[I].Size + 22;
                  if NewSize = ms_size then
                    begin
                      ResOffset := ResList[I].Offset;
                      Break;
                    end;
                end;        end;
      end;begin  NewIcon := TIcon.Create;
      NewIcon_ms := TMemoryStream.Create;  try
        NewIcon.LoadFromFile(IconFileName);    //   NewIcon.Handle    NewIcon.SaveToStream(NewIcon_ms);
        NewSize := NewIcon_ms.Size;
        ms_size := 0;    exe := TExeImage.CreateImage(nil, EXEFileName);    try
          LoadResources(exe.Resources);
          T := Exe.ResSectHdr.PointerToRawData;
          t2 := Exe.ResSectHdr.VirtualAddress;
        finally
          FreeAndNil(exe);
        end;    if ms_size <> NewSize then
          begin
            showmessage('大小不一致!');
          end
        else
          begin
            fs := TFileStream.Create(EXEFileName, fmopenwrite);        try
              fs.Position := ResOffset + t - t2;
              NewIcon_ms.Position := 22;
              for i := 1 to NewSize - 22 do
                begin
                  NewIcon_ms.Read(b, 1);
                  fs.Write(b, 1);
                end;
            except
              ;
            end;
            FreeAndNil(fs);
          end;
      except
      end;
      FreeAndNil(NewIcon_ms);
      FreeAndNil(NewIcon);end;
      

  9.   

    ExeImage
    你看看 Program Files\Borland\Delphi6\Demos\ResXplor 就知道了