windows-shell

How to add submenu items to the Windows Explorer context menu?

江枫思渺然 提交于 2019-12-04 08:38:23
I can create a menu item in the Windows Explorer context menu by adding keys in the registry to HKEY_CLASSES_ROOT\Folder\shell . How can I create submenu items to the just created menu item? I believe anything non-trival you'll have to create a Context Menu Handler . You'll have to create a COM object that will create the menus and carry out the commands as they're clicked. I've only done this using C++ and COM. I'm not sure if there are easier ways to do this. Use SubCommands "SubCommands"="[NameOfMenu]" Example for creating submenu for .TS files: [HKEY_CLASSES_ROOT\SystemFileAssociations\.ts

Find the path used by the command line when calling an executable

孤街醉人 提交于 2019-12-04 05:52:12
问题 I am experiencing the following problem: I would like to run ecd.exe from a command-line. I have added its full path to the 'path' environment-variable. When calling ecd.exe from command-line, I get the following output: Error: ecd.exe should be located under the Eclipse home directory. This executable runs correctly when I add its full path in the command-line. I've figured that an identical file exists in some other path folder. But I have not been able to find it anywhere within the file

How to add(enable) standard “Send To” context menu option in a namespace extension

拟墨画扇 提交于 2019-12-04 05:50:56
问题 I have a namespace extension, which provides a virtual view of files/folders in a server. In the IContextMenu::QueryContextMenu() I have added some of the custom menu items. I have also set couple of SGAOF flags in the IShellFolder::GetAttributesOf() to get the rename, delete, and properties, in the context menu. Is there any way I can get the " Send To " option in the context menu for items in my namespace extension? and How do I handle these commands once these are enabled?. Please advise.

Get list of selected files from Windows Desktop

▼魔方 西西 提交于 2019-12-04 03:21:24
I am trying to get a list of selected files from the Windows Desktop and the Explorer Windows. The requirement is that I should be able to retrieve the current selection from the active explorer window or the Desktop. I have managed to put together the following code, after going through online resources, but it does not provide a list of selected items from the Desktop. ArrayList selected = new ArrayList(); var shell = new Shell32.Shell(); IntPtr handle = IntPtr.Zero; handle = GetForegroundWindow(); int intHandle = handle.ToInt32(); //For each explorer foreach (InternetExplorer window in new

Check if a php script is still running

試著忘記壹切 提交于 2019-12-04 01:26:47
I have a script that listens to a jabber server and responds accordingly. Though it's not supposed to stop, last night it did. Now I want to run a cron job every minute to check if the script is running, and start it if not. The question is, how do I check if a particular script is still running? Some solutions have been posted here , but those are all for Linux, while I am looking for a Windows solution. Any ideas please? Thanks. A quick and dirty workaround could be for the script to update a row in a database with a date column set to CURRENT_TIMESTAMP. Have the cron second script check if

How does one add a secondary verb to a file type in Windows shell?

孤者浪人 提交于 2019-12-03 17:39:33
问题 The basic idea with Windows shell programming is that you can associate a given file type (extension) with what MS is currently calling a progid (e.g. Company.Type.Ver): HKCR\.txt @=Acme.Text.1 HKCR\Acme.Text.1 @=This is the progid for text file associations for Acme And then Acme Corp can put as many shell verbs as they want as subkeys of HKCR\Acme.Text.1\shell such as HKCR\Acme.Text.1\shell\open. But if I'm XyzCorp, how do I add a secondary verb to text files? I don't want to usurp the

Why aren't Shell_NotifyIcon balloon tips working?

*爱你&永不变心* 提交于 2019-12-03 16:14:01
According to everything I've seen, the following C++ program should be displaying a balloon tool tip from the tray icon when I left-click in the application window, yet it's not working. Can anyone tell me what I'm missing? This is on XP with version 6.0 of Shell32.dll (verified with DllGetVersion). Thanks! #include "stdafx.h" #include "shellapi.h" LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { MSG msg; WNDCLASS wc; memset(&wc, 0, sizeof(wc)); wc.lpfnWndProc

Send text to standard input of a Windows console app

感情迁移 提交于 2019-12-03 16:11:17
I am trying to write a .bat file to automate some shell commands. Most of the commands are easy and I can just put them into the batch file directly, but there is one command which instead of taking command line parameters, expects you to type in the options you want using "the standard input". I'm not exactly sure what that means. Can someone tell me how to do this? The text I would like to be entered is the contents of one of the files in the directory: "options.txt" which I want to concatenate with a variable inside the batch file "$(additionaloptions)". Make sense? The usual way to do this

How to write a shell extension in C++?

故事扮演 提交于 2019-12-03 15:33:22
问题 This seemed like a common question but after doing some searching, I wasn't really able to find my answers. There is an article on this here: http://www.codeproject.com/KB/shell/shellextguide1.aspx But it's for a very old version of Visual Studio. I'm using VS 2008, so the instructions and interfaces don't seem to match what I'm seeing. I want to create a simple shell extension using C++ that creates a context menu for files with extension .GZ. When right clicking on these files, I should be

Accessing thumbnails that don't exist

旧时模样 提交于 2019-12-03 11:33:23
I have made an application that presents you a list of files in your computer. Whenever you click any item in the list, a small PictureBox next to it should show the thumbnail of the corresponding file. I am using C# on Windows 7. To obtain the thumbnail, I've recurred to a method posted in a different question. First, I reference the Windows API Code pack. Then, I use the following code: ShellFile shellFile = ShellFile.FromFilePath(fullPathToFile); myPictureBox.Image = shellFile.Thumbnail.LargeBitmap; This doesn't always work. Sometimes, the thumbnail shown is merely the 'default application'