windows-shell

How can I display the 'Send to' and 'Open With' context menus?

 ̄綄美尐妖づ 提交于 2019-12-03 08:54:40
Some time ago I asked about how to pop up the Windows context (right-click) menu for a certain file in Delphi . However, even if everything works (almost) OK, the 'Send to...' and 'Open with...' submenus don't have any items, even if when I right-click in Explorer on the same file name they work OK. (For example, 'Send to...' has 'Desktop (create shotcut)', 'Email recipient' etc.). How can I make those menus appear? Rob Kennedy Raymond Chen wrote about this precise problem a few years ago in a many-part series about hosting a context menu. The key theme to his articles was that as you read the

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

不羁岁月 提交于 2019-12-03 07:26:06
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 primary file association - I'm happy for it to be associated to Acme.Text.1, but I want to add "Import into

How to write a shell extension in C++?

一曲冷凌霜 提交于 2019-12-03 05:08:25
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 able to click my context menu item and have a callback in code to do some sort of operation on that

What's the difference between *.bat and *.cmd file? [duplicate]

不问归期 提交于 2019-12-02 22:16:40
Possible Duplicate: Windows batch files: .bat vs .cmd? Hi, I am learning Windows Batch programming and come across this question: What's the difference between .bat and .cmd file? If they are the same, why need 2 of them? BTW, what's the difference between command.com and cmd.exe ? .bat files are left-overs from DOS. .cmd files are for Window NT command processor or higher, and have more capabilities (some looping structures, the ability to call and return from procedural type blocks). command.com was what ran the operating system and contained the internal commands like dir in DOS and early

How to create a right-click context shell shortcut “edit with Emacs”?

扶醉桌前 提交于 2019-12-02 17:10:16
Notepad++ automatically adds a shell shortcut so that when you're in Windows Explorer, you can right-click on a file and select "edit with Notepad++". How can I do the same with emacs? I am using GNU Emacs 22.3 for Windows. Here's what I have - similar to some other answer. Create a new text file somewhere called emacs-conextmenu.reg (or anything-you-want.reg) and paste the following in: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell] [HKEY_CLASSES_ROOT\*\shell\openwemacs] @="&Edit with Emacs" [HKEY_CLASSES_ROOT\*\shell\openwemacs\command] @="Absolute\\Path\\to\\your\\emacs\

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

纵然是瞬间 提交于 2019-12-02 12:16:23
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-system. How can I find the path used by the command line when calling this executable? @ECHO OFF

How to detect if a given PIDL is actually a .zip file or similar?

≯℡__Kan透↙ 提交于 2019-12-02 09:07:50
问题 VS2010 introduced CMFCShellTreeCtrl which allows for a folder-browser tree ctrl to be dropped into our MFC apps. However, there seems to be a serious lack of filtering capabilities in this class. i.e. it will build the list of container-objects (IShellFolder). But there doesn't seem to be a way to specify that .zip containers should not be displayed in the folder tree. It does supply a virtual that could be used crudely for this purpose: HRESULT CMFCShellTreeCtrl::EnumObjects(HTREEITEM

How to detect if a given PIDL is actually a .zip file or similar?

南楼画角 提交于 2019-12-02 04:12:37
VS2010 introduced CMFCShellTreeCtrl which allows for a folder-browser tree ctrl to be dropped into our MFC apps. However, there seems to be a serious lack of filtering capabilities in this class. i.e. it will build the list of container-objects (IShellFolder). But there doesn't seem to be a way to specify that .zip containers should not be displayed in the folder tree. It does supply a virtual that could be used crudely for this purpose: HRESULT CMFCShellTreeCtrl::EnumObjects(HTREEITEM hParentItem, LPSHELLFOLDER pParentFolder, LPITEMIDLIST pidlParent) { ASSERT_VALID(this); ASSERT_VALID

Which DLL has PathCchAppend?

自闭症网瘾萝莉.ら 提交于 2019-12-02 03:36:40
问题 I'm trying to conditionally use ( if available) the function PathCchAppend. I have got the function signature from header pathcch.h . However, when I try to get the address of function from SHLWAPI.DLL , it fails: auto pca = GetProcAddress(GetModuleHandle(L"shlwapi.dll"), "PathCchAppend"); Using Depends, I saw that this function does not exist in this DLL (I'm on Windows 10). There doesn't exist any pathcch.dll and hence cannot load it either. In which DLL this function is placed? EDIT:

Why does TypeName() return different results from .GetType and TypeOf when working with COM?

陌路散爱 提交于 2019-12-02 02:21:56
问题 I feel like I would benefit greatly from understanding the differences in how these functions work so that I could better understand when to use each one. I'm having a very difficult time working with two different interops (Excel, and EPDM) which have both made extensive use of weak typed parameters. I keep running into problems using returned objects and casting them to the proper type (per the documentation). After wasting a ton of time, I've found that using TypeName, GetType, and a