The question combined with the forum discussion is a bit confusing. Are you trying to get the Itemid of the current page? Or are you trying to get the itemId of pages linked in the module?
Matt's answer will give you the Itemid of the current page (assuming it has one). So I am assuming that is not what you want (although using JInput is the new way).
The forum discussion mentions something about the default template always displaying which makes it sound like you want the Itemid of the pages that are linked from the module (not from the current page). Again it's confusing because you say it is a menu module and by definition links from the menu table will always have an itemid. But I think the main thing is that you want to use routing for your links so that the reverse lookup through the menu table that checks for menu items that match the request takes place.
You could look for example in the helpers for any of the articles modules.
Elin