windows-explorer

Windows Explorer right click context menu for files and folders

会有一股神秘感。 提交于 2019-11-30 15:26:56
my question is similar into this , but that didn't gave all info I need, or I didn't understand that very well. I want that in file context menu there would be option to notify my app. I added keys: HKLM/SOFTWARE/Classes/*/shell/MyApp/command::"C:\\path\\test.exe" "%1" HKLM/SOFTWARE/Classes/Folder/shell/MyApp/command::"C:\\path\\test.exe" "%1" Code of test: #include <iostream> int main(int argc, char *argv[]) { for (int i = 1; i < argc; ++i) std::cout << argv[i] << "\r\n"; system("pause"); return 0; } This works fine, but... If I mark a few files/folders and right click and select my added

How to re-use existing/already-opened Windows Explorer window to launch Explorer

依然范特西╮ 提交于 2019-11-30 05:32:32
问题 I have an application that makes frequent use of launching explorer.exe. I would like to re-use existing/already-opened explorer windows instead of creating a new one each time I start the process. Here is what my code looks like: System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo { UseShellExecute = true, FileName = "Explorer.exe", Arguments = myDirectoryPath }; System.Diagnostics.Process.Start(info); I didn't see a command-line switch to do this. One approach

Windows Explorer right click context menu for files and folders

萝らか妹 提交于 2019-11-29 22:06:22
问题 my question is similar into this, but that didn't gave all info I need, or I didn't understand that very well. I want that in file context menu there would be option to notify my app. I added keys: HKLM/SOFTWARE/Classes/*/shell/MyApp/command::"C:\\path\\test.exe" "%1" HKLM/SOFTWARE/Classes/Folder/shell/MyApp/command::"C:\\path\\test.exe" "%1" Code of test: #include <iostream> int main(int argc, char *argv[]) { for (int i = 1; i < argc; ++i) std::cout << argv[i] << "\r\n"; system("pause");

Tree view of a directory/folder in Windows? [closed]

这一生的挚爱 提交于 2019-11-29 18:48:02
In Linux/KDE, I can see a directory as a tree. How can I do it in Windows 7? Consider I do NOT mean "Windows Explorer". This just shows the directories, I also want the files. Janek In the Windows command prompt you can use "tree /F" to view a tree of the current folder and all descending files & folders. In File Explorer under Windows 8.1: Select folder Press Shift, right-click mouse, and select "Open command window here" Type tree /f > tree.txt and press Enter Use MS Word to open "tree.txt" The dialog box "File Conversion - tree.txt" will open For "Text encoding" tick the "MS-DOS" option You

Script works in IDLE, but .py-file doesn't work

南笙酒味 提交于 2019-11-29 14:14:55
问题 I have a tkinter script, which runs just fine in IDLE. However, when I double click the .py-file from Windows Explorer, the console window flashes half a second and then it exits. I was able to screenprint the console window. It says: ...etc.etc... NameError: global name 'simpledialog' is not defined simpledialog is a module in tkinter which I use in my script. As I do from tkinter import * , there is no need to explicitly write tkinter.simpledialog . It works in IDLE, why not as .py? 回答1:

C# adding context menu item to windows explorer for all file types

淺唱寂寞╮ 提交于 2019-11-29 12:03:08
I'm currently writing an application where I need to modify the context menu of windows explorer so that I can call a method within the application to be used on all files/folders that are seen in windows explorer. As there are already quite a few posts on stackoverflow (and also tutorials) on how to add the context menu for specific file types I know already that that is done usually by assigning the application to the right parts of the registry entry for those file types. As I don't want to limit myself to only specific filetypes my question is: IS there any way to assign this new context

Check if windows explorer already opened on given path

天涯浪子 提交于 2019-11-29 11:46:58
How can I see if windows explorer is already opened with certain path ? I don't want my application opens many duplicated windows. I was unable to do it with this way : var H: hwnd; begin if FileExists(edt8.Text) then begin H := FindWindow(0, PChar(ExtractFilePath(edt8.Text))); if H <> 0 then ShowMessage('explorer already opened')//explorer bring to front else ShellExecute(Application.Handle, nil, 'explorer.exe', PChar(ExtractFilePath(edt8.Text)), nil, SW_NORMAL); end; end; IShellWindows::FindWindowSW method There is a nice method FindWindowSW that should find an existing Shell window, which

Python: Get a list of selected files in Explorer (WIndows 7)

喜夏-厌秋 提交于 2019-11-29 11:16:33
At work I can select multiple .xlsx files, and right clicking on one file will give me the option of combining the files to make a .pdf. Now I want to use the same functionality in one of my scripts. That is, selecting multiple files and send the paths of these files as arguments to a Python script. I've spent soon an hour searching for solutions, but I haven't found any good answers. It seems there are some C# answers, but I don't know how to convert the code to Python. Is it even possible to achieve it at all? Edit - Sample script: import sys, os for file in sys.argv: print(file) os.system(

How to refresh Windows Explorer

旧城冷巷雨未停 提交于 2019-11-29 11:15:55
A network volume's name can be changed. I changed the name to Spinal Disk To change a network name, I do Write new name in Registry. Attach my network volume using functions like DefineDosDeviceW. In this timing, Windows explorer read registry in my guessing. SHChangeNotify(SHCNE_DRIVEADD, SHCNF_PATH, root, NULL); // To be sure. SendMessageTimeout(HWND_BROADCAST, WM_DEVICECHANGE, message, (LPARAM)(&dbv), - SMTO_ABORTIFHUNG, 200, &dwResult); // To be sure again! It works, but sometimes doesn't work even though I use SHChangeNotify and WM_DEVICECHANGE to be sure. Sometimes, the new name is not

Get Path in a ListBox of all Open Explorer Windows

本秂侑毒 提交于 2019-11-29 06:45:06
I want to list all open Windows Explorer windows with their active path in a ListBox . The app should refresh the ListBox if the explorer window is navigated to a different path. For e.g. two explorer windows are open. One is navigated to C:\Windows and the other is navigated to D:\Stuff . When the app it run, it adds C:\Windows and D:\Stuff to the ListBox . Then, the user navigates to a different folder in one of the open explorer windows like C:\Windows\system32 . The app should then refresh the ListBox and list C:\Windows\system32 and D:\Stuff instead. I don't have any ideas on how to do