Jump to content
Tuts 4 You

Edit History

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empty/uninitialized and/or system-reserved ... unless you put something in it. That's why you actually *have to* modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus

Quote

Setting the Owner-Drawn Flag

    You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

    :

    By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

 You created popup menu straight by code, right (not using resources) ?

You could use the SetMenuItemInfo (as suggested in the quoted link) to set only the itemdata ... without having to re-set the item text again.

--

 It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

 Best Regards,
 Tony

 

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empty/uninitialized and/or system-reserved ... unless you put something in it. That's why you actually *have to* modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus

Quote

Setting the Owner-Drawn Flag

    You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

    :

    By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

 You created popup menu straight by code, right (not using resources) ?

--

 It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

 Best Regards,
 Tony

 

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empty/uninitialized and/or system-reserved ... unless you put something in it. That's why you actually *have to* modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus

Quote

Setting the Owner-Drawn Flag

    You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

    :

    By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

 You created popup menu straight by code, right (not using resources) ?

 It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

 Best Regards,
 Tony

 

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empty/uninitialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus

Quote

Setting the Owner-Drawn Flag

    You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

    :

    By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

 You created popup menu straight by code, right (not using resources) ?

 It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

 Best Regards,
 Tony

 

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus

Quote

Setting the Owner-Drawn Flag

    You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

    :

    By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

 You created popup menu straight by code, right (not using resources) ?

 It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

 Best Regards,
 Tony

 

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus

Quote

Setting the Owner-Drawn Flag

    You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

    :

    By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

 You created popup menu straight by code, right (not using resources) ?

    It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

    Best Regards,
    Tony

 

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

I found this maybe useful quote:  https://docs.microsoft.com/en-us/windows/desktop/menurc/using-menus


Setting the Owner-Drawn Flag

You cannot define an owner-drawn menu item in your application's resource-definition file. Instead, you must create a new menu item or modify an existing one by using the MFT_OWNERDRAW menu flag.

:

By setting the appropriate members of the MENUITEMINFO structure, you can associate an application-defined value, which is called item data, with each menu item. To do so, specify the MIIM_DATA value for the fMask member and the application-defined value for the dwItemData member.

You created popup menu straight by code, right (not using resources) ?

--

It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

You created popup menu straight by code, right (not using resources) ?

--

It's a lot I don't play with this stuff, so everyone is very welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

You created popup menu straight by code, right (not using resources) ?

--

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

Quote

 

You created popup menu straight by code, right (not using resources) ?

--

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

cfr. https://docs.microsoft.com/en-us/windows/desktop/api/Winuser/ns-winuser-tagmeasureitemstruct

The

application-defined value associated with the menu item.

You created popup menu straight by code, right (not using resources) ?

--

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

You created popup menu straight by code, right (not using resources) ?

--

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

You created popup menu straight by code, right (not using resources) ?

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy/unintialized and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

[EDIT]
Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my previous answer is not useful.

Anyway, itemData is a "place" to put custom information and, by default, as far as I remember, it should be empy and/or system-reserved ... unless you put something in it. That's why you *have* to modify the resources' menu to set it explicitly.

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

[EDIT] Sorry, re-reading your message, you're already using ownerdrawn flag for your menu in resources ... so my answer is not useful.

Best Regards,
Tony

tonyweb

tonyweb

Just a quick thought/idea ... did you try to put/apply owner-draw flag also for menu item in resources?
This way it should send/call the WM_MEASUREITEM for every items and your processing should be the same.

It's a lot I don't play with this stuff, so everyone is welcome to correct me :)

Best Regards,
Tony

×
×
  • Create New...