windows-shell

Make Windows refresh icon cache

南笙酒味 提交于 2019-12-18 13:37:30
问题 I really liked the oxygen appearance of KDE SC 4. I wrote a program to apply these icons to windows. The program is written in NSIS, and is currently nearly fully functional. However, the only way I found to make Windows aware of the icon changes is to kill explorer.exe, delete the icon cache, and respawn explorer.exe. SHChangeNotify with SHCNE_ASSOCCHANGED seems to be unable to make Windows aware of the changes to the Control Panel icon, the My Computer icon, etc. Please suggest a better,

How do you drag and drop a file from Explorer Shell into a VirtualTreeView control in a Delphi application?

拟墨画扇 提交于 2019-12-18 12:32:37
问题 There is extensive drag and drop support in VirtualTreeView by Mike Lischke, and I am using TVirtualStringTree, which has some on-drag-and-drop events, but I can not figure out how to get it to accept a shell drag-and-drop of some files from the windows explorer shell, into my application. I want to load the files, when they are dragged onto the drop control. I tried using a third-party set of code from Anders Melander, to handle drag and drop, but because VirtualTreeView already registers

Use Delphi to Find Special Drives

只谈情不闲聊 提交于 2019-12-18 08:51:51
问题 I am trying to write a small program in Delphi 2007 to access files off of a portable USB drive whenever it is plugged in to a Windows 7 machine. This drive does not show up as a standard drive letter though. It appears under Portable Devices in Windows Explorer. I have written the following code to enumerate all the items under 'Computer': Procedure TfrmMain.ComputerChanged(Var Msg: TMessage); Var Enum: IEnumIDList; Fetched: Longword; Item: PItemIDList; Path: String; Computer: IShellFolder;

Use Delphi to Find Special Drives

大憨熊 提交于 2019-12-18 08:51:11
问题 I am trying to write a small program in Delphi 2007 to access files off of a portable USB drive whenever it is plugged in to a Windows 7 machine. This drive does not show up as a standard drive letter though. It appears under Portable Devices in Windows Explorer. I have written the following code to enumerate all the items under 'Computer': Procedure TfrmMain.ComputerChanged(Var Msg: TMessage); Var Enum: IEnumIDList; Fetched: Longword; Item: PItemIDList; Path: String; Computer: IShellFolder;

How to refresh Windows Explorer

天涯浪子 提交于 2019-12-18 06:54:13
问题 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

How to refresh Windows Explorer

女生的网名这么多〃 提交于 2019-12-18 06:52:51
问题 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

reference a windows shell interface using .net 4.0

。_饼干妹妹 提交于 2019-12-17 20:44:46
问题 I am using the following code to reference a shell dll Type t = Type.GetTypeFromProgID("Shell.Application"); Shell s = (Shell)Activator.CreateInstance(t); Console.WriteLine("success"); Console.ReadLine(); It works fine on my windows 7 development machine.But when I try running the exe on Win 2003 server I get this exception Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell3 2.Shell'. This operation failed because the QueryInterface call on the COM compo nent for

How do I write a batch file which opens the GitBash shell and runs a command in the shell?

无人久伴 提交于 2019-12-17 08:33:28
问题 I'm on Windows 7 trying to use a batch file to open the GitBash shell and make a git call. This is the contents of my batch file: REM Open GitBash C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i" REM retrieve archive git archive master | tar -x -C %~1 REM quit GitBash exit I noticed that the GitBash is logging out before the next command "git archive...". Does anybody know if I can pass the command into GitBash and how? Mike 回答1: "C:\Program Files (x86)\Git

How do I write a batch file which opens the GitBash shell and runs a command in the shell?

拟墨画扇 提交于 2019-12-17 08:32:23
问题 I'm on Windows 7 trying to use a batch file to open the GitBash shell and make a git call. This is the contents of my batch file: REM Open GitBash C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i" REM retrieve archive git archive master | tar -x -C %~1 REM quit GitBash exit I noticed that the GitBash is logging out before the next command "git archive...". Does anybody know if I can pass the command into GitBash and how? Mike 回答1: "C:\Program Files (x86)\Git

MessageBox and ShellExecute succeed, but nothing is shown if called right before the application exits

情到浓时终转凉″ 提交于 2019-12-13 22:01:02
问题 I'm trying to display a MessageBox with some debugging information right before my application exits in case of a specific error. The reason I need to display it as a message box vs. just logging it in a file is because I need it to draw my attention right when the error happens. (With a silent logging, I might miss the moment when the error first starts happening.) And, it would be also nice to open a file at the same time if the user chooses to. So I'm calling the following "vanila" code