CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Thread: Icons in EXE's

  1. #1
    Join Date
    Feb 2000
    Posts
    6

    Icons in EXE's

    How can i place multiple icons for my program in the programs EXE file?


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Icons in EXE's

    create a .RES file and add it to your VB project.
    You can create a RES file by using the Resource Compiler (rc.exe) that comes with VC6.


  3. #3
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Icons in EXE's

    you can also use (Microsoft Visual Studio) Micorosoft developer studio, and create .res from there, or you can use notepad to create files (just save file with extenction *.res) and if you have MS Developer Studio installed, .res file's icon should look like gray, riped file, double click it, which will take you to designer window where you can add sounds, tables, any pics, custom data, icons, cursors, etc....


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: Icons in EXE's

    >you can use notepad to create files (just save file with extenction *.res)

    Please tell use more about that.
    Are you saying that you can type Resource statements into notepad, save it as .RES file and add it to your VB project?
    what version of VB do you use?

    >you can also use (Microsoft Visual Studio) Micorosoft developer studio, and create .res from there

    how would that work? I know how to do that in VC, but, if you look at the makefile it uses, you will find calls to RC.EXE...


  5. #5
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Icons in EXE's

    Goto notepad, after running the notepad you will get blank text file, save it as Untitled.res (it's already untitled, you just have to add .res) then after saving it as .res, you could double click on that file that you just have saved, and it will take you to MS Developer studio....and you will see your .res file empty, now you can start adding any image files, sounds, string tables, cursors, icons, etc. I use VB5 but i got my hands on Visual Studio 97, which i get to use as learning, so i added all my pictures into that res file, saved it and I don't even need to use GIF Animator code to play animated files. I use loadrespicture to get my image animated:


    for z = 0 to 16
    s = s + 1
    If s = 15 then s = 0
    Image1 = LoadResPicture(101 + s, vbResBitmap)
    Pause 0.1
    next z



    Easy, and no dumb GIFs


  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: Icons in EXE's

    >Goto notepad, after running the notepad you will get blank text file, save it as Untitled.res (it's already untitled, you just have to add .res) then after saving it as .res, you could double click on that file that you just have saved, and it will take you to MS Developer studio....and you will see your .res file empty, now you can start adding any image files...

    While that may be true, I think it's an unnecessarily long detour.
    You could as well just start DevStudio and select File/New/Resource Script file or Resource Template.


  7. #7
    Join Date
    Feb 2000
    Location
    America
    Posts
    130

    Re: Icons in EXE's

    2 things:

    1. how do i add the .res file to my vb project?
    2. when i load the empty .res file that i made in notepad it gives me an error. "cannot find c:\my documents\untitled.res or one of it's components. make sure all libraries are available". what do i do?


  8. #8
    Join Date
    May 1999
    Posts
    3,332

    Re: Icons in EXE's

    >1. how do i add the .res file to my vb project?
    right-click in Project Explorer on your project file and select Add/Add File... and select the RES file.


    >2. when i load the empty .res file that i made in notepad it gives me an error. "

    I still don't believe that it makes any sense at all to create an empty ".RES" file with notepad.
    You can create it via DevStudio, or by creating a Resource script file (.rc) and compile it via RC.exe



  9. #9
    Join Date
    Feb 2000
    Location
    America
    Posts
    130

    Re: Icons in EXE's

    ok, i've opened visual c++ and made a new resources script file......now what? where do i put in the images/sounds/cursors/icons etc


  10. #10
    Join Date
    May 1999
    Posts
    3,332

    Re: Icons in EXE's

    choose Insert/Resource from the menu in VStudio 6.


  11. #11
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Icons in EXE's

    I still can't get why you get errors while trying to make the .res file with Notepad. I make all my .res files with notepad and then just double-click it....use drag-and-drop to add images, cursors, etc.(i never added sounds that way before, but it should work too if you are trying to add the sound)
    also to add .res file, just drag-and-drop the .res file over Project-Explorer window in VB...


  12. #12
    Guest

    Re: Icons in EXE's

    This is not a reply, I have a question, how do I run the program I made in VB like I would any other executable file?


  13. #13
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Icons in EXE's

    Compile to the .exe and double-click it!!! Or if you want to internaly execute....just press play button named "RUN"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured