flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
barmentalisk
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 |
|||
![]() |
|
barmentalisk
I've got an idea about the first sample.
Must fill fmask param of struct at the definition or later: menuinfo MENUITEMINFO sizeof.MENUITEMINFO,MIIM_STATE |
|||
![]() |
|
revolution
You also have to set the cbSize parameter before calling Get/Set.
|
|||
![]() |
|
revolution
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] |
|||
![]() |
|
barmentalisk
Oh, man, how couldnt I get that =)
Thank you very much! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.