flat assembler
Message board for the users of flat assembler.
Index
> Windows > struct MENUITEMINFO |
Author |
|
barmentalisk 31 May 2008, 07:18
If I am not mistaken, the structure MENUITEMINFO has been changed:
now it has 12 elements, all the same, but 12-th new element hbmpItem. http://msdn.microsoft.com/en-us/library/ms647578.aspx maybe that is why I can't get worked this: Code: invoke GetMenuItemInfo,[hmenu],21,0,menuinfo xor [menuinfo.fState],MFS_CHECKED invoke SetMenuItemInfo,[hmenu],21,0,menuinfo however Code: invoke CheckMenuItem,[hmenu],21,MF_UNCHECKED works correct if anyone will be pleased to give me an idea or a working code which changes flags of menu items? p.s. sorry for my bad english |
|||
31 May 2008, 07:18 |
|
revolution 31 May 2008, 08:55
You also have to set the cbSize parameter before calling Get/Set.
|
|||
31 May 2008, 08:55 |
|
barmentalisk 02 Jun 2008, 07:03
But how many elements must have the structure to be correct?
11 or 12? I've tested with 11 and 12. It works equal in that cases, but which is correct? 2revolution: thank you! I did it at the very begining of using the structure, but did not understand the usage fmask param. Oh, sorry for my poor-poor english! |
|||
02 Jun 2008, 07:03 |
|
revolution 02 Jun 2008, 07:29
Both 11 and 12 are correct. If you set the size as 11 dwords (44 bytes) then Windows will use the code for an 11 dword structure, and if you set the length to 12 dwords (48 bytes) then Windows will use the code for a 12 dword structure. That is why many structures in Windows have the cbSize parameter, it allows for the structure to be extended at a later date without causing compatibility problems for older code.
[edit]However, if you need your code to be the backward compatible then using the 11 element size would be the best option. If you can 100% guarantee that your code is always run in newer OSes then using either 11 or 12 will be okay.[/edit] |
|||
02 Jun 2008, 07:29 |
|
barmentalisk 02 Jun 2008, 09:58
Oh, man, how couldnt I get that =)
Thank you very much! |
|||
02 Jun 2008, 09:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.