mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 15:27:14 +03:00
[1805] Simplify Window Text Call
This commit is contained in:
parent
d319dd03b5
commit
c0deeeb4cf
@ -272,11 +272,7 @@ if __name__ == '__main__': # noqa: C901
|
|||||||
|
|
||||||
def window_title(h: int) -> str | None:
|
def window_title(h: int) -> str | None:
|
||||||
if h:
|
if h:
|
||||||
text_length = win32gui.GetWindowTextLength(h) + 1
|
return win32gui.GetWindowText(h)
|
||||||
buf = create_unicode_buffer(text_length)
|
|
||||||
if win32gui.GetWindowText(h):
|
|
||||||
return buf.value
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@WINFUNCTYPE(BOOL, HWND, LPARAM)
|
@WINFUNCTYPE(BOOL, HWND, LPARAM)
|
||||||
|
@ -47,11 +47,7 @@ def window_title(h) -> str:
|
|||||||
:return: Window title.
|
:return: Window title.
|
||||||
"""
|
"""
|
||||||
if h:
|
if h:
|
||||||
title_length = win32gui.GetWindowTextLength(h) + 1
|
return win32gui.GetWindowText(h)
|
||||||
buf = ctypes.create_unicode_buffer(title_length)
|
|
||||||
if win32gui.GetWindowText(h):
|
|
||||||
return buf.value
|
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user