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.

Hooking into Windows message loop in WPF window adds white border on the inside

I am trying to create a WPF window with WindowStyle="None" (for custom buttons and no title) that cannot be …

c# wpf pinvoke
How to import void * C API into C#?

Given this C API declaration how would it be imported to C#? int _stdcall z4ctyget(CITY_REC *, void *); I've …

c# pinvoke dllimport
Detect laptop lid closure and opening

Is it possible to detect when a laptop's lid is open or closed? From what I've read, this isn't possible, …

.net winapi pinvoke ioctl
AttachConsole(-1), but Console.WriteLine won't output to parent command prompt?

If I have set my program to be a Windows Application, and used the AttachConsole(-1) API, how do I …

.net winapi pinvoke console-application
Lighting USB OpenDMX FTD2XX DMXking

Couple of quick questions. I have a DMX king USB lighting controller that I'm trying to control. It's based on …

c# pinvoke dmx512
Get ListView items from other windows

I'm doing some project on c#. I need to get i item from ListView window, handle of it I got …

c# .net winforms pinvoke listviewitem
Unblock File from within .net 4 c#

Is there a possibility to unblock a file that is downloaded from the internet from within a c# program. Surfing …

c# .net .net-4.0 pinvoke alternate-data-stream
P-Invoke in .net core with Linux

Is there way to implement P/Invoke (dllimport) in .NET Core on Linux ? Example : I have C++ MyLib.dll compiled …

pinvoke .net-core
When passing a managed byte[] array through PInvoke to be filled in by Win32, does it need to be pinned?

Suppose you're calling a Win32 function that will fill in your byte array. You create an array of size 32, empty. …

c# .net visual-studio clr pinvoke
How to map Win32 types to C# types when using P/Invoke?

I am trying to do something like this in C#. I found out how to call Win32 methods from C# …

c# winapi pinvoke performancecounter