News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

update icon to res

Started by ragdog, February 15, 2007, 03:29:24 PM

Previous topic - Next topic

ragdog

hi

as I can merge a selected icon into my resource with this algo


.386   
.model flat,stdcall   
option casemap:none   
include    windows.inc
include    kernel32.inc
includelib kernel32.lib
.data   
    szTargetExe db 'test.exe',0
    szTargetFile db 'main.ico',0
    hMod dd 0
    hFile dd 0
    dwSize dd 0
   
.code
start:
    invoke CreateFile, ADDR szTargetFile, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0
    test eax,eax
    js _exit
    mov hFile,eax
    invoke GetFileSize, eax, 0
    mov dwSize,eax
    invoke CloseHandle, hFile

    invoke BeginUpdateResource, ADDR szTargetExe, 0
    or eax,eax
    jz _exit
    mov hMod,eax
    invoke UpdateResource, eax, RT_GROUP_ICON, 100, 0, addr szTargetFile, dwSize   
    invoke EndUpdateResource, hMod, 0

_exit:
    invoke ExitProcess, 0
   
end start

ragdog

ragdog

can none help me with this problem?

:'(

six_L

before ask the question, you have better to search the forum.
if everyone asks the same question, what's happen will be ? the information will be exploded.
http://www.masm32.com/board/index.php?topic=6168.msg46063#msg46063
regards

ragdog

thanks

I would like not from a selected exe file! I want from a separate icon file *.ico

dsouza123

Hope this helps, MichaelW's drive activity utility, it deals with switching between icons while a program is running.

http://www.masm32.com/board/index.php?topic=4163.msg31130#msg31130

It switches between icons to display disk activity, runs in the system tray.

ragdog

i have a small source found in c++ can your help to translate in masm?

thanks in forward

ragdog

[attachment deleted by admin]

Vortex

ragdog,

Here is a quick demo uptading the icon of an executable :

.386
.model flat, stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\macros\macros.asm

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib


.data
include rsrc.inc
.data?
hUpdateRes dd ?
.code
start:
fn BeginUpdateResource,"Msgbox.exe",FALSE
mov hUpdateRes,eax
fn UpdateResource,eax,RT_ICON,1,1033,ADDR res_icon,02E8h
fn UpdateResource,hUpdateRes,RT_GROUP_ICON,100,1033,ADDR res_group_icon,014h
fn EndUpdateResource,hUpdateRes,FALSE
fn ExitProcess,NULL

END start

[attachment deleted by admin]

ragdog

thanks to all

this example have I already!
I would like c++ the example in masm32
if their there further could help me

ragdog

PBrennick

RagDog,
Actually, the example posted by Vortex does exactlyy what you requested. All you need to do is convert the .ico file to a data dump. I will, however take a peek at your C++ example.

Paul
The GeneSys Project is available from:
The Repository or My crappy website