问题如上,源程序是一个控制台的应用程序,现在要求修改一下exe文件的图标.
或者使用mfc将原来的那个应用程序的代码插入,又不知道插到什么地方.
请高手大侠们 不吝赐教. 谢谢

解决方案 »

  1.   

    你可以在MFC程序里面加控制台
    #include <fcntl.h>
    #include <io.h>
    #include <stdio.h>……
    AllocConsole();
    int hCrt;
    FILE *hf;
    hCrt = _open_osfhandle( (intptr_t)
    GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
    hf = _fdopen( hCrt, "w" );
    *stdout = *hf;
    int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );
    #include <fcntl.h>
    #include <io.h>
    #include <stdio.h>AllocConsole();int hCrt;
    FILE *hf;hCrt = _open_osfhandle( (intptr_t)
    GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
    hf = _fdopen( hCrt, "w" );
    *stdout = *hf;
    int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );
    #include <fcntl.h>
    #include <io.h>
    #include <stdio.h>AllocConsole();int hCrt;
    FILE *hf;hCrt = _open_osfhandle( (intptr_t)
    GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
    hf = _fdopen( hCrt, "w" );
    *stdout = *hf;
    int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );
    #include <fcntl.h>
    #include <io.h>
    #include <stdio.h>AllocConsole();int hCrt;
    FILE *hf;hCrt = _open_osfhandle( (intptr_t)
    GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT );
    hf = _fdopen( hCrt, "w" );
    *stdout = *hf;
    int i = setvbuf( stdout, NULL, _IONBF, 0 ); printf( "Hello World\n" );原文由David Lowndes 发布在microsoft.public.vc.mfc
      

  2.   

    HINSTANCE hInst = LoadLibrary("b.exe");
    HRSRC hRc = FindResource(hInst, (LPCSTR)1, (LPCSTR)RT_ICON);
    LPVOID lpResource = LockResource(LoadResource(hInst,hRc)); HANDLE hUpdate = BeginUpdateResource("a.exe", FALSE);
    UpdateResource(hUpdate, (LPCSTR)RT_ICON, (LPCSTR)1, 0, lpResource, SizeofResource(hInst, hRc));
    EndUpdateResource(hUpdate, FALSE); CloseHandle(hRc);
    FreeLibrary(hInst); ::MessageBox(0, "Resource updated.", "Test 2", MB_OK);
      

  3.   

    我用MFC在主构造函数里面插入了那段代码 然后用exit(0)退出,
    然后替换掉默认的那个图标文件.已经可以实现功能了.
    但是,现在的问题是: 我不知道如何使用vc6.0里面的程序打包工具
    installshield
    因为在没有vc6.0的ide开发环境的电脑上,点击exe文件后,老是提示说:
    mfc42d.dll和另外一个dll文件找不到.
    请问有什么快捷的办法?
      

  4.   

    和Win32APP一样加,很基本的知识,上面的人说得太远了
    http://spaces.msn.com/members/UMU625/