pinvoke Questions

2

Solved

I was playing with a project from codeproject which basically monitors the printing activity on the computer. However it does not work correctly for 64 bit configuration. The below portion of the c...
Ungenerous asked 9/10, 2012 at 3:39

4

Solved

In the realm of providing a decent implementation of the Chromium Embedded Framework (CEF) for .Net, the two leading options appear to be CefSharp and CefGlue. They differ in approach (CefGlue uses...
Trope asked 1/9, 2012 at 4:5

1

Solved

I have a .NET project written in C# that has a dependency with the CoolProp library (available here https://github.com/CoolProp/CoolProp). It calls the CoolProp functions using PInvoke. Unluckily ...
Gora asked 19/10, 2018 at 15:19

7

Solved

Question I'm porting a C application into C#. The C app calls lots of functions from a 3rd-party DLL, so I wrote P/Invoke wrappers for these functions in C#. Some of these C functions allocate dat...
Grovel asked 9/7, 2013 at 13:14

2

Solved

The documentation on EnumWindows underscores: Note For Windows 8 and later, EnumWindows enumerates only top-level windows of desktop apps. What is the difference between "desktop apps" and "no...
Nasturtium asked 5/7, 2016 at 13:57

1

Solved

So I'm getting this error that looks as though it's a corrupted garbage collection: Application Crashes With "Internal Error In The .NET Runtime" The full error is: The process was termi...
Wore asked 17/9, 2018 at 2:23

1

I found a solution to setup Excel instance in WPF by using the SetParent() function of Windows. Problem is, that mouse and keyboard is not reacting to the sheet but to the Workbook it does. Ful...
Horny asked 23/8, 2018 at 13:7

1

Solved

I am referencing the following thread here for my question: Get ToolTip Text from Icon in System Tray I basically want to do the same thing as the OP, but unlike some other users who responded to...
Carcajou asked 17/8, 2018 at 2:48

3

Solved

I'm implementing an unmanaged array class in C# which I need for some OpenGL calls. It's going great, but I've hit a roadblock. The following code doesn't compile, and I understand why, but how ca...
Ryter asked 22/3, 2011 at 7:59

2

Solved

I am developing an application with C# winforms. Our application is going to be installed on win8 surface(touch screen device). We want to check if a keyboard is connected via USB then our app wi...
Cochard asked 12/2, 2015 at 7:39

1

I'm trying to do screen captures by capturing a specific window and in order to accurately figure out the size of the window to capture I want to use DwmGetWindowAttribute(). When I call this funct...
Marilynnmarimba asked 31/7, 2016 at 15:17

4

From within a windows service I want to check some user preferences that are stored within each users' HKCU registry area. How can I do this? I see that HKEY_USERS has subkeys of each user that ha...
Kettering asked 2/3, 2010 at 17:46

4

Solved

I'm writing a cross-platform .NET library that uses some unmanaged code. In the static constructor of my class, the platform is detected and the appropriate unmanaged library is extracted from an e...
Superorder asked 19/11, 2012 at 20:50

2

Solved

To my surprise I have discovered a powerful feature today. Since it looks too good to be true I want to make sure that it is not just working due to some weird coincidence. I have always thought t...
Hochman asked 24/3, 2018 at 15:31

4

Solved

I created a Form application in visual c#, that uses a function to generate mouse click, but i got the following error message: A call to PInvoke function '...Form1::mouse_event' has unbalanced th...
Portillo asked 24/3, 2012 at 20:42

1

I am trying to implement GetWindowDpiAwarenessContext in a C# application with no success. The relevent header files are: windef.h DECLARE_HANDLE(DPI_AWARENESS_CONTEXT); typedef enum DPI_AWAREN...
Blankly asked 28/2, 2018 at 16:12

1

Solved

While adapting the answer of ygoe, I discovered that it's possible to add an icon to the menu. I tried and succeeded in doing so by using this code for a text-only item: var item = new MenuItemI...
Foti asked 1/3, 2018 at 18:37

2

Solved

The naming convention for constants in C# is Pascal casing: private const int TheAnswer = 42; But sometimes we need to represent already-existing constants from the Windows API. For example, I ...
Wilds asked 29/3, 2012 at 1:21

2

Solved

I've got an always on-top application (basically a status display) that I want to follow around another program and always sit just to the left of the minimize button. I can get the Rect represent...
Timothea asked 13/2, 2018 at 12:53

1

Solved

I'm making a Rebar wrapper for .NET. Here's how I've made my control. public class Rebar : Control { public Rebar() : base() { //Control won't even work if I let UserPaint enabled SetStyle(Con...
Muscatel asked 12/2, 2018 at 22:23

1

Solved

This is a problem that happens specifically on the ARM, not on x86 or x64. I had this problem reported by a user and was able to reproduce it using UWP on Raspberry Pi 2 via Windows IoT. I've seen ...
Syllepsis asked 19/6, 2017 at 22:59

1

Solved

I am attempting to use the AmsiScanBuffer function of the Windows Anti-Malware Service Interface from managed code, specifically C#. When attempting to call the method the program hangs on the call...
Bechance asked 12/1, 2018 at 18:9

2

Solved

I have an umanaged C++ DLL which is communicating with a Cisco Server (UCCX). It sends and receives messages to and from this server via TCP/IP. Now there are some types of messages it receives w...
Cuman asked 25/9, 2012 at 5:56

1

Solved

How do I deal with optional struct arguments in dll methods called from C# using pinvoke? For example, the lpSecurityAttributes parameter here should be passed null when absent. The correct way of...
Robinetta asked 27/12, 2017 at 19:58

2

Solved

I am trying to Pinvoke the lmdif1 method in the cminpack_dll.dll from c# and i am running into some curious errors. The 2nd and third parameters passed to lmdif1 are ints, and for my test the val...
Parisi asked 5/6, 2014 at 14:16

© 2022 - 2024 — McMap. All rights reserved.