1
1
from _typeshed import Incomplete , ReadableBuffer
2
2
from collections .abc import Callable , Iterable
3
- from typing import TypedDict
3
+ from typing import Literal , TypedDict , overload , type_check_only
4
4
from typing_extensions import deprecated
5
5
6
6
import _win32typing
7
7
from win32 .lib .pywintypes import TimeType , error as error
8
8
9
+ @type_check_only
9
10
class _MonitorInfo (TypedDict ):
10
11
Monitor : tuple [int , int , int , int ]
11
12
Work : tuple [int , int , int , int ]
12
13
Flags : int
13
14
Device : str
14
15
16
+ @type_check_only
15
17
class _FileVersionInfo (TypedDict ):
16
18
Signature : int
17
19
StrucVersion : int
@@ -26,6 +28,43 @@ class _FileVersionInfo(TypedDict):
26
28
FileSubtype : int
27
29
FileDate : None | Incomplete
28
30
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
+
29
68
def AbortSystemShutdown (computerName : str , / ) -> None : ...
30
69
def InitiateSystemShutdown (computerName : str , message : str , timeOut , bForceClose , bRebootAfterShutdown , / ) -> None : ...
31
70
def Apply (exceptionHandler , func , args , / ): ...
@@ -71,79 +110,87 @@ def FormatMessageW(
71
110
) -> str : ...
72
111
def FreeLibrary (hModule : int , / ) -> None : ...
73
112
def GenerateConsoleCtrlEvent (controlEvent : int , processGroupId : int , / ) -> None : ...
74
- def GetAsyncKeyState (key , / ): ...
113
+ def GetAsyncKeyState (key : int , / ) -> int : ...
75
114
def GetCommandLine () -> str : ...
76
115
def GetComputerName () -> str : ...
77
- def GetComputerNameEx (NameType , / ) -> str : ...
78
- def GetComputerObjectName (NameFormat , / ) -> str : ...
116
+ def GetComputerNameEx (NameType : int , / ) -> str : ...
117
+ def GetComputerObjectName (NameFormat : int , / ) -> str : ...
79
118
def GetMonitorInfo (hMonitor : int ) -> _MonitorInfo : ...
80
119
def GetUserName () -> str : ...
81
120
def 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 : ...
86
125
def GetCurrentProcess () -> int : ...
87
126
def 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 ]: ...
91
130
def GetDllDirectory () -> str : ...
92
131
def 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 : ...
96
135
def GetFileVersionInfo (Filename : str , SubBlock : str , / ) -> _FileVersionInfo : ...
97
136
def GetFocus (): ...
98
137
def GetFullPathName (fileName : str , / ) -> str : ...
99
138
def 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 ] : ...
107
146
def GetLongPathName (fileName : str , / ) -> str : ...
108
147
def GetLongPathNameW (fileName : str , / ) -> str : ...
109
- def GetLogicalDrives (): ...
148
+ def GetLogicalDrives () -> int : ...
110
149
def 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 : ...
115
154
@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 ] : ...
117
156
def GetProcAddress (hModule : int , functionName : _win32typing .PyResourceId , / ): ...
118
157
@deprecated ("This function is obsolete, applications should use the registry instead." )
119
158
def GetProfileVal (section : str , entry : str , defValue : str , iniName : str | None = ..., / ) -> str : ...
120
159
def GetShortPathName (path : str , / ) -> str : ...
121
- def GetStdHandle (handle : int , / ) -> _win32typing . PyHANDLE : ...
160
+ def GetStdHandle (handle : int , / ) -> int : ...
122
161
def GetSysColor (index : int , / ) -> int : ...
123
- def GetSystemDefaultLangID (): ...
124
- def GetSystemDefaultLCID (): ...
162
+ def GetSystemDefaultLangID () -> int : ...
163
+ def GetSystemDefaultLCID () -> int : ...
125
164
def 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 ]] : ...
130
169
def GetSystemMetrics (index : int , / ) -> int : ...
131
170
def 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 ] : ...
134
173
def GetTempPath () -> str : ...
135
- def GetThreadLocale (): ...
174
+ def GetThreadLocale () -> int : ...
136
175
def 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 ]: ...
142
189
def GetWindowsDirectory () -> str : ...
143
190
def 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 ] : ...
147
194
def GlobalMemoryStatusEx () -> dict [str , int ]: ...
148
195
def keybd_event (bVk , bScan , dwFlags : int = ..., dwExtraInfo : int = ..., / ) -> None : ...
149
196
def mouse_event (dx , dy , dwData , dwFlags : int = ..., dwExtraInfo = ..., / ) -> None : ...
@@ -268,7 +315,7 @@ def MAKELANGID(PrimaryLanguage, SubLanguage, /): ...
268
315
def MAKEWORD (low , high , / ): ...
269
316
def MAKELONG (low , high , / ): ...
270
317
def CommandLineToArgv (* args ): ... # incomplete
271
- def GetKeyboardLayoutList (* args ) : ... # incomplete
318
+ def GetKeyboardLayoutList () -> tuple [ int , int ] : ...
272
319
def MapVirtualKey (* args ): ... # incomplete
273
320
def MessageBoxEx (* args ): ... # incomplete
274
321
def OpenThread (* args ): ... # incomplete
0 commit comments