QuoteMAKEINTRESOURCE
This macro converts an integer value to a resource type compatible with Windows resource-management functions. This macro is used in place of a string containing the name of the resource.
LPTSTR MAKEINTRESOURCE(
WORD wInteger;
);
Parameters
wInteger
Specifies the integer value to be converted.
Return Values
The return value is the specified value in the low-order word and zero in the high-order word.
Remarks
The return value should be passed only to the Microsoft® Win32® resource-management functions, as the lpType parameter.
The MAKEINTRESOURCE macro is defined as follows.
#define MAKEINTRESOURCE(i) (LPTSTR) ((DWORD) ((WORD) (i)))
how do translate the macros into asm?
In the end, it's all a DWORD :bdg
That C++ definition is just to trick the C++ compiler.
The OS will recognize if the passed parameter is an ID or a string simply by checking if the value is >65535. In the OS, it's basically forbidden to have memory, allocated in the first virtual 64kB (and quite a bit more). So, any pointer will be >>65535.
thanks you.
and how convert IDI_ICONATERISK to MAKEINTRESOURCE(IDI_ICONASTERISK) ?
STRING db 4 dup (?)
mov dword ptr [STRING+3], IDI_ICONASTERISK
How Use here resourses from system32\shell32.dll?
Quote
ImageFile db 'my.bmp',0
invoke CreatePopupMenu
mov hPopupMenu,eax
invoke LoadImage,0,addr ImageFile,IMAGE_BITMAP,120,120,LR_LOADFROMFILE
mov bytesWrite, eax
invoke AppendMenu,hPopupMenu,MF_BITMAP,IDM_EXIT,bytesWrite