Aha! You’ve found the missing link. I knew their had to be a (sort of) reasonable explanation to this.
There is one, and it is fairly simple. The exe I posted above (paint.zip) works fine, it shows two icons, one loaded with IDI_APPLICATION, the other with IDI_WINLOGO:
invoke DrawIcon, hdc, 10, 1, rv(LoadImage, hInstance, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_SHARED)
invoke DrawIcon, hdc, 100, 100, rv(LoadImage, hInstance, IDI_WINLOGO, IMAGE_ICON, 0, 0, LR_SHARED)So, why does it work? Simply because
I loaded the respective resources:
#include "resource.h"
IDI_APPLICATION ICON "\\Masm32\\MasmBasic\\icons\\Smiley.ico"
IDI_WINLOGO ICON "\\Masm32\\MasmBasic\\icons\\Globe.ico"
01 RT_MANIFEST "\\Masm32\\MasmBasic\\Res\\XpManifest.xml"OP posts a snippet. After a while, he understands that complete code is needed. But he does not provide the RC file, or the required icons. Besides, he is a member of the Bare Metal Heros Club, alias the push push call brigade, so that his code is almost unreadable. All that adds together, and the result is chaos and confusion.
push EAX
mov EAX,10;Y
push EAX
mov EAX,1;X
push EAX
push hdc
call DrawIconWhen will he realise that
mov eax, 1
push eaxis just an unnecessary "verbose" way of doing
push 1?
When will he realise that in MASM you simply use invoke DrawIcon, hdc, 1, 10, eax?