I just want to use SendMessage function to make my icon on the dialog.
the code as fallow:


invoke SendMessage,hWnd,WM_SETICON,ICON_SMALL,offset MyMainIcon

and in the beginning I have write:
MyMainIcon db 'MyMainIcon',0
Posted on 2003-09-16 23:48:30 by peansen
push offset MyMainIcon
push 00h ; i am assuming the icon is in the resource of the exe .. if its in a
; dll put the dll base here
call LoadIconA
mov mainiconhandle,eax

PUSH mainiconhandle
push TRUE
push WM_SETICON
push hwnd
call SendMessageA

PUSH mainiconhandle
push FALSE
push WM_SETICON
push hwnd
call SendMessageA

--------------------

should do the job.. works for me ;)
Posted on 2003-09-16 23:53:14 by evlncrn8
thank you!
Posted on 2003-09-17 00:26:22 by peansen

push offset MyMainIcon
push 00h
call LoadIconA
mov mainiconhandle,eax

PUSH mainiconhandle
push TRUE
push WM_SETICON
push hwnd
call SendMessageA

PUSH mainiconhandle
push FALSE
push WM_SETICON
push hwnd
call SendMessageA


why not use INVOKE ? Is invoke slower than the "old" style ?
Posted on 2003-09-25 09:02:58 by Ranma_at
No, just that your code is easier to read.
Posted on 2003-09-25 09:23:10 by roticv
Here is invoke + alternative version.

;-------*.RC file-- ------------
icon_id ICON MOVEABLE PURE LOADONCALL DISCARDABLE "youre_icon_.ICO"


;------inside the code--------
.IF uMsg==WM_INITDIALOG
invoke LoadImage,hInstance,icon_id,IMAGE_ICON,0,0,0
invoke SendMessage,hWin,WM_SETICON,ICON_SMALL,eax
Posted on 2003-10-11 12:34:55 by AceEmbler
Faster:



invoke SetClassLong,hDlg,GCL_HICON,hIcon
Posted on 2003-10-11 12:43:19 by JimmyClif