Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 39 additions & 36 deletions stubs/pywin32/_win32typing.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module.
from _typeshed import Incomplete, Unused
from collections.abc import Iterable
from typing import Literal, final, overload
from collections.abc import Iterable, Sequence
from typing import Literal, SupportsIndex, final, overload
from typing_extensions import Self, TypeAlias, deprecated

from win32.lib.pywintypes import TimeType

_TwoIntSequence: TypeAlias = Sequence[int]
_FourIntSequence: TypeAlias = Sequence[int]

class ArgNotFound: ...
class PyOleEmpty: ...
class PyOleMissing: ...
Expand Down Expand Up @@ -74,30 +77,24 @@ class PyNCB:
@property
def Bufflen(self): ...
@property
def Callname(self): ...
@property
def Cmd_cplt(self): ...
@property
def Command(self): ...
@property
def Event(self): ...
@property
def Lana_num(self): ...
@property
def Lsn(self): ...
@property
def Name(self): ...
@property
def Num(self): ...
@property
def Post(self): ...
def Reset(self, *args): ... # incomplete
@property
def Retcode(self): ...
@property
def Rto(self): ...
def Callname(self) -> str: ...
@Callname.setter
def Callname(self, value: str | bytes) -> None: ...
Cmd_cplt: int
Command: int
Event: int
Lana_num: int
Lsn: int
@property
def Sto(self): ...
def Name(self) -> str: ...
@Name.setter
def Name(self, value: str | bytes) -> None: ...
Num: int
Post: int
def Reset(self) -> None: ...
Retcode: int
Rto: int
Sto: int

class COMMTIMEOUTS: ...
class CopyProgressRoutine: ...
Expand Down Expand Up @@ -613,7 +610,7 @@ class PyConsoleScreenBuffer:
class PyCredHandle:
def Detach(self): ...
def FreeCredentialsHandle(self) -> None: ...
def QueryCredentialsAttributes(self, Attribute, /) -> None: ...
def QueryCredentialsAttributes(self, Attribute: int, /) -> str: ...

class PyCtxtHandle:
def Detach(self): ...
Expand Down Expand Up @@ -1668,6 +1665,7 @@ class PySecBufferDesc:
Version: Incomplete
Buffer: Incomplete
def append(self, buffer, /) -> None: ...
def __getitem__(self, index: SupportsIndex) -> PySecBuffer: ...

class PyTOKEN_GROUPS: ...
class PyTOKEN_PRIVILEGES: ...
Expand Down Expand Up @@ -2368,7 +2366,7 @@ class Pymmapfile:
def read_byte(self): ...
def read_line(self): ...
def resize(self, MaximumSize, FileOffset: int = ..., NumberOfBytesToMap: int = ...) -> None: ...
def seek(self, dist, how: int = ..., /) -> None: ...
def seek(self, dist: int, how: int = ..., /) -> None: ...
def size(self): ...
def tell(self): ...
def write(self, data, /) -> None: ...
Expand Down Expand Up @@ -4772,7 +4770,9 @@ class SHFILEOPSTRUCT: ...
class SI_ACCESS: ...
class SI_INHERIT_TYPE: ...
class SI_OBJECT_INFO: ...
class STATSTG: ...

STATSTG: TypeAlias = tuple[str | None, int, int, TimeType, TimeType, TimeType, int, int, PyIID, int, int]

class TLIBATTR: ...

class TYPEATTR:
Expand Down Expand Up @@ -4858,7 +4858,7 @@ class PyCBitmap:
def SaveBitmapFile(self, dcObject: PyCDC, Filename: str, /): ...

class PyCBrush:
def CreateSolidBrush(self) -> None: ...
def CreateSolidBrush(self, i: int) -> None: ...
def GetSafeHandle(self): ...

class PyCButton:
Expand Down Expand Up @@ -5401,7 +5401,7 @@ class PyCMenu:
def GetSubMenu(self, pos, /) -> PyCMenu: ...
def InsertMenu(self, pos, flags, _id: PyCMenu | int = ..., value: str | None = ..., /) -> None: ...
def ModifyMenu(self, pos, flags, _id: int = ..., value: str | None = ..., /) -> None: ...
def TrackPopupMenu(self, arg: tuple[Incomplete, Incomplete], arg1, arg2: PyCWnd, /) -> None: ...
def TrackPopupMenu(self, x_y: _TwoIntSequence, flags: int = ..., owner: PyCWnd = ..., /) -> None: ...

class PyCOleClientItem:
def CreateNewItem(self) -> None: ...
Expand Down Expand Up @@ -5647,10 +5647,10 @@ class PyCSpinButtonCtrl:
def SetRange(self): ...
def SetRange32(self): ...

class PyCSplitterWnd:
class PyCSplitterWnd: # aka PyCSplitter
def GetPane(self, row, col, /) -> PyCWnd: ...
def CreateView(self, view: PyCView, row, col, arg: tuple[Incomplete, Incomplete], /) -> None: ...
def CreateStatic(self, parent, rows, cols, style, _id, /) -> None: ...
def CreateStatic(self, parent: PyCSplitterWnd, rows, cols, style=..., _id=..., /) -> None: ...
def SetColumnInfo(self, column, ideal, _min, /) -> None: ...
def SetRowInfo(self, row, ideal, _min, /) -> None: ...
def IdFromRowCol(self, row, col, /) -> None: ...
Expand Down Expand Up @@ -5964,15 +5964,18 @@ class PyCWnd:
def RunModalLoop(self, flags, /): ...
def PostMessage(self, idMessage, wParam: int = ..., lParam: int = ..., /) -> None: ...
def SendMessageToDescendants(self, idMessage, wParam: int = ..., lParam: int = ..., bDeep: int = ..., /) -> None: ...
def SendMessage(self, idMessage, idMessage1, ob, wParam: int = ..., lParam: int = ..., /) -> None: ...
def SendMessage(self, idMessage, wParam: int = ..., lParam: int = ..., /) -> None: ...
def SetActiveWindow(self) -> PyCWnd: ...
def SetForegroundWindow(self) -> None: ...
def SetWindowPos(
self, hWndInsertAfter, position: tuple[Incomplete, Incomplete, Incomplete, Incomplete], flags, /
) -> None: ...
def ScreenToClient(
self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete], pnt, /
) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ...
@overload
def ScreenToClient(self, rect: tuple[int, int], /) -> tuple[int, int]: ...
@overload
def ScreenToClient(self, rect: tuple[int, int, int, int], /) -> tuple[int, int, int, int]: ...
@overload
def ScreenToClient(self, rect: _TwoIntSequence | _FourIntSequence, /) -> tuple[int, int] | tuple[int, int, int, int]: ...
def SetCapture(self) -> None: ...
def SetDlgItemText(self, idControl, text: str, /) -> None: ...
def SetFocus(self) -> None: ...
Expand Down
24 changes: 16 additions & 8 deletions stubs/pywin32/pythoncom.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from collections.abc import Sequence
from typing import SupportsInt, overload
from typing_extensions import TypeAlias, deprecated

import _win32typing
Expand Down Expand Up @@ -72,7 +74,7 @@ def MakePyFactory(iid: _win32typing.PyIID, /) -> _win32typing.PyIClassFactory: .
@deprecated("Use pywintypes.IID() instead.")
def MakeIID(iidString: str, is_bytes: bool = ..., /) -> _win32typing.PyIID: ...
@deprecated("Use pywintypes.Time() instead.")
def MakeTime(timeRepr, /) -> TimeType: ...
def MakeTime(timeRepr: SupportsInt | Sequence[SupportsInt] | TimeType, /) -> TimeType: ...
def MkParseDisplayName(
displayName: str, bindCtx: _win32typing.PyIBindCtx | None = ..., /
) -> tuple[_win32typing.PyIMoniker, Incomplete, _win32typing.PyIBindCtx]: ...
Expand Down Expand Up @@ -101,28 +103,34 @@ def RevokeActiveObject(handle, /) -> None: ...
def RegisterDragDrop(hwnd: int, dropTarget: _win32typing.PyIDropTarget, /) -> None: ...
def RevokeDragDrop(hwnd: int, /) -> None: ...
def DoDragDrop() -> None: ...
def StgCreateDocfile(name: str, mode, reserved: int = ..., /) -> _win32typing.PyIStorage: ...
def StgCreateDocfile(name: str | None, mode: int, reserved: int = ..., /) -> _win32typing.PyIStorage: ...
def StgCreateDocfileOnILockBytes(lockBytes: _win32typing.PyILockBytes, mode, reserved=..., /) -> _win32typing.PyIStorage: ...
def StgOpenStorageOnILockBytes(
lockBytes: _win32typing.PyILockBytes,
stgPriority: _win32typing.PyIStorage,
mode,
snbExclude: Incomplete | None = ...,
reserved: int = ...,
/,
) -> _win32typing.PyIStorage: ...
def StgIsStorageFile(name: str, /): ...
def STGMEDIUM() -> _win32typing.PySTGMEDIUM: ...
@overload
def StgOpenStorage(
name: str, other: _win32typing.PyIStorage, mode, snbExclude: Incomplete | None = ..., reserved=..., /
name: str | None, other: _win32typing.PyIStorage, mode: int, snbExclude: Unused = ..., reserved: int = ..., /
) -> _win32typing.PyIStorage: ...
@overload
def StgOpenStorage(
name: str, other: _win32typing.PyIStorage | None, mode: int, snbExclude: Unused = ..., reserved: int = ..., /
) -> _win32typing.PyIStorage: ...
def StgOpenStorageEx(
Name: str, Mode, stgfmt, Attrs, riid: _win32typing.PyIID, StgOptions: Incomplete | None = ...
Name: str, Mode: int, stgfmt: int, Attrs: int, riid: _win32typing.PyIID, StgOptions: Incomplete | None = ...
) -> _win32typing.PyIStorage: ...
def StgCreateStorageEx(
Name: str,
Mode,
stgfmt,
Attrs,
Mode: int,
stgfmt: int,
Attrs: int,
riid: _win32typing.PyIID,
StgOptions: Incomplete | None = ...,
SecurityDescriptor: _win32typing.PySECURITY_DESCRIPTOR | None = ...,
Expand Down
19 changes: 11 additions & 8 deletions stubs/pywin32/pythonwin/win32ui.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from _typeshed import Incomplete, Unused
from _typeshed import Incomplete, OptExcInfo, Unused
from collections.abc import Callable

import _win32typing

Expand Down Expand Up @@ -70,10 +71,12 @@ def CreateRichEditDocTemplate(idRes, /) -> _win32typing.PyCRichEditDocTemplate:
def CreateRichEditView(doc: _win32typing.PyCDocument | None = ..., /) -> _win32typing.PyCRichEditView: ...
def CreateSliderCtrl() -> _win32typing.PyCSliderCtrl: ...
def CreateSplitter() -> _win32typing.PyCSplitterWnd: ...
def CreateStatusBar(parent: _win32typing.PyCWnd, arg, arg1, ctrlStype=..., /) -> _win32typing.PyCStatusBar: ...
def CreateStatusBar(
parent: _win32typing.PyCWnd, style: int = ..., windowId: int = ..., ctrlStype: int = ..., /
) -> _win32typing.PyCStatusBar: ...
def CreateStatusBarCtrl() -> _win32typing.PyCStatusBarCtrl: ...
def CreateFont(properties, /) -> _win32typing.PyCFont: ...
def CreateToolBar(parent: _win32typing.PyCWnd, style, arg, /) -> _win32typing.PyCToolBar: ...
def CreateToolBar(parent: _win32typing.PyCWnd, style: int, windowId: int = ..., /) -> _win32typing.PyCToolBar: ...
def CreateToolBarCtrl() -> _win32typing.PyCToolBarCtrl: ...
def CreateToolTipCtrl() -> _win32typing.PyCToolTipCtrl: ...
def CreateThread() -> _win32typing.PyCWinThread: ...
Expand All @@ -84,7 +87,7 @@ def CreateWindowFromHandle(hwnd: int, /) -> _win32typing.PyCWnd: ...
def CreateWnd() -> _win32typing.PyCWnd: ...
def DestroyDebuggerThread() -> None: ...
def DoWaitCursor(code, /) -> None: ...
def DisplayTraceback() -> None: ...
def DisplayTraceback(exc_info: OptExcInfo, title: str, /) -> None: ...
def Enable3dControls(): ...
def FindWindow(className: str, windowName: str, /) -> _win32typing.PyCWnd: ...
def FindWindowEx(
Expand All @@ -111,16 +114,16 @@ def GetResource() -> _win32typing.PyDLL: ...
def GetThread() -> _win32typing.PyCWinApp: ...
def GetType(): ...
def InitRichEdit() -> str: ...
def InstallCallbackCaller(): ...
def InstallCallbackCaller(caller: Callable[..., Incomplete] | None): ...
def IsDebug() -> int: ...
def IsWin32s() -> int: ...
def IsObject(o: object, /) -> bool: ...
def LoadDialogResource(idRes, dll: _win32typing.PyDLL | None = ..., /): ...
def LoadLibrary(fileName: str, /) -> _win32typing.PyDLL: ...
def LoadMenu(_id, dll: _win32typing.PyDLL | None = ..., /) -> _win32typing.PyCMenu: ...
def LoadStdProfileSettings(maxFiles, /) -> None: ...
def LoadStdProfileSettings(maxFiles: int = ..., /) -> None: ...
def LoadString(stringId, /) -> str: ...
def MessageBox(message: str, arg, title: str | None = ..., /): ...
def MessageBox(message: str, title: str | None = ..., style=..., /): ...
def OutputDebugString(msg: str, /) -> None: ...
def EnableControlContainer(): ...
def PrintTraceback(tb, output, /) -> None: ...
Expand All @@ -131,7 +134,7 @@ def SetAppHelpPath(): ...
def SetAppName(appName: str, /): ...
def SetCurrentInstanceHandle(newVal, /): ...
def SetCurrentResourceHandle(newVal, /): ...
def SetDialogBkColor(arg, arg1, /): ...
def SetDialogBkColor(clrCtlBk: int = ..., clrCtlText: int = ..., /) -> None: ...
def SetProfileFileName(filename: str, /) -> None: ...
def SetRegistryKey(key: str, /) -> None: ...
def SetResource(dll, /) -> _win32typing.PyDLL: ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/pywin32/pythonwin/win32uiole.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def CreateInsertDialog() -> _win32typing.PyCOleInsertDialog: ...
def CreateOleClientItem() -> _win32typing.PyCOleClientItem: ...
def CreateOleDocument(template: _win32typing.PyCDocTemplate, fileName: str | None = ..., /) -> _win32typing.PyCOleDocument: ...
def DaoGetEngine() -> _win32typing.PyIDispatch: ...
def GetIDispatchForWindow() -> _win32typing.PyIDispatch: ...
def GetIDispatchForWindow(Wnd, /) -> _win32typing.PyIDispatch: ...
def OleGetUserCtrl(): ...
def OleSetUserCtrl(bUserCtrl, /): ...
def SetMessagePendingDelay(delay, /) -> None: ...
Expand Down
11 changes: 6 additions & 5 deletions stubs/pywin32/win32/lib/pywintypes.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Can't generate with stubgen because `import pywintypes` must be called first.
# Otherwise you get the error: "KeyError: 'pywintypes'"
from _typeshed import Incomplete
from collections.abc import Sequence
from datetime import datetime
from typing import ClassVar, Literal, NoReturn, overload
from typing import ClassVar, Final, NoReturn, SupportsInt, overload
from typing_extensions import Never, TypeAlias, deprecated

import _win32typing
Expand Down Expand Up @@ -32,13 +33,13 @@ class TimeType(datetime): # aka: PyTime, PyDateTime

IIDType = _win32typing.PyIID

def DosDateTimeToTime() -> TimeType: ...
def DosDateTimeToTime(FatDate: int, FatTime: int, /) -> TimeType: ...
def Unicode() -> str: ...
def UnicodeFromRaw(_str: str, /) -> str: ...
def IsTextUnicode(_str: str, flags, /) -> tuple[Incomplete, Incomplete]: ...
def OVERLAPPED() -> _win32typing.PyOVERLAPPED: ...
def IID(iidString: str, is_bytes: bool = ..., /) -> _win32typing.PyIID: ...
def Time(timeRepr, /) -> TimeType: ...
def Time(timeRepr: SupportsInt | Sequence[SupportsInt] | TimeType, /) -> TimeType: ...
def CreateGuid() -> _win32typing.PyIID: ...
def ACL(bufSize: int = ..., /) -> _win32typing.PyACL: ...
def SID(buffer, idAuthority, subAuthorities, bufSize=..., /) -> _win32typing.PySID: ...
Expand All @@ -53,6 +54,6 @@ def TimeStamp(timestamp: tuple[int, int], /) -> TimeType: ...
@overload
def TimeStamp(timestamp: int, /) -> TimeType: ...

FALSE: Literal[False]
TRUE: Literal[True]
FALSE: Final = False
TRUE: Final = True
WAVE_FORMAT_PCM: int
14 changes: 7 additions & 7 deletions stubs/pywin32/win32/win32api.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def GetProcAddress(hModule: int, functionName: _win32typing.PyResourceId, /): ..
def GetProfileVal(section: str, entry: str, defValue: str, iniName: str | None = ..., /) -> str: ...
def GetShortPathName(path: str, /) -> str: ...
def GetStdHandle(handle: int, /) -> _win32typing.PyHANDLE: ...
def GetSysColor(index, /): ...
def GetSysColor(index: int, /) -> int: ...
def GetSystemDefaultLangID(): ...
def GetSystemDefaultLCID(): ...
def GetSystemDirectory() -> str: ...
Expand Down Expand Up @@ -153,8 +153,8 @@ def LoadLibrary(fileName: str, /): ...
def LoadLibraryEx(fileName: str, handle: int, handle1, /) -> int: ...
def LoadResource(handle: int, _type: _win32typing.PyResourceId, name: _win32typing.PyResourceId, language, /) -> str: ...
def LoadString(handle: int, stringId, numChars: int = ..., /) -> str: ...
def MessageBeep(arg, /): ...
def MessageBox(hwnd: int, message: str, title: str, arg, arg1, /): ...
def MessageBeep(type: int, /): ...
def MessageBox(hwnd: int | None, message: str, title: str | None = ..., style=..., language=..., /) -> int: ...
def MonitorFromPoint(pt: tuple[Incomplete, Incomplete], Flags: int = ...) -> int: ...
def MonitorFromRect(rc: _win32typing.PyRECT | tuple[int, int, int, int], Flags: int = ...) -> int: ...
def MonitorFromWindow(hwnd: int, Flags: int = ...) -> int: ...
Expand Down Expand Up @@ -189,7 +189,7 @@ def RegEnumValue(key: _win32typing.PyHKEY, index, /) -> tuple[str, Incomplete, I
def RegFlushKey(key: _win32typing.PyHKEY, /) -> None: ...
def RegGetKeySecurity(key: _win32typing.PyHKEY, security_info, /) -> _win32typing.PySECURITY_DESCRIPTOR: ...
def RegLoadKey(key: _win32typing.PyHKEY, subKey: str, filename: str, /) -> None: ...
def RegOpenCurrentUser(samDesired, /) -> _win32typing.PyHKEY: ...
def RegOpenCurrentUser(samDesired=..., /) -> _win32typing.PyHKEY: ...
def RegOpenKey(
key: _win32typing.PyHKEY | int, subkey: str | None, reserved: bool = ..., sam: int = ..., /
) -> _win32typing.PyHKEY: ...
Expand All @@ -198,7 +198,7 @@ def RegOpenKeyTransacted(
Key: _win32typing.PyHKEY, SubKey: str, samDesired, Transaction: int, Options: int = ...
) -> _win32typing.PyHKEY: ...
def RegOverridePredefKey(Key: _win32typing.PyHKEY, NewKey: _win32typing.PyHKEY) -> None: ...
def RegQueryValue(key: _win32typing.PyHKEY, subKey: str, /) -> str: ...
def RegQueryValue(key: _win32typing.PyHKEY | int, subKey: str | None, /) -> str: ...
def RegQueryValueEx(key: _win32typing.PyHKEY | int, valueName: str | None, /) -> tuple[str, int]: ...
def RegQueryInfoKey(key: _win32typing.PyHKEY, /) -> tuple[Incomplete, Incomplete, Incomplete]: ...
def RegQueryInfoKeyW(Key: _win32typing.PyHKEY, /): ...
Expand Down Expand Up @@ -256,7 +256,7 @@ def UpdateResource(
language: int = ...,
/,
) -> None: ...
def VkKeyScan(char, char1, /): ...
def VkKeyScan(char: str | bytes, /): ...
def WinExec(cmdLine: str, arg, /) -> None: ...
def WinHelp(hwnd: int, hlpFile: str, cmd, data: str | int = ..., /) -> None: ...
@deprecated("This function is obsolete, applications should use the registry instead.")
Expand All @@ -267,7 +267,7 @@ def HIBYTE(val: int, /) -> int: ...
def LOBYTE(val: int, /) -> int: ...
def HIWORD(val: int, /) -> int: ...
def LOWORD(val: int, /) -> int: ...
def RGB(red, green, blue, /): ...
def RGB(red: int, green: int, blue: int, /) -> int: ...
def MAKELANGID(PrimaryLanguage, SubLanguage, /): ...
def MAKEWORD(low, high, /): ...
def MAKELONG(low, high, /): ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/pywin32/win32/win32file.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def FindCloseChangeNotification(hChangeHandle, /) -> None: ...
def FindFirstChangeNotification(pathName: str, bWatchSubtree, notifyFilter, /): ...
def FindNextChangeNotification(hChangeHandle, /): ...
def FlushFileBuffers(hFile: int, /) -> None: ...
def GetBinaryType(appName: str, /): ...
def GetBinaryType(appName: str, /) -> int: ...
def GetDiskFreeSpace(rootPathName: str, /) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ...
def GetDiskFreeSpaceEx(rootPathName: str, /) -> tuple[int, int, int]: ...
def GetDriveType(rootPathName: str, /): ...
Expand Down
Loading