pinvoke Questions
1
Solved
1
I`m developing an application in C# associated with Windows clipboard. As there are many disadvantages in Dot Net Clipboard library (STA, Fail to Open Clipboard, etc. ) I dicided to use system API ...
2
Solved
I have recently had to change from using File.Copy() to CopyFileEx and I am struggling to find how to use it.
After a lot of googling I found this nice wrapper to use it, but what I need is to get...
5
Solved
I'm attempting to call the following trivial C function from C#:
SIMPLEDLL_API const char* ReturnString()
{
return "Returning a static string!";
}
With the following P/Invoke declaration (with ...
Evvy asked 9/6, 2011 at 22:33
1
Solved
I'm attempting to follow the answer at this question
My struct looks like this in C
typedef struct drive_info_t {
unsigned char drive_alias[32];
} drive_info_t;
My function looks like this in...
0
I have recently implemented CreateProcessAsUser. I have been trying to get the output results either redirected or piped to a file. Preferable to stream.
I have tried this with no luck
Update
Req...
Epistemic asked 28/7, 2016 at 13:6
3
Solved
In this question I have searched for a simple solution to unblock files.
Thanks to all the comments and answer, I have found a simple solution by PInvoking DeleteFile.
It works, but because I've n...
Hornbeam asked 16/6, 2011 at 16:49
2
I tested different ways of generating a timestamp when I found something surprising (to me).
Calling Windows's GetSystemTimeAsFileTime using P/Invoke is about 3x slower than calling DateTime.UtcNo...
Afflatus asked 18/6, 2016 at 15:22
3
Solved
I am using CreateProcessAsUser from a windows service (please can we stay on-topic and assume I have a very good reason for doing this). Contrary to what everyone else is asking here I am getting a...
Fulminous asked 1/2, 2012 at 12:35
5
Solved
The SP_DEVICE_INTERFACE_DETAIL_DATA structure:
typedef struct _SP_DEVICE_INTERFACE_DETAIL_DATA {
DWORD cbSize;
TCHAR DevicePath[ANYSIZE_ARRAY];
} SP_DEVICE_INTERFACE_DETAIL_DATA, *PSP_DEVICE_INT...
Osage asked 23/5, 2012 at 22:13
1
I am trying to create some vhd/vhdx files using the VHD API in C#.
There's a C++ union that looks like this:
typedef struct _CREATE_VIRTUAL_DISK_PARAMETERS
{
CREATE_VIRTUAL_DISK_VERSION Version;...
5
Solved
I just switched to vs2010 from vs2008. Exact same solution, except now every single call to a C++ dll yields a 'pinvokestackimbalance' exception.
This exception does not get fired in 2008. I have ...
Coucal asked 17/8, 2010 at 20:45
2
Solved
I am able to set a windows position as topmost and also setting it no topmost with SetWindowPos. But i can't figure out how to check if a window is topmost or not. Is there any Method to check if a...
4
Solved
I'm struggling to put together a working example of pinvoke'ing CreateJobObject and SetInformationJobObject. Through various google searches (including Russian and Chinese posts!) I've cobbled toge...
6
Solved
I have a dll that was written in c++, I need to use this dll in my c# code. After searching I found that using P/Invoke would give me access to the function I need, but these functions are defined ...
2
Solved
I have developed a function which returns the icon of the window for a given window handle. It looks like this.
private static BitmapSource GetWindowIcon(IntPtr windowHandle)
{
var hIcon = defaul...
Kurgan asked 20/8, 2015 at 15:44
6
Solved
Hopefully this is a brainlessly easy question, but it shows my lack of expertise with C++. I'm a C# programmer, and I've done extensive work with P/Invoke in the past with other people's C++/C dlls...
4
Solved
https://msdn.microsoft.com/en-us/library/ms182161.aspx
Are the three classes described on this paged handled specially in the .NET Framework? (NativeMethods, SafeNativeMethods and UnsafeNativeMeth...
Cornaceous asked 18/9, 2009 at 15:1
2
Google Chrome does not refresh accessibility elements (AutomationElement) when a user scrolls down in the browser.
To reproduce it:
Enable renderer accessibility with : "chrome --force-render-...
Picaresque asked 25/5, 2015 at 9:19
1
Solved
When interacting with a 64-bit native library through an explicitly 64-bit .NET application via P/Invoke, is the CallingConvention property in the DllImport attribute effectively ignored?
I ask th...
Malaria asked 16/1, 2016 at 22:7
2
Solved
When doing P/Invoke, it is important to make the data layout match.
We can control the layout of struct by using some attribute.
For example:
struct MyStruct
{
public bool f;
}
gives a size ...
1
Solved
I want to make an SS application. But I have problem on this subject. I want user to be able to select a special area to take screenshot. I also want the desktop is live while the user is selecting...
Vasily asked 19/12, 2015 at 16:3
1
Solved
I'm trying to make something in C# that requires calling into some unmanaged DLLs, a process which I know nothing about! I found a "Hello World" tutorial that should be as simple as copying and pas...
4
Solved
I'm messing around with some windows functions using p/invoke. Occasionally, I get an error code that is not ERROR_SUCCESS (such an odd name).
Is there a way to look these up within the program? F...
1
Solved
How to enumerate all the process' domains without referencing mscoree. Is it possible? I found some solution from 2007 year somewhere in the Internet. But it enumerates and empty collection.
Here'...
© 2022 - 2024 — McMap. All rights reserved.