News:

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

Start Button Bitmap

Started by G`HOST, October 30, 2005, 02:58:10 AM

Previous topic - Next topic

G`HOST

Hi again,
           i got stuck again and need a quick help.
what i am trying to do is, change the start button bitmap , so i came up with this

Quote

.DATA
Shell db "Shell_TrayWnd",0
ButtonClass db "BUTTON",0
StartButtonBitmap db "ButtonBit",0

.CODE
                                    invoke FindWindow,ADDR Shell,NULL
                                  invoke FindWindowEx,eax,0,ADDR ButtonClass,0
                                  mov hStartButton,eax
                                  invoke SendMessage,hStartButton,BM_GETIMAGE,IMAGE_BITMAP,0
                                  mov hOldBmp,eax
                                                                   
                                  invoke LoadBitmap,hInstance,ADDR StartButtonBitmap
                                  mov hStartButtonBitmap,eax
                                  invoke SendMessage, hStartButton,                                            BM_SETIMAGE,IMAGE_BITMAP,hStartButtonBitmap                   
                                  invoke SendMessage, hStartButton, BM_SETSTATE, TRUE, NULL


OK so the problem is till the app is running the bitmap works fine but once the app is closed and
i click the start button the bitmap is gone and there remains nothing on the button.
Yes i do understand this is quit obvious but dont know how to get around it.
so could someone plz explain what i am supposed to do to get the bitmap stay even if the app is closed.
Thank you

G`HOST

I think i figured it out. I was doing the same mistake hutch mentioned in http://www.masmforum.com/simple/index.php?topic=3080.0 ( Thats me  :toothy )
which is  "Generally Windows is designed to display a disk file where trying to display a resource from an EXE file is not workable as the exe file can be closed and leave Windows with an error."
Sorry for inconvineons.
Cya