Drag and drop to Desktop / Explorer

DragDrop.DoDragDrop can do this as long as you pass it an appropriate DataObject. First copy the files somewhere. You can use System.IO.Path.GetTempPath() if you don’t have anywhere better. Next create a string array containing the full paths to the files and do the following: string[] paths = …; DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, paths), DragDropEffects.Copy); It is … Read more

Gracefully Exit Explorer (Programmatically)

I debugged this out of curiosity. All it does is post a message to one of explorer’s windows: BOOL ExitExplorer() { HWND hWndTray = FindWindow(_T(“Shell_TrayWnd”), NULL); return PostMessage(hWndTray, 0x5B4, 0, 0); } Of course this is an undocumented WM_USER message so the behavior could quite possibly change in the future.

How to remove git from menu context in Documents?

I Think I’ve found other reference about it. I’ve delete mine on HKEY_CLASSES_ROOT\LibraryFolder\background\shell Based on https://stackoverflow.com/a/32490883/4906348, Quite simple, I never think about it. You should see like this. From This To This. It works. Note For Windows 10, there may be also keys in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell and/or HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell which you may have to delete as well.

tech