ljac
asked on
Unique IDs for menu items and dialog controls
I am desperate for answers to these questions. I am writing an application that will return a numeric unique ID that belongs to a control. I know can get the controls numeric ID with the function GetDlgControlID. If it is a menu, I know I can get an ID with the function GetMenuItemID. The problems I have are as follows:
Problem 1: GetMenuItemID works fine if I specify the position of the menu item in the menu or submenu. However, if I want to receive a unique identifier for a top-level menu or a submenu, GetMenuItemID does not work. GetMenu and GetSubmenu only returns handles, while what I need is a unique identifier. Anyone knows how to do get the unique identifier of a top-level menu or a submenu (not just the handle)?
Problem 2: GetDlgControlID works fine except for when I need to get the unique identifier of a label. Then the function returns nothing or zero. Also, if a control is in a group frame, the function seems to return the identifier of the frame control and not for the individual controls within the frame. Anyone knows how to return values for labels or for controls within a group frame?
(The reason I need the unique ID is to eventually search a given header file *.h to find the ID_SOMESTRING defined for a particular numeric number.)
I would greatly appreciate fast replies, as I need it for student work.
Thanks,
Lene Jacobsen
Problem 1: GetMenuItemID works fine if I specify the position of the menu item in the menu or submenu. However, if I want to receive a unique identifier for a top-level menu or a submenu, GetMenuItemID does not work. GetMenu and GetSubmenu only returns handles, while what I need is a unique identifier. Anyone knows how to do get the unique identifier of a top-level menu or a submenu (not just the handle)?
Problem 2: GetDlgControlID works fine except for when I need to get the unique identifier of a label. Then the function returns nothing or zero. Also, if a control is in a group frame, the function seems to return the identifier of the frame control and not for the individual controls within the frame. Anyone knows how to return values for labels or for controls within a group frame?
(The reason I need the unique ID is to eventually search a given header file *.h to find the ID_SOMESTRING defined for a particular numeric number.)
I would greatly appreciate fast replies, as I need it for student work.
Thanks,
Lene Jacobsen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"Problem 1" and second part of "Problem 2" was not solved
I don't understand why getMenuItemId does not work. I'll see if I can look into that.