contextmenu

How to add a “open git-bash here…” context menu to the windows explorer?

一个人想着一个人 提交于 2019-11-26 11:55:00
问题 How to add a context (aka right click) menu to the windows explorer that, when clicked, opens the git-bash console in the current explorer folder? 回答1: I had a similar issue and I did this. Step 1 : Type "regedit" in start menu Step 2 : Run the registry editor Step 3 : Navigate to HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell Step 4 : Right-click on "shell" and choose New > Key. name the Key "Bash" Step 5 : Modify the value and set it to "open in Bash" This is the text that

Add menu item to windows context menu only for specific filetype

試著忘記壹切 提交于 2019-11-26 11:13:52
i've dveloped an application that load an image using the context menu of window (right click on the file) and for the moment is working, but the reg key is on HKEY_CLASSES_ROOT\* and it works with all files. I want that the menu item on the context menu should be displayed only with .jpg files. Whow i can do that? Which registry keys i should use? Thanks in advance. Factor Mystic 1) Identify the file type (ProgID) for .jpg files This can be done by checking the default value of HKEY_CLASSES_ROOT\.jpg . It could be anything based on what you've installed, but for the purposes of this example,

Select TreeView Node on right click before displaying ContextMenu

ε祈祈猫儿з 提交于 2019-11-26 10:20:38
问题 I would like to select a WPF TreeView Node on right click, right before the ContextMenu displayed. For WinForms I could use code like this Find node clicked under context menu, what are the WPF alternatives? 回答1: Depending on the way the tree was populated, the sender and the e.Source values may vary. One of the possible solutions is to use e.OriginalSource and find TreeViewItem using the VisualTreeHelper: private void OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) {

How do I create a right click context menu in Java Swing?

独自空忆成欢 提交于 2019-11-26 10:15:22
问题 I\'m currently creating a right-click context menu by instantiating a new JMenu on right click and setting its location to that of the mouse\'s position... Is there a better way? 回答1: You are probably manually calling setVisible(true) on the menu. That can cause some nasty buggy behavior in the menu. The show(Component, int x, int x) method handles all of the things you need to happen, (Highlighting things on mouseover and closing the popup when necessary) where using setVisible(true) just

C# Windows 'Open With >' Context menu behaviour [duplicate]

我的未来我决定 提交于 2019-11-26 09:52:17
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Filetype association with application (C#) I\'m writing a C# Windows app to visualise and modify \'.build\' files (nant scripts). I would like the user to be able to right click on a .build file in windows explorer and select the \'Open With >\' option to allow the file to be modified in my app. What does my program need to support in-order to work with this mechanism? What might my program need to do to Windows

How can I add a context menu to the Windows Explorer for a Java application?

筅森魡賤 提交于 2019-11-26 09:34:38
问题 How would one go about adding a submenu item to the windows explorer context menu (like for example 7-Zip does) for a Java application? 回答1: I am aware of two ways to do it. The fancy way is to write a windows shell extension, which is how powerarchiver, winzip etc do it I believe (this involves running code to determine what the context menu items will be dependent on the file chosen). The simple way, for simple functionality, is you can add an entry in the registry : HKEY_CLASSES_ROOT\<file

How to retrieve the element where a contextmenu has been executed

做~自己de王妃 提交于 2019-11-26 09:23:28
问题 I am trying to write a google chrome extension where I use a contextmenu. This contextmenu is available on editable elements only (input texts for example). When the contextmenu is clicked and executed I would like to retrieve in the callback function the element (the input text) on which the contextmenu has been executed in order to update the value associated to this input text. Here is the skeleton of my extension: function mycallback(info, tab) { // missing part that refers to the

Creating dynamic context menu in Chrome Extension is failing

我们两清 提交于 2019-11-26 08:09:59
问题 I am trying to create entries on the Chrome context menu based on what is selected. I found several questions about this on Stackoverflow, and for all of them the answer is: use a content script with a \"mousedown\" listener that looks at the current selection and creates the Context Menu. I implemented this, but it does not always work. Sometimes all the log messages say that the context menu was modified as I wanted, but the context menu that appears is not updated. Based on this I

How to create context menu for RecyclerView

只愿长相守 提交于 2019-11-26 07:55:45
问题 How do I implement context menu for RecyclerView? Apparently calling registerForContextMenu(recyclerView) doesn\'t work. I\'m calling it from a fragment. Did anybody have any success implementing this? 回答1: You can't directly implement these method like onClickListener , OnContextMenuListener etc. because RecycleView extends android.view.ViewGroup . So we cant directly use these method. We can implement these methods in ViewHolder adapter class. We can use context menu in RecycleView like

Detecting which selected item (in a ListView) spawned the ContextMenu (Android)

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 07:20:35
问题 I have a ListView that will allow the user to long-press an item to get a context menu. The problem I\'m having is in determining which ListItem they long-pressed. I\'ve tried doing this: myListView.setOnCreateContextMenuListener(new OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, final View v, ContextMenuInfo menuInfo) { menu.add(\"Make Toast\") .setOnMenuItemClickListener(new OnMenuItemClickListener() { @Override public boolean onMenuItemClick