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. :)
Hi
Recompiling resources before building should be enough.
KetilO
Oh I see, "GO" doesn't rebuild the resources. Gotcha! :U
Go does rebuild resources if any dialog, menu or rc file is changed.
KetilO
Err that's what I meant. I think I drank too much last night... :dazzled: :bg