windows-shell

How to close Windows Explorer windows with opened folders from a certain drive

若如初见. 提交于 2019-12-07 16:55:29
问题 I'm writing a small app that will allow a user to eject (or safely remove) a USB drive. My app works fine, except the situation when a folder on the USB drive (or several folders) are opened in Windows Explorer. In that case the eject function fails as the drive appears to be locked. So I'm curious, since the user is issuing a command through my app to eject the USB drive, is there any way to make Explorer close those open windows from the USB drive? PS. Note that I don't want to close all

Why/how are Registry Entries Hidden in Regedit but visible in PowerShell?

*爱你&永不变心* 提交于 2019-12-07 06:17:08
问题 I'm working with a new property schema, and have been in the habit of checking the registry when I register or unregister a new version. One of the primary places to check this is HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\PROPERTYSYSTEM\PROPERTYSCHEMA . Interestingly, I occasionally lose access to this registry location in Regedit. I see see this (note the absence of PropertySchema): I know the schemas are still registered, because I can use the prop.exe tool and propschema

icon overlay handlers for namespace extension

随声附和 提交于 2019-12-06 14:50:59
I am developing namespace extension which gives a virtual view of files on a server. In this view, I need to provide different states(in use, offline, out of sync, etc) of a file using overlay icons. I was read through article implementing overlay handler, and thought I will try to handle this in one of our overlay handlers, which implement IShellIconOverlayIdentifier interface. I see that IShellIconOverlayIdentifier::IsMemberOf(), and other functions are called only when I access files on normal filesystem, i.e., c:\, d:\ etc. When I browse a namespace extension, these calls are not called at

How can I get large icons for a file extension using Windows shell?

时间秒杀一切 提交于 2019-12-06 07:43:39
问题 I have found various articles on getting the system images for a file or even file extension. I have the belows methods which are working for obtaining small 16x16 and large 32x32 images. // DLL Import [DllImport("shell32")] private static extern IntPtr SHGetFileInfo( string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbFileInfo, uint uFlags); // Constants/Enums private const int FILE_ATTRIBUTE_NORMAL = 0x80; private enum SHGetFileInfoConstants : int { SHGFI_ICON = 0x100, // get

How to detect programmatically when the OS has done loading all of its applications\services?

自古美人都是妖i 提交于 2019-12-06 07:06:30
问题 Edit : I rephrased my question, please ignore all of the comments below (up to the 7th of May). First off, I'll try to explain the problem: My process is trying to show a Deskband programmatically using ITrayDeskBand::ShowDeskBand. It works great at any time except for when the OS is loading all of its processes (after reset or logout). After Windows boots and starts loading the various applications\services, the mouse cursor is set to wait for a couple of seconds (depends on how many

How to drop files onto .MAPIMail

梦想与她 提交于 2019-12-06 05:35:45
问题 Given some files (or shell file objects) how do i invoke the .MAPIMail registered shell extension handler with them? The Question i have some files on the computer: C:\Users\ian\AppData\Local\Temp\Contoso_Invoice_141174.pdf C:\Users\ian\AppData\Local\Temp\Contoso_Invoice_141173.pdf C:\Users\ian\AppData\Local\Temp\Contoso_Invoice_141171.pdf That i want to do the programmatic equivalent of dropping them on the .MAPIMail registered handler: The Sent to folder's Mail recipient option is actually

how to open a service properties dialog

烈酒焚心 提交于 2019-12-06 00:46:18
问题 I would like to add a button to my application ( frontend to a service) that will open the service properties dialog (like in services mmc snapin ) for my service. There are numerous examples to open file properties, but that is not what i want. i dont know where to start. 回答1: Based off of the services.msc , the page comes from filemgmt.dll and is called ServicePageGeneral . While the COM components are registered, I cannot find any documentation for the CLSID in question, nor for any of the

How to obtain the PIDL of an IShellFolder

三世轮回 提交于 2019-12-05 23:33:21
问题 If I have an IShellFolder interface pointer. How might I obtain its PIDL? I can see how to enumerate its children, and I can see how to use it to compare any two children. But how might I get its own pidl? I ask because I'd like to know: Is this IShellFolder == Another IShellFolder I can use IShellFolder::CompareIDs() , but I have to have the IDs of both folders. 回答1: What either Chris or Mordechai writes on #1 is anyway not to the point. The question is not about objects in the shell

How to tell if there's no default file extension association on OS post-Windows XP?

孤街浪徒 提交于 2019-12-05 19:14:18
Going back to the days of Windows XP one could use the following code to tell if there's no file association existed for an extension: TCHAR buffPath[MAX_PATH] = {0}; DWORD dwszBuffPath = MAX_PATH; HRESULT hR = ::AssocQueryString( ASSOCF_NOFIXUPS | ASSOCF_VERIFY, ASSOCSTR_EXECUTABLE, _T(".weirdassextension"), NULL, buffPath, &dwszBuffPath); if(hR != S_OK && hR != E_POINTER) { //Association does not exist } But since Windows 8, the AssocQueryString API returns S_OK and buffPath is set to something like C:\WINDOWS\system32\OpenWith.exe if it doesn't find anything. Is there a better way now to

Trying to determine printer status always returns 0 for offline & online printers

a 夏天 提交于 2019-12-05 13:00:26
My goal is to determine the current status of a printer. I found the following code . Here's a slightly modified version to fix memory leaks & bugs: #include <Winspool.h> int GetPrinterStatus( char* szPrnName ) { HANDLE hHandle = 0; // Handle of the printer DWORD dwStatus = 0; // Printer status we should receive DWORD dwSize = 0; // Size of memory we should // allocate for PRINTER_INFO_2 PRINTER_INFO_2* pPrnInfo2 = 0; // Structure specifies detailed // printer information DEVMODE DevMode = {0}; // Structure contains information // about the device initialization // and environment of a printer