Yes, you can get the window ID of the map frame by using LayoutItemInfo with the attribute LAYOUT_ITEM_INFO_WIN, which has the value 5. For example, if your map frame has a frame id = 1, then it would be
map_win_id = LayoutItemInfo(layout_win_id, 1, 5)
In version 17 MapBasic, you'll be able to pass a string name of a frame, and/or use a new function to get map, browser, and legend window IDs. For example, if you've given your map frame a name of "Map 1", then you will be able to use
LayoutItemInfo(layout_win_id, "Map 1", 5)
to get is window ID instead of having to know its frame ID.