You don't really need the variable res:
```
    if (!GetMenuItemInfo(menu, idx, TRUE, &itemInfo)) {
        return false;
    }
```