This code is almost identical (except for menu instance?) to same case in appshell/cefclient_win.cpp, so create a function if possible. If not, then the comments for that code also apply to this code.