WinAPY Documentation




AbortSystemShutdown

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View AbortSystemShutdown on Microsoft Docs

1
2
def AbortSystemShutdown(computer: str) -> int:
...

AbortSystemShutdownA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View AbortSystemShutdownA on Microsoft Docs

1
2
def AbortSystemShutdownA(computer: str) -> int:
...

AbortSystemShutdownW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View AbortSystemShutdownW on Microsoft Docs

1
2
def AbortSystemShutdownW(computer: str) -> int:
...

ActivateKeyboardLayout

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View ActivateKeyboardLayout on Microsoft Docs

1
2
def ActivateKeyboardLayout(hkl: int, flags: int) -> HANDLE:
...

Beep

1
2
def Beep(freq: int, duration: int) -> bool:
...

Description

Generates simple tones on the speaker. The function is synchronous; it performs an alertable wait and does not return control to its caller until the sound finishes.

Parameters

freq int
The frequency of the sound, in hertz. This parameter must be in the range 37 through 32,767

duration int
The duration of the sound, in milliseconds.


BlockInput

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View BlockInput on Microsoft Docs

1
2
def BlockInput(b: bool) -> int:
...

CloseHandle

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CloseHandle on Microsoft Docs

1
2
def CloseHandle(h: HANDLE) -> int:
...

CommandLineToArgv

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CommandLineToArgv on Microsoft Docs

1
2
def CommandLineToArgv(cmd_line: str) -> str:
...

CommandLineToArgvW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CommandLineToArgvW on Microsoft Docs

1
2
def CommandLineToArgvW(cmd_line: str) -> str:
...

CopyFile

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CopyFile on Microsoft Docs

1
2
def CopyFile(current_file: str, new_file: str, bool_fail_if_exists: bool) -> int:
...

CopyFileA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CopyFileA on Microsoft Docs

1
2
def CopyFileA(current_file: str, new_file: str, bool_fail_if_exists: bool) -> int:
...

CopyFileW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View CopyFileW on Microsoft Docs

1
2
def CopyFileW(current_file: str, new_file: str, bool_fail_if_exists: bool) -> int:
...

DeleteFile

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View DeleteFile on Microsoft Docs

1
2
def DeleteFile(target_file: str) -> int:
...

DeleteFileA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View DeleteFileA on Microsoft Docs

1
2
def DeleteFileA(target_file: str) -> int:
...

DeleteFileW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View DeleteFileW on Microsoft Docs

1
2
def DeleteFileW(target_file: str) -> int:
...

DestroyIcon

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View DestroyIcon on Microsoft Docs

1
2
def DestroyIcon(ic: HICON) -> int:
...

DrawIcon

1
2
def DrawIcon(hdc: HDC, x: int, y: int, icon: HICON) -> bool:
...

Description

Draws an icon or cursor into the specified device context.

Parameters

hdc HDC
Handle to a device context

x int
The X-position to draw the icon at

y int
The Y-position to draw the icon at

icon HICON
The icon to be drawn


DrawIconEx

1
2
def DrawIconEx(hdc: HDC, x: int, y: int, icon: HICON, width: int, height: int, frame: int, brush: HBRUSH, diFlags: int) -> bool:
...

Description

Draws an icon or cursor into the specified device context performing the specified raster operations, and stretching or compressing the icon or cursor as specified.

Parameters

hdc HDC
Handle to a device context

x int
The X-position to draw the icon at

y int
The Y-position to draw the icon at

icon HICON
The icon to be drawn

width int
The logical width of the icon or cursor.

height int
The logical height of the icon or cursor.

frame int
The index of the frame to draw, if hIcon identifies an animated cursor. This parameter is ignored if the icon argument does not identify an animated cursor.

brush HBRUSH
A handle to a brush that the system uses for flicker-free drawing, or None.

diFlags int
Additional flags


EnableWindow

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View EnableWindow on Microsoft Docs

1
2
def EnableWindow(h: HWND, enabled: bool) -> int:
...

EnumChildWindows

1
2
def EnumChildWindows(hwnd: HWND, callback: FunctionType, lParam: AnyType) -> NoneType:
...

Description

Enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to the specified callback function. The callback function should look like this; ``def callback(hwnd, lparam)``.

Parameters

hwnd HWND
Handle to a window to enumerate, or None

callback FunctionType
Callback function to be called for every child window found with two arguments commonly named ``hWnd, lParam``.

lParam AnyType
[optional] This argument will be passed as the lParam value for the callback function, default is set to None.


ExitWindows

1
2
def ExitWindows() -> bool:
...

Description

Calls the ExitWindowsEx function to log off the interactive user.


ExitWindowsEx

1
2
def ExitWindowsEx(flags: int, reason: int) -> bool:
...

Description

Logs off the interactive user, shuts down the system, or shuts down and restarts the system. It sends the WM_QUERYENDSESSION message to all applications to determine if they can be terminated.

Parameters

flags int
The shutdown type.

reason int
The reason for initiating the shutdown.


ExtractIcon

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View ExtractIcon on Microsoft Docs

1
2
def ExtractIcon(hinst: HINSTANCE, name: str, index: int) -> HANDLE:
...

ExtractIconA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View ExtractIconA on Microsoft Docs

1
2
def ExtractIconA(hinst: HINSTANCE, name: str, index: int) -> HANDLE:
...

ExtractIconW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View ExtractIconW on Microsoft Docs

1
2
def ExtractIconW(hinst: HINSTANCE, name: str, index: int) -> HANDLE:
...

FillRect

1
2
def FillRect(hdc: HDC, rect: tuple, hbr: HBRUSH) -> HWND:
...

Description

Fills a rectangle by using the specified brush.

Parameters

hdc HDC
Handle to a device context

rect tuple
Rectangle to be filled; tuple of 4 integers (x1, y1, x2, y2)

hbr HBRUSH
Brush to paint the rectangle with


GetClientRect

1
2
def GetClientRect(hdc: HDC) -> tuple:
...

Description

Returns the coordinates of a window's client area as a tuple of four integers.

Parameters

hdc HDC
Handle to a device context


GetCommandLine

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetCommandLine on Microsoft Docs

1
2
def GetCommandLine() -> str:
...

GetCommandLineA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetCommandLineA on Microsoft Docs

1
2
def GetCommandLineA() -> str:
...

GetCommandLineW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetCommandLineW on Microsoft Docs

1
2
def GetCommandLineW() -> str:
...

GetComputerName

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetComputerName on Microsoft Docs

1
2
def GetComputerName() -> str:
...

GetComputerNameA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetComputerNameA on Microsoft Docs

1
2
def GetComputerNameA() -> str:
...

GetComputerNameEx

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetComputerNameEx on Microsoft Docs

1
2
def GetComputerNameEx(target_name: int) -> str:
...

GetComputerNameExA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetComputerNameExA on Microsoft Docs

1
2
def GetComputerNameExA(target_name: int) -> str:
...

GetComputerNameExW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetComputerNameExW on Microsoft Docs

1
2
def GetComputerNameExW(target_name: int) -> str:
...

GetComputerNameW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetComputerNameW on Microsoft Docs

1
2
def GetComputerNameW() -> str:
...

GetConsoleWindow

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetConsoleWindow on Microsoft Docs

1
2
def GetConsoleWindow() -> O:
...

GetCursorInfo

1
2
def GetCursorInfo() -> (int, HCURSOR, (int, int)):
...

Description

Returns information about the global cursor.


GetCursorPos

1
2
def GetCursorPos() -> bool:
...

Description

Returns the position of the mouse cursor, in a tuple of screen coordinates (x, y).


GetDC

1
2
def GetDC(hwnd: int) -> HDC:
...

Description

Retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC.

Parameters

hwnd int
Handle to the window to retrieve the Device Context from or None


GetDesktopWindow

1
2
def GetDesktopWindow() -> HWND:
...

Description

Retrieves a handle to the desktop window.


GetDialogBaseUnits

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetDialogBaseUnits on Microsoft Docs

1
2
def GetDialogBaseUnits():
...

GetDlgCtrlID

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetDlgCtrlID on Microsoft Docs

1
2
def GetDlgCtrlID(h: HWND) -> int:
...

GetKeyboardLayout

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetKeyboardLayout on Microsoft Docs

1
2
def GetKeyboardLayout(thread: int):
...

GetLastError

1
2
def GetLastError() -> int:
...

Description

Retrieves the last error code caused by a WinAPY function.


GetModuleHandle

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetModuleHandle on Microsoft Docs

1
2
def GetModuleHandle(module: str) -> HANDLE:
...

GetModuleHandleA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetModuleHandleA on Microsoft Docs

1
2
def GetModuleHandleA(module: str) -> HANDLE:
...

GetModuleHandleW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View GetModuleHandleW on Microsoft Docs

1
2
def GetModuleHandleW(module: str) -> HANDLE:
...

GetSystemMetrics

1
2
def GetSystemMetrics(int: nIndex) -> int:
...

Description

Retrieves the specified system metric or system configuration setting.

Parameters

int nIndex
The system metric or configuration setting to be retrieved.


GetTopWindow

1
2
def GetTopWindow(hWnd: HWND) -> HWND:
...

Description

Examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order.

Parameters

hWnd HWND
A handle to the parent window whose child windows are to be examined, or None.


GetWindowPlacement

1
2
def GetWindowPlacement(hwnd: HWND) -> (int, int, (int, int), (int, int), (int, int, int, int)):
...

Description

Returns the show state and the restored, minimized, and maximized positions of the specified window.

Parameters

hwnd HWND
Handle to a window


GetWindowRect

1
2
def GetWindowRect(hwnd: HWND) -> (int, int, int, int):
...

Description

Returns the dimensions of the bounding rectangle of the specified window.

Parameters

hwnd HWND
Handle to a window


GetWindowText

1
2
def GetWindowText(hwnd: HWND) -> str:
...

Description

Returns the specified windows' title bar text, as an UTF-16 string.

Parameters

hwnd HWND
Handle to a window


GetWindowTextA

1
2
def GetWindowTextA(hwnd: HWND) -> str:
...

Description

Returns the specified windows' title bar text, as an ASCII string.

Parameters

hwnd HWND
Handle to a window


GetWindowTextLength

1
2
def GetWindowTextLength(hwnd: HWND) -> int:
...

Description

Returns the length of the specified windows' title bar text, measured from an UTF-16 string.

Parameters

hwnd HWND
Handle to a window


GetWindowTextLengthA

1
2
def GetWindowTextLengthA(hwnd: HWND) -> int:
...

Description

Returns the length of the specified windows' title bar text, measured from an ASCII string.

Parameters

hwnd HWND
Handle to a window


GetWindowTextLengthW

1
2
def GetWindowTextLengthW(hwnd: HWND) -> int:
...

Description

Returns the length of the specified windows' title bar text, measured from an UTF-16 string.

Parameters

hwnd HWND
Handle to a window


GetWindowTextW

1
2
def GetWindowTextW(hwnd: HWND) -> str:
...

Description

Returns the specified windows' title bar text, as an UTF-16 string.

Parameters

hwnd HWND
Handle to a window


InitiateSystemShutdown

1
2
def InitiateSystemShutdown(machine: str, message: str, displayTime: int, bForceAppsClosed: bool, bRebootAfterShutdown: bool) -> bool:
...

Description

Initiates a shutdown and optional restart of the specified computer.

Parameters

machine str
The network name of the computer to be shut down, or None to shut down the current machine.

message str
The message to display before shutdown, or None.

displayTime int
The length of time that the shutdown dialog box should be displayed, in seconds.

bForceAppsClosed bool
Whether applications should be force closed or not.

bRebootAfterShutdown bool
Whether the machine should restart or not.


InitiateSystemShutdownA

1
2
def InitiateSystemShutdownA(machine: str, message: str, displayTime: int, bForceAppsClosed: bool, bRebootAfterShutdown: bool) -> bool:
...

Description

Initiates a shutdown and optional restart of the specified computer.

Parameters

machine str
The network name of the computer to be shut down, or None to shut down the current machine.

message str
The message to display before shutdown, or None.

displayTime int
The length of time that the shutdown dialog box should be displayed, in seconds.

bForceAppsClosed bool
Whether applications should be force closed or not.

bRebootAfterShutdown bool
Whether the machine should restart or not.


InitiateSystemShutdownW

1
2
def InitiateSystemShutdownW(machine: str, message: str, displayTime: int, bForceAppsClosed: bool, bRebootAfterShutdown: bool) -> bool:
...

Description

Initiates a shutdown and optional restart of the specified computer.

Parameters

machine str
The network name of the computer to be shut down, or None to shut down the current machine.

message str
The message to display before shutdown, or None.

displayTime int
The length of time that the shutdown dialog box should be displayed, in seconds.

bForceAppsClosed bool
Whether applications should be force closed or not.

bRebootAfterShutdown bool
Whether the machine should restart or not.


InvalidateRect

1
2
def InvalidateRect(hwnd: HWND, rect: tuple, erase: bool) -> bool:
...

Description

Returns a handle to one of the stock pens, brushes, fonts, or palettes.

Parameters

hwnd HWND
Handle to a window, or None

rect tuple
Rectangle with coordinates to be redrawn (x1, y1, x2, y2), or None

erase bool
Whether the background within the update region is to be erased when the update region is processed.


LoadCursor

1
2
def LoadCursor(hInstance: HINSTANCE, cursor: int) -> HCURSOR:
...

Description

Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.

Parameters

hInstance HINSTANCE
A handle to an instance of the module whose executable file contains the cursor to be loaded, or None.

cursor int
The name of the cursor resource to be loaded.


LoadCursorA

1
2
def LoadCursorA(hInstance: HINSTANCE, cursor: int) -> HCURSOR:
...

Description

Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.

Parameters

hInstance HINSTANCE
A handle to an instance of the module whose executable file contains the cursor to be loaded, or None.

cursor int
The name of the cursor resource to be loaded.


LoadCursorFromFile

1
2
def LoadCursorFromFile(fName: str) -> HCURSOR:
...

Description

Creates a cursor based on data contained in a file.

Parameters

fName str
The source of the file data to be used to create the cursor. The data in the file must be in either .CUR or .ANI format.


LoadCursorFromFileA

1
2
def LoadCursorFromFileA(fName: str) -> HCURSOR:
...

Description

Creates a cursor based on data contained in a file.

Parameters

fName str
The source of the file data to be used to create the cursor. The data in the file must be in either .CUR or .ANI format.


LoadCursorFromFileW

1
2
def LoadCursorFromFileW(fName: str) -> HCURSOR:
...

Description

Creates a cursor based on data contained in a file.

Parameters

fName str
The source of the file data to be used to create the cursor. The data in the file must be in either .CUR or .ANI format.


LoadCursorW

1
2
def LoadCursorW(hInstance: HINSTANCE, cursor: int) -> HCURSOR:
...

Description

Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.

Parameters

hInstance HINSTANCE
A handle to an instance of the module whose executable file contains the cursor to be loaded, or None.

cursor int
The name of the cursor resource to be loaded.


LoadIcon

1
2
def LoadIcon(hInstance: int, IconName: int) -> HICON:
...

Description

Loads the specified icon resource from the executable (.exe) file associated with an application instance or a predefined icon.

Parameters

hInstance int
Handle to the instance whose executable file contains the icon to be loaded, or None.

IconName int
The icon to be loaded, parsed as an UTF-16 string from an integer


LoadIconA

1
2
def LoadIconA(hInstance: int, IconName: int) -> HICON:
...

Description

Loads the specified icon resource from the executable (.exe) file associated with an application instance or a predefined icon.

Parameters

hInstance int
Handle to the instance whose executable file contains the icon to be loaded, or None.

IconName int
The icon to be loaded, parsed as an ASCII string from an integer


LoadIconW

1
2
def LoadIconW(hInstance: int, IconName: int) -> HICON:
...

Description

Loads the specified icon resource from the executable (.exe) file associated with an application instance or a predefined icon.

Parameters

hInstance int
Handle to the instance whose executable file contains the icon to be loaded, or None.

IconName int
The icon to be loaded, parsed as an UTF-16 string from an integer


LoadImage

1
2
def LoadImage(hInstance: HINSTANCE, name: int/str, type: int, width: int, height: int, fLoad: int) -> HANDLE:
...

Description

Loads an icon, cursor, animated cursor, or bitmap.

Parameters

hInstance HINSTANCE
A handle to the module of either a DLL or executable (.exe) that contains the image to be loaded, or None.

name int/str
The image to be loaded.

type int
The type of image to be loaded.

width int
The width, in pixels, of the icon or cursor.

height int
The height, in pixels, of the icon or cursor.

fLoad int
Any of the following values; ``LR_CREATEDIBSECTION, LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LR_LOADFROMFILE, LR_LOADMAP3DCOLORS, LR_LOADTRANSPARENT, LR_MONOCHROME, LR_SHARED or LR_VGACOLOR``


LoadImageA

1
2
def LoadImageA(hInstance: HINSTANCE, name: int/str, type: int, width: int, height: int, fLoad: int) -> HANDLE:
...

Description

Loads an icon, cursor, animated cursor, or bitmap.

Parameters

hInstance HINSTANCE
A handle to the module of either a DLL or executable (.exe) that contains the image to be loaded, or None.

name int/str
The image to be loaded.

type int
The type of image to be loaded.

width int
The width, in pixels, of the icon or cursor.

height int
The height, in pixels, of the icon or cursor.

fLoad int
Any of the following values; ``LR_CREATEDIBSECTION, LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LR_LOADFROMFILE, LR_LOADMAP3DCOLORS, LR_LOADTRANSPARENT, LR_MONOCHROME, LR_SHARED or LR_VGACOLOR``


LoadImageW

1
2
def LoadImageW(hInstance: HINSTANCE, name: int/str, type: int, width: int, height: int, fLoad: int) -> HANDLE:
...

Description

Loads an icon, cursor, animated cursor, or bitmap.

Parameters

hInstance HINSTANCE
A handle to the module of either a DLL or executable (.exe) that contains the image to be loaded, or None.

name int/str
The image to be loaded.

type int
The type of image to be loaded.

width int
The width, in pixels, of the icon or cursor.

height int
The height, in pixels, of the icon or cursor.

fLoad int
Any of the following values; ``LR_CREATEDIBSECTION, LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LR_LOADFROMFILE, LR_LOADMAP3DCOLORS, LR_LOADTRANSPARENT, LR_MONOCHROME, LR_SHARED or LR_VGACOLOR``


MessageBeep

1
2
def MessageBeep(sound: int) -> int:
...

Description

Plays a waveform sound. The waveform sound for each sound type is identified by an entry in the registry.

Parameters

sound int
The sound to be played. The sounds are set by the user through the Sound control panel application, and then stored in the registry. Any of the Message Box icon values or 0xFFFFFFFF.


MessageBox

1
2
def MessageBox(hWnd: HWND, msg: str, title: str, type: int) -> int:
...

Description

Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.

Parameters

hWnd HWND
The parent window of the Message Box, or None.

msg str
The message to be displayed, as an UTF-16 string.

title str
The dialog box title, as an UTF-16 string.

type int
The contents and behavior of the dialog box.


MessageBoxA

1
2
def MessageBoxA(hWnd: HWND, msg: str, title: str, type: int) -> int:
...

Description

Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.

Parameters

hWnd HWND
The parent window of the Message Box, or None.

msg str
The message to be displayed, as an ASCII string.

title str
The dialog box title, as an ASCII string.

type int
The contents and behavior of the dialog box.


MessageBoxIndirect

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View MessageBoxIndirect on Microsoft Docs

1
2
def MessageBoxIndirect(hwnd: int, ic: HICON) -> int:
...

MessageBoxIndirectA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View MessageBoxIndirectA on Microsoft Docs

1
2
def MessageBoxIndirectA(hwnd: int, ic: HICON) -> int:
...

MessageBoxIndirectW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View MessageBoxIndirectW on Microsoft Docs

1
2
def MessageBoxIndirectW(hwnd: int, ic: HICON) -> int:
...

MessageBoxW

1
2
def MessageBoxW(hWnd: HWND, msg: str, title: str, type: int) -> int:
...

Description

Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.

Parameters

hWnd HWND
The parent window of the Message Box, or None.

msg str
The message to be displayed, as an UTF-16 string.

title str
The dialog box title, as an UTF-16 string.

type int
The contents and behavior of the dialog box.


PlaySound

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View PlaySound on Microsoft Docs

1
2
def PlaySound(sound: str/int, mod: int, flags: int) -> int:
...

PlaySoundA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View PlaySoundA on Microsoft Docs

1
2
def PlaySoundA(sound: str/int, mod: int, flags: int) -> int:
...

PlaySoundW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View PlaySoundW on Microsoft Docs

1
2
def PlaySoundW(sound: str/int, mod: int, flags: int) -> int:
...

RedrawWindow

1
2
def RedrawWindow(hwnd: HWND, rect: tuple, region: HRGN, flags: int) -> bool:
...

Description

Redraws a portion or the entire specified window.

Parameters

hwnd HWND
Handle to a window, or None

rect tuple
Rectangle with coordinates to be redrawn (x1, y1, x2, y2), or None

region HRGN
Handle to a region to be redrawn, or None

flags int
[optional] Redrawing flags. Default are RDW_ALLCHILDREN, RDW_ERASE and RDW_INVALIDATE


ReleaseDC

1
2
def ReleaseDC(hwnd: HWND, hdc: HDC) -> bool:
...

Description

Releases a device context, making it available to other applications.

Parameters

hwnd HWND
Handle to a window to be released

hdc HDC
A handle to a device context to be released


SendDlgItemMessage

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SendDlgItemMessage on Microsoft Docs

1
2
def SendDlgItemMessage(h_dlg: HWND, item: int, msg: int, w_param: str/int, l_param: str/int/tuple) -> HANDLE:
...

SendDlgItemMessageA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SendDlgItemMessageA on Microsoft Docs

1
2
def SendDlgItemMessageA(h_dlg: HWND, item: int, msg: int, w_param: str/int, l_param: str/int/tuple) -> HANDLE:
...

SendDlgItemMessageW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SendDlgItemMessageW on Microsoft Docs

1
2
def SendDlgItemMessageW(h_dlg: HWND, item: int, msg: int, w_param: str/int, l_param: str/int/tuple) -> HANDLE:
...

SendMessage

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SendMessage on Microsoft Docs

1
2
def SendMessage(h: HWND, msg: int, w_param: int, l_param_x: str/int, l_param_y: int) -> HANDLE:
...

SendMessageA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SendMessageA on Microsoft Docs

1
2
def SendMessageA(h: HWND, msg: int, w_param: int, l_param_x: str/int, l_param_y: int) -> HANDLE:
...

SendMessageW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SendMessageW on Microsoft Docs

1
2
def SendMessageW(h: HWND, msg: int, w_param: int, l_param_x: str/int, l_param_y: int) -> HANDLE:
...

SetCursorPos

1
2
def SetCursorPos(x: int, y: int) -> bool:
...

Description

Moves the cursor to the specified screen coordinates.

Parameters

x int
The new X-coordinate of the cursor

y int
The new Y-coordinate of the cursor


SetDlgItemText

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SetDlgItemText on Microsoft Docs

1
2
def SetDlgItemText(h: HWND, ctrl: int, s: str) -> int:
...

SetDlgItemTextA

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SetDlgItemTextA on Microsoft Docs

1
2
def SetDlgItemTextA(h: HWND, ctrl: int, s: str) -> int:
...

SetDlgItemTextW

Note that this documentation has been automatically generated. It may be flawed or incorrect.

View SetDlgItemTextW on Microsoft Docs

1
2
def SetDlgItemTextW(h: HWND, ctrl: int, s: str) -> int:
...

ShowWindow

1
2
def ShowWindow(hwnd: HWND, nCmdShow: int) -> bool:
...

Description

Sets the specified window's show state.

Parameters

hwnd HWND
Handle to a window

nCmdShow int
The new show state.


Sleep

1
2
def Sleep(dwMilliseconds: int) -> NoneType:
...

Description

Sleeps for the specified duration, in milliseconds.

Parameters

dwMilliseconds int
The amount to wait in milliseconds


SwitchToThisWindow

1
2
def SwitchToThisWindow(hwnd: HWND, bAltTab: bool) -> NoneType:
...

Description

[This function is not made for general use. It can be unavailable in future versions of Windows.] Switches focus to the specified window and brings it to the foreground.

Parameters

hwnd HWND
Handle to a window

bAltTab bool
Specifies whether the window is being switched to using the Alt/Ctl+Tab key sequence or not.


WindowFromDC

1
2
def WindowFromDC(hdc: HDC) -> HWND:
...

Description

Returns a handle to the window associated with the specified display device context.

Parameters

hdc HDC
Handle to a device context


WindowFromPhysicalPoint

1
2
def WindowFromPhysicalPoint(point: tuple) -> HWND:
...

Description

Returns a handle to the window that contains the specified physical point.

Parameters

point tuple
The point to be checked, as a tuple of two integers (x, y).


WindowFromPoint

1
2
def WindowFromPoint(point: tuple) -> HWND:
...

Description

Returns a handle to the window that contains the specified point. Returns a handle to the window if it exists at the specified point, otherwise None.

Parameters

point tuple
The point to be checked, as a tuple of two integers (x, y).


rand

1
2
def rand() -> int:
...

Description

Generates a random integer.