Questions tagged [windows-api-code-pack]

The Windows API Code Pack for .NET is esentially a managed API to access Shell functions, that are otherwise not available for .NET Developers.

The Windows API Code Pack for .NET can either be downloaded from MSDN or installed via NuGet with Install-Package Windows7APICodePack.

170 questions
1
vote
0 answers

Black edges appear when window is transparent

I used the following method to successfully make the window transparent, but some windows will have black edges, how should I solve it WindowApi.SetWindowLong(winPtr, -20, WindowApi.GetWindowLong(winPtr, -20) |…
kuse j
  • 11
  • 2
1
vote
0 answers

An exception when creating CompatibleRenderTarget from DcRenderTarget

I’m using the .Net Direct2D API in “Windows API Code Pack for .NET” to improve the drawing performance, it always throws the “Exception from HRESULT: 0x88982F80” when creating the CompatibleRenderTarget from DcRenderTarget, I don’t know why, it has…
Howard
  • 3,638
  • 4
  • 32
  • 39
1
vote
0 answers

Working with Windows Server Media Foundation from within a containerized application

I am utilizing Microsoft-WindowsAPICodePack-Shell (version 1.1.0) and Microsoft-WindowsAPICodePack-Core (version 1.1.0) for reading metadata of audio & video files (specifically duration). So far, this solution was working perfectly fine, deployed…
1
vote
1 answer

CommonOpenFileDialog - Cross-thread operation not valid after call from UI thread

So I'm using the CommonOpenFileDialog from the windowsAPICodepack. In a previous version of the application I'm writing, the CommonOpenFileDialog worked without any problems. In the current version targeted at a higher version of the .Net Framework,…
Thomas
  • 43
  • 6
1
vote
1 answer

C# WindowsAPICodePack, "The path is not of a legal form" when passing in non-english characters

When trying to get a Shellfile from file path using WindowsAPICodePack, (Which I use to get a thumbnail from) it works fine until it gets passed a file with a non-english (specifically Japanese) filename. using (FolderBrowserDialog…
BBonless
  • 97
  • 7
1
vote
1 answer

How to refresh taskbar preview even when the form is minimized

I'm having a problem and I noticed 90% of Windows(7,8,10) applications don't update taskbar preview (that little window when you hover over an app icon in taskbar) so when the app is minimized the taskbar preview just freezes and don't update…
1
vote
2 answers

SaveFileDialog Navigate to Folder on Type Change

I am trying to replicate some behaviour from Microsoft Word around the Save File Dialog. In Word (Office 365 Latest Version) if you go to Save As and bring up the browse dialog, the default directory is My Documents, if you then change the Save as…
Ryan Thomas
  • 1,724
  • 2
  • 14
  • 27
1
vote
1 answer

How can I retrieve a generic folder icon in C# that appears small & open on Windows 10, using either the Win32 API or the Windows API Code Pack?

Using the Win32 API to retrieve file/folder icons in C# is a trivial process that has been documented countless times, going all the way back to the beginning of .Net. Every documented solution is just a variation on the same approach: P/Invoking…
Pancake
  • 739
  • 1
  • 5
  • 20
1
vote
1 answer

Add custom file extended properties

After adding metadata property handler for .svg extension with this tool, I am able to add keywords to .svg files via Windows Explorer. I am now searching a way to add keywords via a C# application. I found this solution but…
alex
  • 5,661
  • 6
  • 33
  • 54
1
vote
2 answers

Is Windows API "CreateIconFromResourceEx" Deprecated?

Windows API "CreateIconFromResourceEx" not working after windows update "Update for Microsoft Windows(KB4517389)" if I uninstall this update "CreateIconFromResourceEx" will work, but there is no any official documentation regarding deprecate of…
Krish
  • 376
  • 3
  • 14
1
vote
2 answers

How to fix ArgumentException in Windows-API-Code-Pack?

I've created an application that reads properties from files using the Windows-API-Code-Pack from this package. I'm having an issue when retrieving properties var width =…
AzeExMachina
  • 104
  • 14
1
vote
1 answer

Get Process Handle in PowerShell

I am trying to get a process handle without success, I have read a lot about that but don't know why I cannot achieve it. This is what I am doing: $handle = $Kernel32::OpenProcess(PROCESS_ALL_ACCESS, FALSE, 4548) I am doing it with admin rights,…
aDoN
  • 1,877
  • 4
  • 39
  • 55
1
vote
1 answer

CommonFileDialog loads in different thread

I'm trying to create a dialog from the WindowsAPICodePack in C#, but when it loads, it throws an exception that the calling thread can't access the object. Exception: System.InvalidOperationException: The calling thread cannot access this object…
Matts
  • 1,301
  • 11
  • 30
1
vote
0 answers

How do you prevent window style change after opening CommonOpenFileDialog

I'm using Microsoft.WindowsAPICodePack to do folder selection from a CommonOpenFileDialog. This is a windows forms application. As soon as I open the file dialog my main window's style appears to be stripped off and it loses its icon. Is there a…
Lokiare
  • 1,238
  • 1
  • 15
  • 23
1
vote
0 answers

How to use GetMessage to read another Thread's message queue

I'm trying to run a thread in the background which reads the message queue from the main thread, so I can focus on installing and uninstalling hooks and responding to user actions, but I can't make the second thread poll from the main thread's…