Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 2.75 KB

WinAPI.md

File metadata and controls

59 lines (47 loc) · 2.75 KB

WinAPI

list is not ranked

Retrieves information about the system's current usage of both physical and virtual memory.

P/Invoke

[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool GlobalMemoryStatus(ref MemoryStatus lpBuffer);

This function retrieves the handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows.

P/Invoke

[DllImport("User32.dll", EntryPoint = "FindWindow")]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);

Retrieves a handle to a window whose class name and window name match the specified strings. The function searches child windows, beginning with the one following the specified child window. This function does not perform a case-sensitive search.

P/Invoke

[DllImport("User32.dll", EntryPoint = "FindWindowEx")]
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpClassName, string lpWindowName);

This function sends the specified message to a window or windows

P/Invoke

[DllImport("user32.dll", EntryPoint = "SendMessageA")]
public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
  • ShowWindow Sets the specified window's show state.

P/Invoke

[DllImport("user32.dll", EntryPoint = "ShowWindow")]
public static extern int SendMessage(IntPtr hwnd, int nCmdShow);
  • GetUserName Retrieves the name of the user associated with the current thread.

P/Invoke

[DllImport("Advapi32.dll", EntryPoint = "GetUserName")]
public static extern int GetUserName(StringBuilder lpBuffer, int pcbBuffer);
  • ReleaseCapture Releases the mouse capture from a window in the current thread and restores normal mouse input processing. A window that has captured the mouse receives all mouse input, regardless of the position of the cursor, except when a mouse button is clicked while the cursor hot spot is in the window of another thread.