Skip to content

We have a lot of WinAPI functions that You can easily use them in your applications

InteropMethods

NameRemarks
RegisterWindowMessage
ReadProcessMemory
SendMessage
GetWindowThreadProcessId
AttachThreadInput
GetForegroundWindow
OpenProcess
VirtualAllocEx
CloseHandle
VirtualFreeEx
FindWindow
FindWindowEx
GetWindowRect
GetCursorPos
GetDesktopWindow
AddClipboardFormatListener
RemoveClipboardFormatListener
GetSystemMenu
EnableMenuItem
InsertMenu
IntDestroyMenu
IntGetDC
IntReleaseDC
GetDeviceCaps
GetSystemMetrics
IntDestroyIcon
IntDeleteObject
IntCloseHandle
PrivateCreateDIBSection
PrivateCreateIconIndirect
PrivateCreateBitmap
IntGetModuleFileName
ExtractIconEx
Shell_NotifyIcon
CreateWindowEx
RegisterClass
DefWindowProc
SetForegroundWindow
CallNextHookEx
GetModuleHandle
UnhookWindowsHookEx
SetWindowsHookEx
GetWindowDC
GetPixel
ReleaseDC
GetDeviceCaps
GetDC
GetWindowPlacement
MonitorFromWindow
EnumThreadWindows
DeleteDC
CreateCompatibleDC
SelectObject
SendMessage
MonitorFromPoint
GetWindow
IsWindowVisible
IsIconic
IsZoomed
SetWindowPos
GetWindowLong
SetWindowLongPtr32
SetWindowLongPtr64
SetWindowLong
SetWindowLongPtr
GetCurrentThreadId
DestroyWindow
UnregisterClass
UpdateLayeredWindow
RedrawWindow
EnumDisplayMonitors
IntersectRect
GetMonitorInfo
CreateDIBSection
AlphaBlend
ChildWindowFromPointEx
CreateCompatibleBitmap
BitBlt
EnableWindow
SHAppBarMessage
SetWindowPlacement
GetWindowText
EnumDesktopWindows
FindWindowByCaption
MouseEvent
RtlGetVersion
GetImmersiveUserColorSetPreference
GetImmersiveColorSetCount
GetImmersiveColorFromColorSetEx
GetImmersiveColorTypeFromName
GetImmersiveColorNamedTypeByIndex
InternetGetConnectedState
GetModuleFileName
WritePrivateProfileString
GetPrivateProfileString
DwmGetColorizationColor
DwmSetWindowAttribute
GetWindowLongPtr32
GetWindowLongPtr64
GetWindowLongPtr
GdipImageGetFrameDimensionsCountlocated in Gdip
GdipImageGetFrameDimensionsListlocated in Gdip
GdipImageGetFrameCountlocated in Gdip
GdipGetPropertyItemSizelocated in Gdip
GdipGetPropertyItemlocated in Gdip
GdipCreateHBITMAPFromBitmaplocated in Gdip
GdipImageSelectActiveFramelocated in Gdip
GdipCreateBitmapFromFilelocated in Gdip
GdipImageForceValidationlocated in Gdip
IntGdipDisposeImagelocated in Gdip
GdiplusStartuplocated in Gdip
GdipGetImageRawFormatlocated in Gdip
SetWindowCompositionAttributelocated in Gdip
GdipCreateBitmapFromStreamlocated in Gdip
GdipCreateBitmapFromHBITMAPlocated in Gdip
GdipGetImageEncodersSizelocated in Gdip
GdipGetImageDecodersSizelocated in Gdip
GdipGetImageDecoderslocated in Gdip
GdipGetImageEncoderslocated in Gdip
GdipSaveImageToStreamlocated in Gdip
GetActiveWindow

InteropValues

ExternDll

you can access dll from ExternDll

cs
[DllImport(InteropValues.ExternDll.User32, CharSet = CharSet.Auto)]
NameRemarks
User32
Gdi32
GdiPlus
Kernel32
Shell32
MsImg
NTdll
WinInet
uxtheme
dwmapi

StructLayout

NameRemarks
NOTIFYICONDATA
TBBUTTON
TRAYDATA
POINT
MOUSEHOOKSTRUCT
RECT
BLENDFUNCTION
BITMAPINFOHEADER
WINDOWPOS
WINDOWPLACEMENT
SIZE
MONITORINFO
WNDCLASS
WNDCLASS4ICON
BITMAPINFO
ICONINFO
WINCOMPATTRDATA
ACCENTPOLICY
ImageCodecInfoPrivate
MINMAXINFO
APPBARDATA
RTL_OSVERSIONINFOEX

Flags

NameRemarks
AllocationType
MemoryProtection
FreeType
SetWindowPosFlags
ProcessAccess
RedrawWindowFlags
WindowPositionFlags

Enum

NameRemarks
ShowWindowCommands
MouseEvent
FreeType
HookType
GWL
GWLP
SM
CacheSlot
WINDOWCOMPOSITIONATTRIB
ACCENTSTATE

Example

InternetGetConnectedState

With the help of this method, you can check the status of the Internet

cs
public bool IsConnectedToInternet()
{
    return InteropMethods.InternetGetConnectedState(out int Desc, 0);
}

GetCursorPos

Get mouse Position

cs
var position = InteropMethods.GetCursorPos();

int X = position.X;
int Y = position.Y;

Released under the MIT License.