You can use the Project.Items View Active property. It tells you when you have the items view active so you can reverse the logic to know when you have the Files view active.
The trick is you need to have the code run for both Items and Provider level OnPopupMenu code since on the files pane, folders aren't treated as items. If you just add the code below to your items OnPopupMenu, you'll see the popup box when you right click on files but not folders.
George M
National Instruments