11from _typeshed import Incomplete , ReadableBuffer
22from collections .abc import Callable , Iterable
3- from typing import TypedDict
3+ from typing import Literal , TypedDict , overload , type_check_only
44from typing_extensions import deprecated
55
66import _win32typing
77from win32 .lib .pywintypes import TimeType , error as error
88
9+ @type_check_only
910class _MonitorInfo (TypedDict ):
1011 Monitor : tuple [int , int , int , int ]
1112 Work : tuple [int , int , int , int ]
1213 Flags : int
1314 Device : str
1415
16+ @type_check_only
1517class _FileVersionInfo (TypedDict ):
1618 Signature : int
1719 StrucVersion : int
@@ -26,6 +28,43 @@ class _FileVersionInfo(TypedDict):
2628 FileSubtype : int
2729 FileDate : None | Incomplete
2830
31+ @type_check_only
32+ class _PwrCapabilitiesBatteryScale (TypedDict ):
33+ Granularity : int
34+ Capacity : int
35+
36+ @type_check_only
37+ class _PwrCapabilities (TypedDict ):
38+ PowerButtonPresent : bool
39+ SleepButtonPresent : bool
40+ LidPresent : bool
41+ SystemS1 : bool
42+ SystemS2 : bool
43+ SystemS3 : bool
44+ SystemS4 : bool
45+ SystemS5 : bool
46+ HiberFilePresent : bool
47+ FullWake : bool
48+ VideoDimPresent : bool
49+ ApmPresent : bool
50+ UpsPresent : bool
51+ ThermalControl : bool
52+ ProcessorThrottle : bool
53+ ProcessorMinThrottle : int
54+ ProcessorMaxThrottle : int
55+ FastSystemS4 : bool
56+ spare2 : Incomplete | None
57+ DiskSpinDown : bool
58+ spare3 : Incomplete | None
59+ SystemBatteriesPresent : bool
60+ BatteriesAreShortTerm : bool
61+ BatteryScale : tuple [_PwrCapabilitiesBatteryScale , ...]
62+ AcOnLineWake : int
63+ SoftLidWake : int
64+ RtcWake : int
65+ MinDeviceWakeState : int
66+ DefaultLowLatencyWake : int
67+
2968def AbortSystemShutdown (computerName : str , / ) -> None : ...
3069def InitiateSystemShutdown (computerName : str , message : str , timeOut , bForceClose , bRebootAfterShutdown , / ) -> None : ...
3170def Apply (exceptionHandler , func , args , / ): ...
@@ -71,79 +110,87 @@ def FormatMessageW(
71110) -> str : ...
72111def FreeLibrary (hModule : int , / ) -> None : ...
73112def GenerateConsoleCtrlEvent (controlEvent : int , processGroupId : int , / ) -> None : ...
74- def GetAsyncKeyState (key , / ): ...
113+ def GetAsyncKeyState (key : int , / ) -> int : ...
75114def GetCommandLine () -> str : ...
76115def GetComputerName () -> str : ...
77- def GetComputerNameEx (NameType , / ) -> str : ...
78- def GetComputerObjectName (NameFormat , / ) -> str : ...
116+ def GetComputerNameEx (NameType : int , / ) -> str : ...
117+ def GetComputerObjectName (NameFormat : int , / ) -> str : ...
79118def GetMonitorInfo (hMonitor : int ) -> _MonitorInfo : ...
80119def GetUserName () -> str : ...
81120def GetUserNameEx (NameFormat : int , / ) -> str : ...
82- def GetCursorPos () -> tuple [Incomplete , Incomplete ]: ...
83- def GetCurrentThread (): ...
84- def GetCurrentThreadId (): ...
85- def GetCurrentProcessId (): ...
121+ def GetCursorPos () -> tuple [int , int ]: ...
122+ def GetCurrentThread () -> int : ...
123+ def GetCurrentThreadId () -> int : ...
124+ def GetCurrentProcessId () -> int : ...
86125def GetCurrentProcess () -> int : ...
87126def GetConsoleTitle () -> str : ...
88- def GetDateFormat (locale , flags , time : TimeType , _format : str , / ) -> str : ...
89- def GetDiskFreeSpace (rootPath : str , / ): ...
90- def GetDiskFreeSpaceEx (rootPath : str , / ) -> tuple [int , int , int ]: ...
127+ def GetDateFormat (locale : int , flags : int , time : TimeType | None , _format : str | None = None , / ) -> str : ...
128+ def GetDiskFreeSpace (rootPath : str | None = None , / ) -> tuple [ int , int , int , int ] : ...
129+ def GetDiskFreeSpaceEx (rootPath : str | None = None , / ) -> tuple [int , int , int ]: ...
91130def GetDllDirectory () -> str : ...
92131def GetDomainName () -> str : ...
93- def GetEnvironmentVariable (variable , / ): ...
94- def GetEnvironmentVariableW (Name , / ) -> str : ...
95- def GetFileAttributes (pathName : str , / ): ...
132+ def GetEnvironmentVariable (variable : str , / ) -> str | None : ...
133+ def GetEnvironmentVariableW (Name : str , / ) -> str | None : ...
134+ def GetFileAttributes (pathName : str , / ) -> int : ...
96135def GetFileVersionInfo (Filename : str , SubBlock : str , / ) -> _FileVersionInfo : ...
97136def GetFocus (): ...
98137def GetFullPathName (fileName : str , / ) -> str : ...
99138def GetHandleInformation (Object : int , / ): ...
100- def GetKeyboardLayout (threadId : int = ..., / ): ...
101- def GetKeyboardLayoutName (): ...
102- def GetKeyboardState () -> str : ...
103- def GetKeyState (key , / ): ...
104- def GetLastError (): ...
105- def GetLastInputInfo (): ...
106- def GetLocalTime (): ...
139+ def GetKeyboardLayout (threadId : int = ..., / ) -> int : ...
140+ def GetKeyboardLayoutName () -> str : ...
141+ def GetKeyboardState () -> bytes : ...
142+ def GetKeyState (key : int , / ) -> int : ...
143+ def GetLastError () -> int : ...
144+ def GetLastInputInfo () -> int : ...
145+ def GetLocalTime () -> tuple [ int , int , int , int , int , int , int , int ] : ...
107146def GetLongPathName (fileName : str , / ) -> str : ...
108147def GetLongPathNameW (fileName : str , / ) -> str : ...
109- def GetLogicalDrives (): ...
148+ def GetLogicalDrives () -> int : ...
110149def GetLogicalDriveStrings () -> str : ...
111- def GetModuleFileName (hModule : int , / ) -> str : ...
112- def GetModuleFileNameW (hModule : int , / ) -> str : ...
113- def GetModuleHandle (fileName : str | None = ... , / ) -> int : ...
114- def GetPwrCapabilities (): ...
150+ def GetModuleFileName (hModule : int | None , / ) -> str : ...
151+ def GetModuleFileNameW (hModule : int | None , / ) -> str : ...
152+ def GetModuleHandle (fileName : str | None = None , / ) -> int : ...
153+ def GetPwrCapabilities () -> _PwrCapabilities : ...
115154@deprecated ("This function is obsolete, applications should use the registry instead." )
116- def GetProfileSection (section : str , iniName : str | None = ..., / ): ...
155+ def GetProfileSection (section : str , iniName : str | None = ..., / ) -> list [ Incomplete ] : ...
117156def GetProcAddress (hModule : int , functionName : _win32typing .PyResourceId , / ): ...
118157@deprecated ("This function is obsolete, applications should use the registry instead." )
119158def GetProfileVal (section : str , entry : str , defValue : str , iniName : str | None = ..., / ) -> str : ...
120159def GetShortPathName (path : str , / ) -> str : ...
121- def GetStdHandle (handle : int , / ) -> _win32typing . PyHANDLE : ...
160+ def GetStdHandle (handle : int , / ) -> int : ...
122161def GetSysColor (index : int , / ) -> int : ...
123- def GetSystemDefaultLangID (): ...
124- def GetSystemDefaultLCID (): ...
162+ def GetSystemDefaultLangID () -> int : ...
163+ def GetSystemDefaultLCID () -> int : ...
125164def GetSystemDirectory () -> str : ...
126- def GetSystemFileCacheSize (): ...
127- def SetSystemFileCacheSize (MinimumFileCacheSize , MaximumFileCacheSize , Flags = ...) -> None : ...
128- def GetSystemInfo (): ...
129- def GetNativeSystemInfo (): ...
165+ def GetSystemFileCacheSize () -> tuple [ int , int , int ] : ...
166+ def SetSystemFileCacheSize (MinimumFileCacheSize : int , MaximumFileCacheSize : int , Flags : int = ...) -> None : ...
167+ def GetSystemInfo () -> tuple [ int , int , int , int , int , int , int , int , tuple [ int , int ]] : ...
168+ def GetNativeSystemInfo () -> tuple [ int , int , int , int , int , int , int , int , tuple [ int , int ]] : ...
130169def GetSystemMetrics (index : int , / ) -> int : ...
131170def GetSystemPowerStatus () -> dict [str , int ]: ...
132- def GetSystemTime (): ...
133- def GetTempFileName (path : str , prefix : str , nUnique , / ): ...
171+ def GetSystemTime () -> tuple [ int , int , int , int , int , int , int , int ] : ...
172+ def GetTempFileName (path : str , prefix : str , nUnique : int = ... , / ) -> tuple [ str , int ] : ...
134173def GetTempPath () -> str : ...
135- def GetThreadLocale (): ...
174+ def GetThreadLocale () -> int : ...
136175def GetTickCount () -> int : ...
137- def GetTimeFormat (locale , flags , time : TimeType , _format : str , / ) -> str : ...
138- def GetTimeZoneInformation (times_as_tuples : bool = ..., / ): ...
139- def GetVersion (): ...
140- def GetVersionEx (_format : int = ..., / ): ...
141- def GetVolumeInformation (path : str , / ): ...
176+ def GetTimeFormat (locale : int , flags : int , time : TimeType | None , _format : str , / ) -> str : ...
177+ @overload
178+ def GetTimeZoneInformation (
179+ times_as_tuples : Literal [True ] = True , /
180+ ) -> tuple [
181+ int ,
182+ tuple [int , str , tuple [int , int , int , int , int , int , int , int ], int , str , tuple [int , int , int , int , int , int , int , int ], int ],
183+ ]: ...
184+ @overload
185+ def GetTimeZoneInformation (times_as_tuples : Literal [False ], / ): ...
186+ def GetVersion () -> int : ...
187+ def GetVersionEx (_format : int = ..., / ) -> tuple [int , int , int , int , str ]: ...
188+ def GetVolumeInformation (path : str , / ) -> tuple [str , int , int , int , str ]: ...
142189def GetWindowsDirectory () -> str : ...
143190def GetWindowLong (hwnd : int | None , offset : int , / ) -> int : ...
144- def GetUserDefaultLangID (): ...
145- def GetUserDefaultLCID (): ...
146- def GlobalMemoryStatus (): ...
191+ def GetUserDefaultLangID () -> int : ...
192+ def GetUserDefaultLCID () -> int : ...
193+ def GlobalMemoryStatus () -> dict [ str , int ] : ...
147194def GlobalMemoryStatusEx () -> dict [str , int ]: ...
148195def keybd_event (bVk , bScan , dwFlags : int = ..., dwExtraInfo : int = ..., / ) -> None : ...
149196def mouse_event (dx , dy , dwData , dwFlags : int = ..., dwExtraInfo = ..., / ) -> None : ...
@@ -268,7 +315,7 @@ def MAKELANGID(PrimaryLanguage, SubLanguage, /): ...
268315def MAKEWORD (low , high , / ): ...
269316def MAKELONG (low , high , / ): ...
270317def CommandLineToArgv (* args ): ... # incomplete
271- def GetKeyboardLayoutList (* args ) : ... # incomplete
318+ def GetKeyboardLayoutList () -> tuple [ int , int ] : ...
272319def MapVirtualKey (* args ): ... # incomplete
273320def MessageBoxEx (* args ): ... # incomplete
274321def OpenThread (* args ): ... # incomplete
0 commit comments