I am making an advanced clipboard program, and I managed to do the part where it remembers a list of copied items, but I need to manage that content being pasted in as well.
I tried and failed to find a way to detect a paste from the clipboard, so now I'm trying to add the copied out items to a context menu dropdown item in the Windows context menu.
So far however I only managed to find a way to add items to the Folder key in regedit, which doesn't help when I need to paste in text into a textbox, or notepad.
Is there a way to do that?
I'm working in C# in .NET 4.0 on a Win 8.1 x64 PC
EDIT:
My point is to gather everything that is being copied/cut to the clipboard, and then to be able to paste specific lines from that list into an editable text container.
Either in automatically in the same/reverse order of them being copied or manually via a dropdown menu in the windows context menu, containing each line on my list.
Related
I'm trying to add a Windows Shell shortcut (right click context menu item) so anywhere in Windows, when I have text selected this item will appear. I cannot find the Registry item to alter/add or what to put there to get this to occur.
The selected text needs to also be passed to my application as an argument some how. I will be selecting some ID numbers, then manipulating those in the project.
Any assistance is greatly appreciated.
As far as I know, there is no way to create the shell extension which will allow you to inject into the any textbox's context menu.
The most you can do is to hook up the window creating API, filter out everything except context menu creation (WPF windows go down) and then do whatever you want to.
Hi I am currently creating a C# windows program and I am trying to add a right-click menu to the desktop everything is being added to the registry correctly but when I right click the desktop it wont display all menu items on some, its like it has a limit on how many items are aloud is their a way to overcome this? BTW I am adding it all through RegistryKey.
here are some images of the problem...
as you can see it shows three Items but their should be more...
this one shows missing items in the third item
this is a pic of the registry items
any help on this matter will be appreciated, also I have tried to use sharpshell but have failed to get that working, I have limited knowledge of C# but I am learning and have not worked with C++.
I have visual studio 2017. In an older project in few combo-boxes there are items entered in design mode (countries, etc...).
I would like to copy this items and paste them in combo-box in new projects, but I don't know how this could be accomplished.
I can create text file and add items with code, but if I want to add them in design mode I could do this one item per line. Is there some property that I didn't enable?
Thanks
Follow these steps to add items to combobox in designer mode:
Add a combobox.
Right-click and click properties.
In the Properties tab, scroll down to 'items'.
You will find 'collection' written on its extreme right.
Click on the small button to its right(The on with three dots).
A box will open up.
Enter the items in it.
Remember, a new item on every line.
If you have required items typed in a .txt file, you can copy and paste it in this dialog.
Enter new item on new line.
DONE!
EDIT:
As of today, there is no possible way to populate combobox with a text file in the Visual Studio's designer mode itself.
If you need help with code to populate combobox with text file, you can edit the question or comment this answer and I'll be happy to help you.
I am trying to create a app which uses winapi using pinvoke, this application reads menu structure of notepad. I got the whole menu structure using "GetSubMenu" and getting the text of menuitem using "GetMenuString"
In my app, I created same menu structure based on the structure I got from notepad. I would like to create functionality in my application such that when a user clicks on menu in my application it will click the corresponding menu in the notepad. How can I achieve this, I have tried tons of things but nothing seems to work. I tried using SendMessage, PostMessage but not sure how to use them.
Sorry if I have asked an already asked question, but a guidance would be highly appreciated.
EDIT:
As I said I create menu structure based on the menu structure I get from Notepad using GetMenuString, I want to send click to the menuitem in Notepad using MenuItemID, I don't want to click on particular coordinates, but on a particular menu.
I have a desktop app which after taking input from the user displays a list of files and folder(using a ListBox).
I want that when the user right clicks on any item in the ListBox, the right click menu of windows explorer should display.
I know I will have to use P/Invoke for this, but I am unable to find any relevant information such as which dll I have to use or which function I have to call.
Can anybody help me with that?
So this question is very old but has no accepted answer. I dont think Visionstar understood the issue OP is having.
My understanding is that you have an application running, and you would like to add an option in the WINDOWS EXPLORER's right-click menu. Not in your own application's context menu.
I do not think you can achieve this within your own application, however, what you can do is add an item in the Windows explorer's context menu (nothing to do with your application, you can just do that in windows; see link below) that you can setup to call a little script you would make (literally a little batch file... but could be a .net app too). That little script can take care of warning you main application. By creating a text file, or json file in a hot folder, or some other mechanism you would have to come up with.
Adding an item in the windows' contextual menu:
How add context menu item to Windows Explorer for folders
If you need to deploy this to other PCs, you can make a add_menu.reg file to make it simpler. I'll let you Google that one, but I think it's as simpe as a right-click -> export key in your regedit.
You will need to code it yourself, there is no embedded way simply add a OS-Contextmenu to it,because you have programmed the listbox, so you have to append some contextmenu to the listitem-rightclicks
Here are examples/guidance for adding a context menu:
http://msdn.microsoft.com/en-us/library/aa984254%28v=vs.71%29.aspx
http://social.msdn.microsoft.com/Forums/windows/en-US/790cd8be-0ba8-4f10-95a8-c88f1023d6e7/how-can-i-create-a-rightclick-menu-i-c?forum=winforms