Created
August 13, 2017 14:06
-
-
Save tablacus/28107080cf7f7ecada993c7f6583ee32 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var FV = GetFolderView(Ctrl, pt); | |
| if (FV) { | |
| var hMenu = api.CreatePopupMenu(), hSubMenu; | |
| var ContextMenu = FV.ViewMenu(); | |
| if (ContextMenu) { | |
| ContextMenu.QueryContextMenu(hMenu, 0, 1, 0x7fff, CMF_DEFAULTONLY); | |
| var mii = api.Memory("MENUITEMINFO"); | |
| mii.cbSize = mii.Size; | |
| mii.fMask = MIIM_SUBMENU; | |
| for (var i = 0; i < api.GetMenuItemCount(hMenu); i++) { | |
| api.GetMenuItemInfo(hMenu, i, true, mii); | |
| if (mii.hSubMenu) { | |
| hSubMenu = mii.hSubMenu; | |
| mii.fMask = MIIM_FTYPE | MIIM_STATE; | |
| for (var j = 0; j < api.GetMenuItemCount(hSubMenu); j++) { | |
| api.GetMenuItemInfo(hSubMenu, j, true, mii); | |
| if (mii.fState & MFS_CHECKED && mii.fType & MFT_RADIOCHECK) { | |
| mii.fMask = MIIM_ID; | |
| api.GetMenuItemInfo(hSubMenu, j + 1, true, mii); | |
| if (mii.wID <= 0) { | |
| api.GetMenuItemInfo(hSubMenu, 0, true, mii); | |
| } | |
| ContextMenu.InvokeCommand(0, te.hwnd, mii.wID - 1, null, null, SW_SHOWNORMAL, 0, 0); | |
| break; | |
| } | |
| } | |
| break; | |
| } | |
| } | |
| api.DestroyMenu(hMenu); | |
| } | |
| } |
Author
tablacus
commented
Aug 13, 2017

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment