The MASM Forum Archive 2004 to 2012
Welcome, Guest. Please login or register.
September 25, 2021, 03:03:36 AM

Login with username, password and session length
Search:     Advanced search
128553 Posts in 15254 Topics by 684 Members
Latest Member: mottt
* Home Help Search Login Register
+  The MASM Forum Archive 2004 to 2012
|-+  General Forums
| |-+  The Campus
| | |-+  MAKEINTRESOURCE
« previous next »
Pages: [1] Print
Author Topic: MAKEINTRESOURCE  (Read 6129 times)
six_L
The Poor English and ASM
Member
*****
Posts: 311


see you, see me, see you...


MAKEINTRESOURCE
« on: June 21, 2007, 01:09:31 AM »

Quote
MAKEINTRESOURCE

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?
Logged

regards
u
Not a
Member
*****
Posts: 527

dog eat dog xenophobic forum


Re: MAKEINTRESOURCE
« Reply #1 on: June 21, 2007, 01:59:05 AM »

In the end, it's all a DWORD  BadGrin
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.
Logged

Please use a smaller graphic in your signature.
six_L
The Poor English and ASM
Member
*****
Posts: 311


see you, see me, see you...


Re: MAKEINTRESOURCE
« Reply #2 on: June 21, 2007, 02:47:32 AM »

thanks you.
Logged

regards
bomz
Member
*****
Posts: 610



Re: MAKEINTRESOURCE
« Reply #3 on: May 02, 2011, 04:43:44 AM »

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
« Last Edit: May 02, 2011, 11:19:28 AM by bomz » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!