mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-10-25 01:06:05 +03:00
[1805] Simplify Window Text Call
This commit is contained in:
2 files changed
+2
-10
No files matched your search
@@ -272,11 +272,7 @@ if __name__ == '__main__': # noqa: C901
|
||||
|
||||
def window_title(h: int) -> str | None:
|
||||
if h:
|
||||
text_length = win32gui.GetWindowTextLength(h) + 1
|
||||
buf = create_unicode_buffer(text_length)
|
||||
if win32gui.GetWindowText(h):
|
||||
return buf.value
|
||||
|
||||
return win32gui.GetWindowText(h)
|
||||
return None
|
||||
|
||||
@WINFUNCTYPE(BOOL, HWND, LPARAM)
|
||||
|
||||
+1
-5
@@ -47,11 +47,7 @@ def window_title(h) -> str:
|
||||
:return: Window title.
|
||||
"""
|
||||
if h:
|
||||
title_length = win32gui.GetWindowTextLength(h) + 1
|
||||
buf = ctypes.create_unicode_buffer(title_length)
|
||||
if win32gui.GetWindowText(h):
|
||||
return buf.value
|
||||
|
||||
return win32gui.GetWindowText(h)
|
||||
return ''
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user