Иконка в ЕХЕ файле.

Тема в разделе "WASM.BEGINNERS", создана пользователем Valentin, 8 авг 2010.

  1. Valentin

    Valentin Member

    Публикаций:
    0
    Регистрация:
    2 ноя 2007
    Сообщения:
    128
    Други, помогите.
    Как присобачить иконку к ЕХЕ-шнику, если в приложении нет основного окна?
     
  2. fragment

    fragment New Member

    Публикаций:
    0
    Регистрация:
    11 июн 2008
    Сообщения:
    266
    С помощью фалйа ресурсов rcrs.rc c текстом
    Код (Text):
    1. 500 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "test.ico"
    фаил компилируется с помощью cvtres.exe и rc.exe и получившийся rcrs.obj скармливаем линкеру link.exe prog.pbj rsrc.obj .. примерно так

    makeit.bat из проэктов masm32v9
    Код (Text):
    1. @echo off
    2. : -------------------------------
    3. : if resources exist, build them
    4. : -------------------------------
    5. if not exist rsrc.rc goto over1
    6. rc.exe /v rsrc.rc
    7. cvtres.exe /machine:ix86 rsrc.res
    8. :over1
    9.  
    10. if exist %test.obj del test.obj
    11. if exist %test.exe del test.exe
    12.  
    13. : -----------------------------------------
    14. : assemble test.txt into an OBJ file
    15. : -----------------------------------------
    16. Ml.exe /c /coff test.txt
    17. if errorlevel 1 goto errasm
    18.  
    19. if not exist rsrc.obj goto nores
    20.  
    21. : --------------------------------------------------
    22. : link the main OBJ file with the resource OBJ file
    23. : --------------------------------------------------
    24. Link.exe /SUBSYSTEM:WINDOWS test.obj rsrc.obj
    25. if errorlevel 1 goto errlink
    26. dir test.*
    27. goto TheEnd
    28.  
    29. :nores
    30. : -----------------------
    31. : link the main OBJ file
    32. : -----------------------
    33. Link.exe /SUBSYSTEM:WINDOWS test.obj
    34. if errorlevel 1 goto errlink
    35. dir test.*
    36. goto TheEnd
    37.  
    38. :errlink
    39. : ----------------------------------------------------
    40. : display message if there is an error during linking
    41. : ----------------------------------------------------
    42. echo.
    43. echo There has been an error while linking this project.
    44. echo.
    45. goto TheEnd
    46.  
    47. :errasm
    48. : -----------------------------------------------------
    49. : display message if there is an error during assembly
    50. : -----------------------------------------------------
    51. echo.
    52. echo There has been an error while assembling this project.
    53. echo.
    54. goto TheEnd
    55.  
    56. :TheEnd
    57.  
    58. pause
     
  3. Valentin

    Valentin Member

    Публикаций:
    0
    Регистрация:
    2 ноя 2007
    Сообщения:
    128
    fragment, спасибо, дорогой, все получилось как в песне.
     
  4. Com[e]r

    Com[e]r Com[e]r

    Публикаций:
    0
    Регистрация:
    20 апр 2007
    Сообщения:
    2.624
    Адрес:
    ого..
    напойте, если не сложно