in the win32api i've read, that i can't set the MF_OWNERDRAW flag in the resource, so i've written a proc to set it on a whole menu's items. EVERY function succeeds but Get-/SetMenuItemInfo DON'T ! here's the code:



invoke GetMenu,hWin
mov popup,eax
invoke GetMenuItemCount,eax
mov buf[0],al
next_submenu: ; process all submenus
dec buf[0]
invoke GetSubMenu,popup,buf[0]
mov submenu,eax
invoke GetMenuItemCount,submenu
mov buf[1],al
next_item: ;process all items
dec buf[1]
invoke GetMenuItemInfo,submenu,buf[1],TRUE,addr mii ; <-- dunno where's the mistake. returns NULL, GetLastError too...
or mii.fType,MFT_OWNERDRAW
invoke SetMenuItemInfo,submenu,buf[1],TRUE,addr mii
movzx eax,buf[1]
test eax,eax
jnz next_item
movzx eax,buf[0]
test eax,eax
jnz next_submenu


further, can i set this flag to the popups themselves too? i hope so, it would look ugly...
Posted on 2002-08-14 00:46:42 by hartyl
I have the same problem! Do you have found the reason why these api-proc's fail.
I noticed that they work OK on win95/98/NT but they don't on XP!(?)
Posted on 2003-08-14 02:50:30 by Biterider
the reason is the MENUITEMINFO struct is different for 2k and xp.

Posted on 2003-08-14 14:28:53 by Sloat
It's not very smart to compile programs for different versions of Windows.
My code for ownerdraw menus work fine on all windows versions.

Look at:
http://www.asmcommunity.net/board/index.php?topic=10203 (get last version of the file. It's on the end of the thread)

For last last version of this library, look at the "Fresh" project sources:
http://board.flatassembler.net/viewtopic.php?t=160

Regards.
Posted on 2003-08-15 03:27:44 by JohnFound