Access windows control panel items (applets) via c# code - c#

I am new to this and i have a small task. I want to access the control panel items, perform search and display their name, description and task lists etc what ever I can access in my window. Something similar to what windows explorer search does.
This is what I have done till now. I followed the approach here and I am able to access the cpl files in System folder. But they are not all the cpl files. And hence my result ends up being a subset of the desired result set.
Also by accessing the cpl files I do not get the task list and other details which are valuable in my search operation. Please see image for the result i want
This result appears when i search for display inside the control panel explorer.
What else should I try? Can someone guide me?
Thank you in advance.

Related

Microsoft Azure DevOps Repo: search for text/code in specific branch

I'm embarrassed to ask what should be a simple thing to figure out....
However, when I'm viewing a specific branch in an Azure DevOps repository online (e.g., when reviewing a PR), I can't figure out how to perform a search of that branch's code.
I see a global search textbox at the top, as follows:
And I see a textbox for searching the branch for file/folder names, as follows:
But what I don't see is a textbox for searching the contents of the files in that branch....e.g. for finding occurrences of someFunction() or somePropertyName or whatever inside the code files for that particular branch.
Did Microsoft really omit this functionality? Or am I missing something? How do we perform such a search?
First, input content in the global search textbox at the top and search:
Now, you can select your repo and branch the dropdown list:
By default, code search only applies to your default branch. You may add up to 5 more here:
Please notice that when a new branch is configured for search via “include/exclude searchable branches”, the branch list of search is not immediately populated with the newly configured branch. This happens because it takes some time to on-board a new branch and make is searchable. It takes up to 12 hours to fully initialize the branch.
You can also refer to this document about search your code.
what they aren't telling you (and I just went through this today) is that you have to have a "successful" search in order to get the Branch: filter to appear & be selectable. "Failed" searches give you all the filter dropdowns but you cannot change them.
In fairness you'd just be better off actually Doing a Pull and using git to search the code then ..

c# openfiledialog to select multiple files with same order as user selects

In my c# windows application, I like to get multiple files with a same order as user select the file in openfiledialog window. I'm getting all the selected file but its order is not correct. Anyone help me to solve this problem.
If you look at the documentation for the underlying control's interface OPENFILENAME, you'll see this comment:
If the user selects more than one file, the lpstrFile buffer returns the path to the current directory followed by the file names of the selected files.
And, other than some comments on the separator characters used for different scenarios, what to do if there's not enough buffer, and some details on legacy 8.3 support, that's it. In other words, the OpenFileDialog doesn't offer any mechanism to bubble up the sort information as the underlying Windows Common Dialog Box doesn't offer anyway to get this information out via a standard interface.
If you must preserve it, you'll need to create your own Form or Dialog to track the selection in order, and honestly you'll probably be better off providing an slightly different UI that allows the user to reorder files after they've selected them, similar to how one can reorder lists on some mobile devices.

WPF Download File Applications for multiple files

Firstly let me tell you that I searched in the internet, but could not get any help.
I need to develop an application where I need to show currently how many files are downloading and every files name, progress along with we have the option to cancel the download whenever we want. For better understanding I have attached an image the overall UI design. But I have a doubt that how at runtime I will keep appending files in the download Window? Suppose I am downloading a file, now after sometime i will start another file to download. How will I add that Download in the same window. Any ideas and codes and help would be a great help.
The data I will be getting from a cache in our application. the file name and how much bytes downloaded and total size everything is stored in the cache, but run time keep adding/removing the download Window is an issue. Help please
I would use an ObservableCollection to store the download information (file name, progress, etc.), then create a container (e.g. ListView) with an DataTemplate and then bind the collection to the control.
When you want add another file to the downloades files list, you simply add it to the ObservableCollection and it will automatically show up on the UI.

How to create context menu with the same choices as Explorer

I apologize if this has already been answered. I've looked and looked, and I can't find anything like what I want, which I find greatly surprising. Please feel free to give me a "This has already been asked" with a link... :(
I'm in the early stages of creating a program in C#. The main window will have a list of files which are relevant to my application. I currently have them in a list view, although I can switch widget types if necessary. What I'd like is to make it possible for a user to right-click on one or more of the file names which would bring up the same context menu as one would get in Explorer. With e.g. "Open", "Edit", "Print", and etcetera.
Obviously I could put stuff in a context menu manually, but I'd like it to have the same choices as one would have in Explorer. There will be Word documents and text files and various other odds and ends. I don't know how the list of actions in the standard Windows context menu is populated, especially considering that the list changes depending on the file type selected and whether more than one file is selected.
I can provide code if necessary, although I don't have anything interesting yet.
So my questions are - How do I get the list of actions one gets when right-clicking a file or group of files in Explorer? Is there a Windows API that I can call? Or do I aggregate choices that I read in the registry? And if so, what do I read? Or what?
As a bonus, I'd like to be able to add a few commands of my own to the menu only within my own application. Mostly all I can find is how to write an extension to the context menu such that I can add an action that appears always when clicking a specific file type. That is NOT what I want. This is a bonus though, and I can always add buttons or a drop down menu or something if this won't work or if it requires heroic coding.
I've found this article which describes the process for c++ but I think you will be able to transition it. Using the shell context menu
EDIT:
Here is another link to a project with ready to use code (C#):
Explorer shell context menu

Displaying Directory Structure in CheckedListBox C#

My ultimate goal is to allow a user to select what directories they want as a checkbox type thing. Can I display a drill down directory structure with checkboxes next to each folder using this control or should I got a different route?
Edit: More Information.
I have a Windows Form application in Visual Studio using c#.
It is to allow myself and some select friends automatically backup folders to amazon s3 on a daily basis.
I need to figure out how to display a computers directory structure which you can drill down into and check a box next to any folder you want.
That way the app will only backup folders you choose.
A CheckBoxList seems like the right way to go but I can't figure out how to make it a drilldown list. It seems to only display a list of items. What is another control I could try or another method I could explore?
if you need to show a hierarchy just use a TreeView with checkboxes.
you are not telling if you are in Windows Forms, WPF, ASP.NET, MVC etc... still there should be such "checkboxable" TreeView in all these platforms.
A CheckedListBox displays a flat structure. A TreeView would be more appropriate to present a nested directory structure.

Categories

Resources