Top "Pinvoke" questions

P/Invoke is an implementation specification created by Microsoft of the Common Language Infrastructure (CLI) for invocation of native code libraries from managed code.

How to call memcmp() on two parts of byte[] (with offset)?

I want to compare parts of byte[] efficiently - so I understand memcmp() should be used. I know I can …

c# .net c++-cli pinvoke memcmp
Retrieving virtual disk file name from disk number

When I list virtual disks within diskpart: DISKPART> list vdisk VDisk ### Disk ### State Type File --------- -------- -------------------- --------- …

c# winapi pinvoke virtual-disk
C# Hiding an application from the taskbar

I have been struggling to hide another application from the taskbar from my application. I have been using the SetWindowLong …

c# pinvoke spy++
C# DLLImport converted to VB.NET DLLImport...what am I missing?

In C# I have this: [DllImport("user32.dll", EntryPoint = "GetDesktopWindow")] public static extern IntPtr GetDesktopWindow(); I tried to convert to …

vb.net interop pinvoke dllimport c#-to-vb.net
P/Invoke to dynamically loaded library on Mono

I'm writing a cross-platform .NET library that uses some unmanaged code. In the static constructor of my class, the platform …

c# mono pinvoke unmanaged
Performance differences between P/Invoke and C++ Wrappers

In the process of learning P/Invoke, I asked this previous question: How to P/Invoke when pointers are involved …

c# performance pinvoke managed-c++
SetProcessDpiAwareness not having effect

I've been trying to disable the DPI awareness on a ClickOnce application. I quickly found out, it is not possible …

c# wpf pinvoke clickonce dpi
In .NET, how do I Create a Junction in NTFS, as opposed to a Symlink?

I'm trying to create an NTFS Junction. From the cmd line I can do this using the junction.exe tool …

.net winapi pinvoke ntfs deviceiocontrol
BitBlt code not working

I'm trying to use this code to draw a Bitmap directly onto a PictureBox: Bitmap bmp = (Bitmap)Bitmap.FromFile(@"C:\…

c# .net gdi+ pinvoke bitblt
Implementing IDisposable on a sealed class

I don't think this question has been asked before. I'm a bit confused on the best way to implement IDisposable …

c# pinvoke