get this from pywin32 too
This commit is contained in:
parent
cca0071cbf
commit
5c6e5970c9
|
@ -21,6 +21,10 @@ from win32con import (
|
||||||
SEM_NOOPENFILEERRORBOX,
|
SEM_NOOPENFILEERRORBOX,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from win32file import (
|
||||||
|
INVALID_HANDLE_VALUE,
|
||||||
|
)
|
||||||
|
|
||||||
# <https://msdn.microsoft.com/en-us/library/windows/desktop/ms687401%28v=vs.85%29.aspx>
|
# <https://msdn.microsoft.com/en-us/library/windows/desktop/ms687401%28v=vs.85%29.aspx>
|
||||||
# BOOL WINAPI WriteConsoleW(HANDLE hOutput, LPWSTR lpBuffer, DWORD nChars,
|
# BOOL WINAPI WriteConsoleW(HANDLE hOutput, LPWSTR lpBuffer, DWORD nChars,
|
||||||
# LPDWORD lpCharsWritten, LPVOID lpReserved);
|
# LPDWORD lpCharsWritten, LPVOID lpReserved);
|
||||||
|
@ -125,8 +129,6 @@ def initialize():
|
||||||
use_last_error=True
|
use_last_error=True
|
||||||
)(("GetConsoleMode", windll.kernel32))
|
)(("GetConsoleMode", windll.kernel32))
|
||||||
|
|
||||||
INVALID_HANDLE_VALUE = DWORD(-1).value
|
|
||||||
|
|
||||||
def not_a_console(handle):
|
def not_a_console(handle):
|
||||||
if handle == INVALID_HANDLE_VALUE or handle is None:
|
if handle == INVALID_HANDLE_VALUE or handle is None:
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue