News:

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

Can we show icon if we delete it source file?

Started by elmo, October 26, 2010, 06:56:02 AM

Previous topic - Next topic

elmo

I make an icon from myico.bmp in my window program
when I delete myico.bmp file, the Icon not appear again.
How to fix this? so the icon still appear, although we delete myico.bmp file

      mov wc3.cbSize,         sizeof wc3
      mov wc3.style,          CS_BYTEALIGNWINDOW
      mov wc3.lpfnWndProc,    offset WndProc3
      mov wc3.lpszMenuName,   NULL
      mov wc3.lpszClassName,  offset szClassName3
      mov wc3.cbClsExtra,     NULL
      mov wc3.cbWndExtra,     NULL
      mov wc3.hbrBackground,  COLOR_BTNFACE+1
      mov wc3.hInstance,      400000h
      ;ICON
      invoke  LoadIcon,NULL,IDI_APPLICATION
      invoke  LoadImage,400000h,addr szLogo,IMAGE_BITMAP,64,64,LR_LOADFROMFILE
      mov     hbmp,eax
      mov     ii.fIcon,TRUE
      push    hbmp
      pop     ii.hbmMask
      push    hbmp
      pop     ii.hbmColor
      invoke  CreateIconIndirect,addr ii
      mov     wc3.hIcon,eax
      mov     wc3.hIconSm,eax
      ;END ICON
      invoke LoadCursor,NULL,IDC_ARROW
      mov wc3.hCursor,        eax
      invoke RegisterClassEx, ADDR wc3

      invoke CreateWindowEx,
               WS_EX_PALETTEWINDOW or WS_EX_CLIENTEDGE,ADDR szClassName3,
               ADDR Form3Caption,
               WS_OVERLAPPED or WS_SYSMENU,
               0,100,160,500,hWnd,NULL,
               400000h,NULL
      mov hChild3, eax







thank you
http://www.masm32.com/board/index.php?PHPSESSID=fa4590ba57dbaad4bc44088172af0b49&topic=1890.0
be the king of accounting programmer world!

Slugsnack

the trick is to bundle it with your application. the easiest way to do that is to include it as a resource in your .rc file.