¡@

Home 

c# Programming Glossary: kernel32.dll

How do you get total amount of RAM the computer has?

http://stackoverflow.com/questions/105031/how-do-you-get-total-amount-of-ram-the-computer-has

return MarshalAs UnmanagedType.Bool DllImport kernel32.dll CharSet CharSet.Auto SetLastError true static extern bool GlobalMemoryStatusEx..

Using global keyboard hook (WH_KEYBOARD_LL) in WPF / C#

http://stackoverflow.com/questions/1639331/using-global-keyboard-hook-wh-keyboard-ll-in-wpf-c-sharp

hhk int nCode UIntPtr wParam IntPtr lParam DllImport kernel32.dll CharSet CharSet.Auto SetLastError true public static extern..

Can I show file copy progress using FileInfo.CopyTo() in .NET?

http://stackoverflow.com/questions/187768/can-i-show-file-copy-progress-using-fileinfo-copyto-in-net

a wrapper around the Win32 API call CopyFile in the kernel32.dll. This method does not support progress callback. However the..

Accessing Password Protected Network Drives in Windows in C#?

http://stackoverflow.com/questions/2563724/accessing-password-protected-network-drives-in-windows-in-c

error information call GetLastError. returns DllImport kernel32.dll CharSet CharSet.Unicode SetLastError true return MarshalAs UnmanagedType.Bool..

Kill child process when parent process is killed

http://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed

PeakJobMemoryUsed public class Job IDisposable DllImport kernel32.dll CharSet CharSet.Unicode static extern IntPtr CreateJobObject.. IntPtr CreateJobObject object a string lpName DllImport kernel32.dll static extern bool SetInformationJobObject IntPtr hJob JobObjectInfoType.. lpJobObjectInfo uint cbJobObjectInfoLength DllImport kernel32.dll SetLastError true static extern bool AssignProcessToJobObject..

How to detect Windows 64-bit platform with .NET?

http://stackoverflow.com/questions/336633/how-to-detect-windows-64-bit-platform-with-net

is64BitProcess InternalCheckIsWow64 DllImport kernel32.dll SetLastError true CallingConvention CallingConvention.Winapi..

How to detect if Console.In (stdin) has been redirected?

http://stackoverflow.com/questions/3453220/how-to-detect-if-console-in-stdin-has-been-redirected

enum StdHandle Stdin 10 Stdout 11 Stderr 12 DllImport kernel32.dll private static extern FileType GetFileType IntPtr hdl DllImport.. static extern FileType GetFileType IntPtr hdl DllImport kernel32.dll private static extern IntPtr GetStdHandle StdHandle std Usage..

Show Console in Windows Application?

http://stackoverflow.com/questions/472282/show-console-in-windows-application

args.Length 0 args 0 console default to console DllImport kernel32.dll SetLastError true static extern bool AllocConsole DllImport.. true static extern bool AllocConsole DllImport kernel32.dll SetLastError true static extern bool FreeConsole DllImport kernel32..

Is there a faster way to scan through a directory recursively in .NET?

http://stackoverflow.com/questions/724148/is-there-a-faster-way-to-scan-through-a-directory-recursively-in-net

long filetime.dwLowDateTime interop defs are DllImport kernel32.dll CharSet CharSet.Unicode SetLastError true public static extern.. lpFileName out WIN32_FIND_DATAW lpFindFileData DllImport kernel32.dll CharSet CharSet.Unicode public static extern bool FindNextFile.. hFindFile out WIN32_FIND_DATAW lpFindFileData DllImport kernel32.dll public static extern bool FindClose IntPtr hFindFile StructLayout..

Using C#, how does one figure out what process locked a file?

http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file

ObjectInformationLength ref int returnLength DllImport kernel32.dll SetLastError true public static extern uint QueryDosDevice string.. SystemInformationLength ref int returnLength DllImport kernel32.dll public static extern IntPtr OpenProcess ProcessAccessFlags.. bool bInheritHandle int dwProcessId DllImport kernel32.dll public static extern int CloseHandle IntPtr hObject DllImport..

DllNotFoundException with HRESULT 0x8007007E when loading 64-bit dll

http://stackoverflow.com/questions/10774250/dllnotfoundexception-with-hresult-0x8007007e-when-loading-64-bit-dll

does not seem to the case zlibwapi64.dll only depends on Kernel32.dll and MSVCR90.dll. I do have VS2008 C runtimes installed both..

Insert bytes into middle of a file (in windows filesystem) without reading entire file (using File Allocation Table)?

http://stackoverflow.com/questions/13430210/insert-bytes-into-middle-of-a-file-in-windows-filesystem-without-reading-entir

lpOverlapped should be fixed if not null DllImport Kernel32.dll SetLastError true CharSet CharSet.Auto public static extern..

Physical disk size not correct (IoCtlDiskGetDriveGeometry)

http://stackoverflow.com/questions/15051660/physical-disk-size-not-correct-ioctldiskgetdrivegeometry

methods internal static class NativeMethods DllImport Kernel32.dll SetLastError true CharSet CharSet.Auto public static extern.. creationDisposition uint flags IntPtr template DllImport Kernel32.dll SetLastError false CharSet CharSet.Auto public static extern..

Check if an application is idle for a time period and lock it

http://stackoverflow.com/questions/1541981/check-if-an-application-is-idle-for-a-time-period-and-lock-it

bool GetLastInputInfo ref LASTINPUTINFO Dummy DllImport Kernel32.dll private static extern uint GetLastError public static uint GetIdleTime..

Redirect stdout+stderr on a C# Windows service

http://stackoverflow.com/questions/1579074/redirect-stdoutstderr-on-a-c-sharp-windows-service

You can do this via PInvoke to SetStdHandle DllImport Kernel32.dll SetLastError true public static extern int SetStdHandle int..

How can I write fast colored output to Console?

http://stackoverflow.com/questions/2754518/how-can-i-write-fast-colored-output-to-console

namespace ConsoleApplication1 class Program DllImport Kernel32.dll SetLastError true CharSet CharSet.Auto static extern SafeFileHandle..

How to create a hardlink in C#?

http://stackoverflow.com/questions/3387690/how-to-create-a-hardlink-in-c

c# .net hardlink share improve this question DllImport Kernel32.dll CharSet CharSet.Unicode static extern bool CreateHardLink string..

Using Process.Start() to start a process as a different user from within a Windows Service

http://stackoverflow.com/questions/362419/using-process-start-to-start-a-process-as-a-different-user-from-within-a-windo

CloseHandle __in HANDLE hObject #endregion DllImport Kernel32.dll extern static int CloseHandle IntPtr handle DllImport advapi32.dll..

File.Delete failing when Image.FromFile was called prior it, despite making copy of loaded image and destroying original one

http://stackoverflow.com/questions/3661799/file-delete-failing-when-image-fromfile-was-called-prior-it-despite-making-copy

sourceImage 0 0 return targetImage DllImport Kernel32.dll EntryPoint CopyMemory private extern static void CopyMemory..

How do I include a console in Winforms?

http://stackoverflow.com/questions/3917202/how-do-i-include-a-console-in-winforms

waTest public partial class Form1 Form DllImport Kernel32.dll static extern Boolean AllocConsole public Form1 InitializeComponent..

how to get copy file progress

http://stackoverflow.com/questions/3921518/how-to-get-copy-file-progress

IntPtr data SuppressUnmanagedCodeSecurity DllImport Kernel32.dll CharSet CharSet.Auto SetLastError true private static extern..

Use a C library from C# code

http://stackoverflow.com/questions/9093292/use-a-c-library-from-c-sharp-code

syntax of making a C function call is as follows DllImport Kernel32.dll SetLastError true static extern Boolean Beep UInt32 frequency.. UInt32 duration The above calls the function Beep in Kernel32.dll passing in the arguments frequency and duration. More complex..