windows-api-code-pack

Accessing thumbnails that don't exist

只愿长相守 提交于 2019-12-04 19:01:57
问题 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

How to use ilMerge to merge dll’s into an exe file?

对着背影说爱祢 提交于 2019-12-04 18:09:55
问题 I tried: C:\Windows\System32>ilmerge /target:winexe /out:c:\output.exe c:\MyProgram.exe c:\Microsoft.WindowsAPICodePack.dll But got: 'ilmerge' is not recognized as an internal or external command, operable program or batch file. What am I doing wrong? (And by the way, is there a better way to merge dll’s into an exe file?) Thanks 回答1: This is not a programming question... but you need to install ILMERGE and make sure that it is either in the path or that you fully reference the path. ILMERGE

Windows API Code Pack TaskDialog missing icon

丶灬走出姿态 提交于 2019-12-04 04:13:39
问题 The icons in my TaskDialog are missing: And in the taskbar: My code is this: using Microsoft.WindowsAPICodePack; using Microsoft.WindowsAPICodePack.Dialogs; ... TaskDialog taskDialog = new TaskDialog(); taskDialog.Caption = "Error"; taskDialog.InstructionText = "Test error message."; taskDialog.Text = "Icon seems to be missing."; taskDialog.DetailsExpandedText = "Test"; taskDialog.DetailsCollapsedLabel = "Expand"; taskDialog.StandardButtons = TaskDialogStandardButtons.Ok; taskDialog.Icon =

How to use ilMerge to merge dll’s into an exe file?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 12:53:17
I tried: C:\Windows\System32>ilmerge /target:winexe /out:c:\output.exe c:\MyProgram.exe c:\Microsoft.WindowsAPICodePack.dll But got: 'ilmerge' is not recognized as an internal or external command, operable program or batch file. What am I doing wrong? (And by the way, is there a better way to merge dll’s into an exe file?) Thanks This is not a programming question... but you need to install ILMERGE and make sure that it is either in the path or that you fully reference the path. ILMERGE is not a built-in command that you can just use... As for alternatives, you could embed them as embedded

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'

Is it possible to set/edit a file extended properties with Windows API Code Pack?

余生颓废 提交于 2019-12-01 17:15:17
I'd like to know if it's possible to set/edit a file extended properties (Explorer: Right-click > Properties > Details) using the Windows API Code Pack. var shellFile = Microsoft.WindowsAPICodePack.Shell.ShellObject.FromParsingName(filePath); var artistName = shellFile.Properties.GetProperty(SystemProperties.System.Music.DisplayArtist).ValueAsObject.ToString(); var duration = TimeSpan.FromMilliseconds(Convert.ToDouble(shellFile.Properties.GetProperty(SystemProperties.System.Media.Duration).ValueAsObject) * 0.0001); I use these few lines to get the properties I want, but I don't know how to

Is it possible to set/edit a file extended properties with Windows API Code Pack?

試著忘記壹切 提交于 2019-12-01 16:20:50
问题 I'd like to know if it's possible to set/edit a file extended properties (Explorer: Right-click > Properties > Details) using the Windows API Code Pack. var shellFile = Microsoft.WindowsAPICodePack.Shell.ShellObject.FromParsingName(filePath); var artistName = shellFile.Properties.GetProperty(SystemProperties.System.Music.DisplayArtist).ValueAsObject.ToString(); var duration = TimeSpan.FromMilliseconds(Convert.ToDouble(shellFile.Properties.GetProperty(SystemProperties.System.Media.Duration)

How can I make CommonOpenFileDialog select folders only, but still show files?

百般思念 提交于 2019-11-29 05:53:45
I am using Microsoft's CommonOpenFileDialog to allow users to select a Folder, but no files are visible when the dialog comes up. Is it possible to show files as well as folders when IsFolderPicker is set to true? My current code looks like this var dialog = new CommonOpenFileDialog(); dialog.IsFolderPicker = true; if (dialog.ShowDialog() == CommonFileDialogResult.Ok) { SelectedFolderPath = dialog.FileName; } Skinner927 Off the top of my head, this is how I did it var dialog = new CommonOpenFileDialog { EnsurePathExists = true, EnsureFileExists = false, AllowNonFileSystemItems = false,

Name of files opened by a process in window?

橙三吉。 提交于 2019-11-28 13:24:11
How to print name of file open by some process (PID) in window? Or All Processes (PID) currently open a file. Process Explorer is a utility works for same. But how does it work not mentioned? Any /proc filesystem kind of thing present in windows? Can we read any Window's Registry? I wants to write a programming code And I rarely work on windows. Got two solutions in Python: 1. import psutil 2. import win32api, win32con, win32process But it is still a question to me! 1. How does these libraries works? 2. Any register, memory or virtual file system keeps this information? If its possible in

how to get file properties?

大憨熊 提交于 2019-11-28 00:05:11
I want an application which displays the some file properties of a mediafile if available, like (don't know the exact english words used in windows for it) FileName, Length/Duration, FileType(.avi .mp3 etc.) I tried taglib and windowsapishell but I dont get a working result (references are good) ShellFile so = ShellFile.FromFilePath(file); so.Properties.System.(everythingIwant) shows me a lot of file properties which I want to have displayed, but I cant get it working An example of an error: 'WindowsFormsApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly