How do I retrieve / iterate Win11 IExplorerCommand context menu items? - contextmenu

About five years back, I wrote a program for a customer which effectively re-created the Windows Explorer context menu inside the program -- if they clicked on the object representing their data file, it showed the context menu they'd see in Explorer, including the Dropbox sharing menu items. (The mechanism is similar to the one here: https://github.com/linquize/explorerplus-custom/blob/master/Explorer%2B%2B/Helper/ContextMenuManager.cpp -- finding all the IContextMenu COM objects from the registry and querying each in term to add their menu items.)
This has worked fine all this time... but Windows 11 has changed things, and the new version of the Dropbox client (v159) has broken backwards compatibility.
To sum up, the old-style IContextMenu COM objects could all be queried under HKEY_CLASSES_ROOT*\shellex\ContextMenuHandlers (or similar locations), but the new short-form context menu on Win11 uses IExplorerCommand objects instead. Explorer includes them on the old-style context menu as well as the IContextMenu iterations -- in Dropbox's case this led to a bug which caused the menu items to be duplicated. They seem to have just fixed this in v159 by suppressing the IContextMenu items... meaning they don't show up in my menu any more.
So how can I find and iterate all the IExplorerCommand objects which are added to the new short-form context menu? Including the cloud-provider commands from apps like Dropbox?
For what it's worth, I can find class IDs for the Dropbox items in their AppxManifest.xml:
<Extensions>
<desktop3:Extension Category="windows.cloudFiles">
<desktop3:CloudFiles>
<desktop3:CloudFilesContextMenus>
<desktop3:Verb Id="Dropbox01UpgradeCommand"
Clsid="F3BC3DAF-431B-4F0E-B105-E9BB76335840" />
<desktop3:Verb Id="Dropbox02ShareCommand"
Clsid="7F4C5B83-2680-40AF-9AE9-2161AA759EF2" />
And it also defines the COM server they're running on:
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:SurrogateServer AppId="67233DFC-D70F-4D8E-A068-6877D86826BC"
DisplayName="ms-resource:ShellExtensionServerDisplayName">
<com:Class Id="7F4C5B83-2680-40AF-9AE9-2161AA759EF2"
Path="DropboxExt64.55.0.dll" ThreadingModel="STA" />
<com:Class Id="F3BC3DAF-431B-4F0E-B105-E9BB76335840"
Path="DropboxExt64.55.0.dll" ThreadingModel="STA" />
And these entries are visible under HKEY_CLASSES_ROOT\PackagedCom, e.g:
[HKEY_CLASSES_ROOT\PackagedCom\Package\DropboxInc.Dropbox_159.4.5870.0_x86__wkt425jdc3sga\Server\0]
[HKEY_CLASSES_ROOT\PackagedCom\Package\DropboxInc.Dropbox_159.4.5870.0_x86__wkt425jdc3sga\Class{7F4C5B83-2680-40AF-9AE9-2161AA759EF2}]
[HKEY_CLASSES_ROOT\PackagedCom\Package\DropboxInc.Dropbox_159.4.5870.0_x86__wkt425jdc3sga\Class{F3BC3DAF-431B-4F0E-B105-E9BB76335840}]
...but I can't even co-create an IUnknown for any of these class IDs -- even within a shell extension running within Windows Explorer, let alone my own app. I get an HRESULT error 0x80040154 (-2147221164)
Basically, how do I locate these items? (Note that if I use ICatInformation::EnumClassesOfCategories(), the Dropbox items aren't defined with category information.) If there's no way to construct a complete list, is there at least a way to access known objects like the Dropbox ones?

Related

Item name assignment in lang file not behaving as documentation suggests

I am trying my hand at creating an Add-On for Minecraft Bedrock edition on a Windows 10 PC, v 1.18.12 . I've successfully created an item that I can get to appear in the game (yay, me!), but the item name is working oddly. According to the documentation at https://wiki.bedrock.dev/guide/custom-item.html the name should be set in the resource pack's en_us.lang file using
item.NAMESPACE:THING.name=THINGNAME
but when I do that the item shows up in my Minecraft test world as item.NAMESPACE:THING, and the only way I can get the name to actually appear in Minecraft is to drop .name, i.e. set
item.NAMESPACE:THING=THINGNAME
after which the item is labeled as THINGNAME within the test world. Is this expected behavior? The Vanilla Resource Pack at https://github.com/ZtechNetwork/MCBVanillaResourcePack has its .lang files set up with the .name suffix, consistent with the bedrock.dev instructions I linked to above, so I don't get what's going on here, and based on my programming experience I'm concerned that excluding the .name suffix may have negative side effects. Any insight into what's going on would be appreciated.

Adding new "tab" to a bug work item in TFS 2017

I am trying to add a new "tab" to bug item in TFS 2017. Looking at the "tabs" you see things like "Steps to Reproduce", System, etc.
I have found information on changing work item types but nothing about adding a new "tab" across the top where you see Steps to Repro, System, Test Cases, Tasks. The change I want to make may not be possible? Or it is possible I don't know the correct verbiage to use when asking google. The think I want to change may not be a tab control at all it maybe something else different.
Thanks
***************** Updated questions after posting *****************************
After playing around with Process Editor -> WIT -> Open WIT from server -> Bug
as suggested by Andy Li-MSFT I don't see a lot of control on the formatting on the tab. I was planning to add fields in a grid like pattern like a table as shown below. I am able to get the values in the drop down list for field1 and add the fields. However I have a couple follow up questions if you have time.
Setting either the control or column for the control to read-only the column will not render when adding a new bug. I have a little more control if I set AllowedValues and Frozen for the column however the value can still be changed. Is there a better way to set read-only?
There is not much control on the layout. I am OK adding a lot of fields but would like them to be displayed in a table like structure. Is there a way to control the look of the fields on the form?
Is there a way to add the fields in a grid? This would be ideal so I only have one header for each column.
The last-updated-by and last-updated-date. Is it possible to track on a row level who made a change? If not I would be OK just adding a last updated by and last updated date to the new tab. Row level updates would be nice.
<pre>
Field 1 Field 2 (Read-only) Field 3 Last Updated By Last updated Date
Status (completed, empty, N/A) "Some text here which describes something to do" "Optional comments" tfs user name date/time
Status (completed, empty, N/A) "Some text here which describes something to do" "Optional comments" tfs user name date/time
</pre>
You need to modify the WIT definition file (Bug work item type in your scenario).
You can try below ways to do that:
Export the WIT definition file with witadmin commands, add a new tab under <TabGroup> and add a new control for it, then save and import the file. See Import, export, and manage work item types for details.
e.g:
<Tab Label="Tab0501">
<Control FieldName="System.ChangedDate" Type="DateTimeControl" Label="Test0501:" LabelPosition="Left" />
</Tab>
You can also use the TFS Power Tools to export/import WIT definition files or directly modify the files from server:
Visual Studio 2015 : Microsoft Visual Studio Team Foundation Server
2015 Power Tools
Visual Studio 2017 : TFS Process Template Editor
Reference below screenshot to do that.
Another way is writing an extension to Extend the work item form, you can reference my answer in another thread to do that.

How to localize UI files in PySide

I created an application which loads its UI dynamically from UI files (added to resources of application. I have't translate in with poyside-uic, loading as is. now I want lo localize application, but do not understand how.
I tried to generate TS file using pyside-lupdate widge1.ui widget2.ui ... -ts my.ts and got document with multiple context nodes and linguist does not shows all records (only about 7 records and I do not understand which exact).
So, my question: how to translate dynamically loaded UI files?
Found it. Quite simple, but not always obvious.
Execute pyside-lupdate file1.ui file2.ui .... fileN.ui -ts translations\ru_RU.ts. Got a TS file after that with multiple contexts (it is ok, I was wrong)
Open TS with linguist. Ensure that option 'Context' checked in menu "View->View"
...
PROFIT!!!

How to keep editor alive in Virtualtreeview?

I'm trying to build a simple 2 columns grid "property editor" based on VirtualTreeView.
(I want to mimic look and user experience seen on Delphi's IDE object inspector)
The component is working almost and can handle multiple editors,
but I'm facing an annoying bug :
When I click on a new node (a new row), the node is selected and the editor appears, regardless of the column I've clicked on. It's expected and OK.
Then, when I click on the first column of the same row, I expect to see my editor content validated and the editor keeping focus (like in delphi's object inspector).
But the editor content is validated then it disappear and the entire node (row) is selected. The editor won't get back (even if I click on second column), until I select another node and click back on the previously selected node.
EDIT : added illustration and precision about my code.
about the code :
I do not have inserted code here because I used (as a starting point) the exact same code as the one found on Advanced Demo (properties page)
What I tried and found out :
the 2003's compiled Advanced demo (properties tree page) found here seems to works like what I expect from my component (and from virtual treeview).
But when I compile this same demo (I tried with versions 4.5.2, 4.8.7 and even 5.0.0 from current trunk on google code, on both delphi 2007 and 2009) the bug reappears !
I first think there was a documented breaking change between 2003 and more recent versions,
but I can't find anything.
I've also played with all available options trying to solve this, but without success.
I still don't know if this problem comes from new delphi RTL or a breaking change (bug?) in virtualtreeview.
so my questions :
do you have the same problem when compiling Advanced demo ?
any tip or workaround in code to solve my problem ?
As a side note, I nearly give up with virtualtreeview this afternoon and I wanted to try a solution with another component... I found this interesting question and decided to try berg's component, but was stopped in the buying process when reading an advice on their homepage (see my comment on the related question)
The VSTs onChange just gets called by changing the selection of nodes. The state will not change anymore, if the node is already selected. So, you have to implement a behaviour similar to Object Inspector on your own, e.g. by calling VSTs EditNode()-Method in the OnClick-Callback:
procedure TMainForm.VSTClick(Sender: TObject);
var node: PVirtualNode;
begin
node:= VST.GetFirstSelected();
if(node <> nil) then
VST.EditNode(node, EDITABLE_COLUMN_INDEX);
end;

How I can add some items to the code completion combobox of the Delphi IDE

I'm working in a Delphi IDE expert and I wonder if it's possible add new items to the code completion combobox displayed by the Delphi IDE when the user press CtrlSpace
UPDATE:
What I need is add items to the code completion list based in a specified type.
example suppose which I have a type called TMytype, what I want to do is add addional items to the code completion list when the user type a variable of the type TMytype
check this image
I found your question somewhat confusing but if you are in search of credible source on "Custom Live Templates" and the like on Delphi, head to the blog of Cary Jensen here.
Edit:
Looking forward to further improvement of the scope of the question, I suggest here another direction to explore:
Source code manipulation using IOTAEditor, IOTASourceEditor, IOTAEditReader and the like
Some Parsing for sanity check prior to apply any modification.
Adoption of Client DataSet as a format to store data (It's serializable) to simplify the coding of IDE editors.
Perhaps I haven't fully grasped the extent of what you are asking here, but you can add templates simply by going to 'View|Templates' from the Delphi IDE. This then opens a template viewer. Press the '+' icon. It opens a template1.xml document which you can then edit so create your new item.
If you wish to do this programatically, just add an xml file (of the same format) to the ..\RAD Studio\code_templates folder.

Resources