Various pywin32 improvements (#11616)

This commit is contained in:
Avasam
2024-03-30 14:55:30 -04:00
committed by GitHub
parent 9d2f651818
commit f36714b0fb
14 changed files with 110 additions and 80 deletions

View File

@@ -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: ...
@@ -74,30 +77,24 @@ class PyNCB:
@property
def Bufflen(self): ...
@property
def Callname(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 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): ...
@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: ...
@@ -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): ...
@@ -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: ...
@@ -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: ...
@@ -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:
@@ -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:
@@ -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: ...
@@ -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: ...
@@ -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: ...

View File

@@ -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
@@ -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]: ...
@@ -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 = ...,

View File

@@ -1,4 +1,5 @@
from _typeshed import Incomplete, Unused
from _typeshed import Incomplete, OptExcInfo, Unused
from collections.abc import Callable
import _win32typing
@@ -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: ...
@@ -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(
@@ -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: ...
@@ -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: ...

View File

@@ -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: ...

View File

@@ -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
@@ -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: ...
@@ -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

View File

@@ -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: ...
@@ -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: ...
@@ -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: ...
@@ -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, /): ...
@@ -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.")
@@ -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, /): ...

View File

@@ -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, /): ...

View File

@@ -54,9 +54,9 @@ def RegisterWindowMessage(name: str, /): ...
def DefWindowProc(
hwnd: int | None, message: int, wparam: ReadableBuffer | float | None, lparam: ReadableBuffer | float | None, /
) -> int: ...
def EnumWindows(callback: Callable[[int, _T], object], extra: _T, /) -> None: ...
def EnumThreadWindows(dwThreadId, callback: Callable[[int, _T], object], extra: _T, /) -> None: ...
def EnumChildWindows(hwnd: int | None, callback: Callable[[int, _T], object], extra: _T, /) -> None: ...
def EnumWindows(callback: Callable[[int, _T], int | None], extra: _T, /) -> None: ...
def EnumThreadWindows(dwThreadId, callback: Callable[[int, _T], int | None], extra: _T, /) -> None: ...
def EnumChildWindows(hwnd: int | None, callback: Callable[[int, _T], int | None], extra: _T, /) -> None: ...
def DialogBox(hInstance: int, TemplateName: _win32typing.PyResourceId, hWndParent: int, DialogFunc, InitParam: int = ..., /): ...
def DialogBoxParam(): ...
def DialogBoxIndirect(
@@ -145,7 +145,7 @@ def AlphaBlend(
blendFunction: _win32typing.PyBLENDFUNCTION,
/,
) -> None: ...
def MessageBox(parent, text: str, caption: str, flags, /): ...
def MessageBox(parent: _win32typing.PyHANDLE | int | None, text: str, caption: str, flags, /): ...
def MessageBeep(_type, /) -> None: ...
def CreateWindow(
className: str | _win32typing.PyResourceId,
@@ -227,7 +227,9 @@ def ExtractIcon(hinstance, moduleName: str, index, /): ...
def ExtractIconEx(moduleName: str, index, numIcons: int = ..., /): ...
def DestroyIcon(hicon, /) -> None: ...
def GetIconInfo(hicon: int, /) -> _win32typing.PyICONINFO: ...
def ScreenToClient(hWnd: int, Point: tuple[Incomplete, Incomplete], /) -> tuple[Incomplete, Incomplete]: ...
def ScreenToClient(
hWnd: int | _win32typing.PyHANDLE, Point: tuple[Incomplete, Incomplete], /
) -> tuple[Incomplete, Incomplete]: ...
def ClientToScreen(hWnd: int, Point: tuple[Incomplete, Incomplete], /) -> tuple[Incomplete, Incomplete]: ...
def PaintDesktop(hdc: int, /) -> None: ...
def RedrawWindow(hWnd: int, rcUpdate: tuple[int, int, int, int], hrgnUpdate: _win32typing.PyGdiHANDLE, flags, /) -> None: ...
@@ -347,7 +349,7 @@ def CreateSolidBrush(Color, /) -> _win32typing.PyGdiHANDLE: ...
def CreatePatternBrush(hbmp: _win32typing.PyGdiHANDLE, /) -> _win32typing.PyGdiHANDLE: ...
def CreateHatchBrush(Style, clrref, /) -> _win32typing.PyGdiHANDLE: ...
def CreatePen(PenStyle, Width, Color, /) -> _win32typing.PyGdiHANDLE: ...
def GetSysColor(Index, /): ...
def GetSysColor(Index: int, /) -> int: ...
def GetSysColorBrush(Index, /) -> _win32typing.PyGdiHANDLE: ...
def InvalidateRect(hWnd: int, Rect: _win32typing.PyRECT, Erase, /) -> None: ...
def FrameRect(hDC: int, rc: _win32typing.PyRECT, hbr: _win32typing.PyGdiHANDLE, /) -> None: ...
@@ -355,7 +357,7 @@ def InvertRect(hDC: int, rc: _win32typing.PyRECT, /) -> None: ...
def WindowFromDC(hDC: int, /) -> int: ...
def GetUpdateRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, Erase, /): ...
def GetWindowRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, /): ...
def SetWindowRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, Redraw, /) -> None: ...
def SetWindowRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE | None, Redraw: bool, /) -> None: ...
def ValidateRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, /) -> None: ...
def InvalidateRgn(hWnd: int, hRgn: _win32typing.PyGdiHANDLE, Erase, /) -> None: ...
def GetRgnBox(hrgn: _win32typing.PyGdiHANDLE, /) -> tuple[Incomplete, _win32typing.PyRECT]: ...

View File

@@ -13,7 +13,7 @@ def EnumEntries(reserved: str | None = ..., fileName: str | None = ..., /) -> No
def GetConnectStatus(hrasconn, /) -> tuple[Incomplete, Incomplete, str, str]: ...
def GetEntryDialParams(
fileName: str, entryName: str, /
) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete]: ...
) -> tuple[tuple[Incomplete, Incomplete, Incomplete, Incomplete, Incomplete, Incomplete], bool]: ...
def GetErrorString(error, /) -> str: ... # noqa: F811
def HangUp(hras, /) -> None: ...
def IsHandleValid(hras: int | None, /) -> bool: ...

View File

@@ -18,7 +18,9 @@ def GetProcessWindowStation() -> _win32typing.PyHWINSTA: ...
def CreateWindowStation(
WindowStation, Flags, DesiredAccess, SecurityAttributes: _win32typing.PySECURITY_ATTRIBUTES, /
) -> _win32typing.PyHWINSTA: ...
def EnumServicesStatus(hSCManager: _win32typing.PySC_HANDLE, ServiceType, ServiceState, /) -> tuple[Incomplete, ...]: ...
def EnumServicesStatus(
hSCManager: _win32typing.PySC_HANDLE | int, ServiceType: int = ..., ServiceState: int = ..., /
) -> tuple[Incomplete, ...]: ...
def EnumServicesStatusEx(
SCManager: _win32typing.PySC_HANDLE, ServiceType, ServiceState, InfoLevel, GroupName: Incomplete | None = ..., /
) -> tuple[Incomplete, ...]: ...

View File

@@ -1,5 +1,6 @@
from _typeshed import Incomplete
import _win32typing
from win32com.server import policy as policy
from win32com.server.exception import COMException as COMException
@@ -32,9 +33,9 @@ def NewCollection(seq, cls=...): ...
class FileStream:
file: Incomplete
def __init__(self, file) -> None: ...
def __init__(self, file: _win32typing.Pymmapfile) -> None: ...
def Read(self, amount): ...
def Write(self, data): ...
def Clone(self): ...
def CopyTo(self, dest, cb): ...
def Seek(self, offset, origin): ...
def Seek(self, offset: int, origin: int) -> int: ...

View File

@@ -1,8 +1,16 @@
from _typeshed import Incomplete
from collections.abc import Callable
from typing_extensions import TypeAlias
from pythoncom import com_error as com_error
from win32com.client import gencache as gencache
# Type of pythoncom._univgw.WriteFromOutTuple
# The two tuples must be of equal length
_WriteFromOutTupleType: TypeAlias = Callable[
[tuple[Incomplete, ...] | None, tuple[Incomplete, ...] | None, int], Incomplete | None
]
def RegisterInterfaces(typelibGUID, lcid, major, minor, interface_names: Incomplete | None = ...): ...
class Arg:
@@ -24,4 +32,4 @@ class Definition:
def iid(self): ...
def vtbl_argsizes(self): ...
def vtbl_argcounts(self): ...
def dispatch(self, ob, index, argPtr, ReadFromInTuple=..., WriteFromOutTuple=...): ...
def dispatch(self, ob, index, argPtr, ReadFromInTuple=..., WriteFromOutTuple: _WriteFromOutTupleType = ...): ...

View File

@@ -18,7 +18,7 @@ def HrQueryAllRows(
): ...
def RTFSync(message: _win32typing.PyIMessage, flags, /): ...
def WrapCompressedRTFStream(stream: _win32typing.PyIStream, flags, /) -> _win32typing.PyIStream: ...
def WrapCompressedRTFStreamEx() -> tuple[_win32typing.PyIStream, Incomplete]: ...
def WrapCompressedRTFStreamEx(stream: _win32typing.PyIStream, wcsinfo, /) -> tuple[_win32typing.PyIStream, Incomplete]: ...
def OpenIMsgSession(): ...
def CloseIMsgSession() -> None: ...
def OpenIMsgOnIStg(

View File

@@ -97,7 +97,9 @@ def SHCreateShellItem(
pidlParent: _win32typing.PyIDL, sfParent: _win32typing.PyIShellFolder, Child: _win32typing.PyIDL, /
) -> _win32typing.PyIShellItem: ...
def SHOpenFolderAndSelectItems(Folder: _win32typing.PyIDL, Items: tuple[_win32typing.PyIDL, ...], Flags=...) -> None: ...
def SHCreateStreamOnFileEx(File, Mode, Attributes, Create, Template: Incomplete | None = ...) -> _win32typing.PyIStream: ...
def SHCreateStreamOnFileEx(
File: str, Mode: int, Attributes: int, Create: bool, Template: None = ...
) -> _win32typing.PyIStream: ...
def SetCurrentProcessExplicitAppUserModelID(AppID: str, /) -> None: ...
def GetCurrentProcessExplicitAppUserModelID() -> str: ...
def SHParseDisplayName(Name, Attributes, BindCtx: _win32typing.PyIBindCtx | None = ...) -> tuple[list[bytes], int]: ...