Python 3.x 通过Python从Totalcommander接收windows消息怎么样

Python 3.x 通过Python从Totalcommander接收windows消息怎么样,python-3.x,windows,winapi,total-commander,Python 3.x,Windows,Winapi,Total Commander,我可以用这些代码通过Python向Totalcommander发送Windows消息 import win32gui hwnd = win32gui.FindWindow("TTOTAL_CMD", None) # catch Totalcommander handle win32gui.SetForegroundWindow(hwnd) nothing = win32api.SendMessage(hwnd, 1075, 4001, 0) # se

我可以用这些代码通过Python向Totalcommander发送Windows消息

import win32gui
hwnd = win32gui.FindWindow("TTOTAL_CMD", None)          # catch Totalcommander handle
win32gui.SetForegroundWindow(hwnd)
nothing = win32api.SendMessage(hwnd, 1075, 4001, 0)     # setting Focus on Totalcommander-left-window
但我不知道如何接收那些我也可以发送给Totalcommander的windows消息的回复

当我尝试时

import win32gui
hwnd = win32gui.FindWindow("TTOTAL_CMD", None)          # catch Totalcommander handle
buf = win32gui.PyMakeBuffer(255)
result_length = win32api.SendMessage(hwnd, 1074, 17, buf)      # getting Path-Info from Window
result = buf[0:result_length*2+2]
tc_path_string = result.decode('utf-16')
我在最后一行得到一个“'memoryview'对象没有属性'decode'”

我应该从Totalcommander那里得到这些信息——我现在尝试从Autohotkey/AHK中转换到python


乔凡尼

错误的工具。与
backend=“uia”
一起使用。除了控制Total Commander外,我还想在Total Commander中获取其标记文件的列表,因此我从Autohotkey/AHK编程中了解所需的WM_消息代码。因此,在第一个视图中,我看不到pywinauto能够解决这一问题,从而允许您捕获和控制实现所需接口的UI的几乎任何方面。Total Commander使用标准的Windows控件,而Windows控件可以。额外的好处:您不需要调用
setforegroundindow
(最终会失败)。