The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => RadAsm Support Forum => Topic started by: Mark Jones on July 03, 2005, 06:20:01 PM

Title: Q: Icon refresh behavior?
Post by: Mark Jones on July 03, 2005, 06:20:01 PM
Hi, I'm working on a "dialog as main" project and added an icon to it:


IDI_SMALL           equ 5

WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
    LOCAL   wc:WNDCLASSEX
    LOCAL   msg:MSG

    mov     wc.cbSize,sizeof WNDCLASSEX
    mov     wc.style,CS_HREDRAW or CS_VREDRAW
    mov     wc.lpfnWndProc,offset WndProc
    mov     wc.cbClsExtra,NULL
    mov     wc.cbWndExtra,DLGWINDOWEXTRA
    push    hInst
    pop     wc.hInstance
    mov     wc.hbrBackground,COLOR_BTNFACE+1
    mov     wc.lpszClassName,offset ClassName
    invoke  LoadIcon,hInstance,IDI_SMALL
    mov     wc.hIcon,eax
    mov     wc.hIconSm,eax
    invoke  LoadCursor,NULL,IDC_ARROW
    mov     wc.hCursor,eax
    invoke  RegisterClassEx,addr wc
    invoke  CreateDialogParam,hInstance,IDD_DIALOG,NULL,addr WndProc,NULL
    invoke  ShowWindow,hWnd,SW_SHOWNORMAL
    invoke  UpdateWindow,hWnd
    .while  TRUE
        invoke GetMessage,addr msg,NULL,0,0
    .BREAK .if !eax
        invoke TranslateMessage,addr msg
        invoke DispatchMessage,addr msg
    .endw
    mov     eax,msg.wParam
    ret
WinMain endp



5 icon discardable "Res/myicon.ico"


It compiles and operates as expected. Except, if you edit the icon file and recompile, the new icon is not loaded. I have to comment out the .RC line, recompile, remove the comment, and compile again to load the edited icon. Is this a limitation of the microsoft tools or am I doing something wrong? Thanks. :)
Title: Re: Q: Icon refresh behavior?
Post by: KetilO on July 03, 2005, 07:35:08 PM
Hi

Recompiling resources before building should be enough.

KetilO
Title: Re: Q: Icon refresh behavior?
Post by: Mark Jones on July 03, 2005, 09:39:00 PM
Oh I see, "GO" doesn't rebuild the resources. Gotcha! :U
Title: Re: Q: Icon refresh behavior?
Post by: KetilO on July 03, 2005, 09:58:05 PM
Go does rebuild resources if any dialog, menu or rc file is changed.

KetilO
Title: Re: Q: Icon refresh behavior?
Post by: Mark Jones on July 03, 2005, 10:14:09 PM
Err that's what I meant. I think I drank too much last night... :dazzled: :bg