错误:(1400,'GetWindowRect','\ xce \ xde \ xd0 \ xa7 \ xb5 \ xc4 \ xb4 \ xb0 \ xbf \ xda \ xbe \ xe4 \ xb1 \ xfa \ xa1 \ xa3')

时间:2017-08-13 07:26:42

标签: python-2.7

我有一个简单的代码

from win32gui import *
titles = set()
def foo(hwnd,mouse):
if IsWindow(hwnd) and IsWindowEnabled(hwnd) and IsWindowVisible(hwnd):
    titles.add(GetWindowText(hwnd))
EnumWindows(foo, 0)
lt = [t for t in titles if t]
lt.sort()
for t in lt:
 print t.decode("GB2312")

classname = 0
titlename = "Untitled"
hwnd = FindWindow(classname, titlename)
rect= GetWindowRect(hwnd)`
然后Python告诉我

---> rect= GetWindowRect(hwnd)

error: (1400, 'GetWindowRect', '\xce\xde\xd0\xa7\xb5\xc4\xb4\xb0\xbf\xda\xbe\xe4\xb1\xfa\xa1\xa3')

我想获得所有活动窗口的名称并找到一个窗口。 什么可能是错的?

0 个答案:

没有答案