I try to start coding a MS apllication with python and failed from the start.
My specific question is about this error:
pywintypes.error: (1407, 'CreateWindowEx', 'Windowclass wasn't found.')
with this code:
import ctypes
import win32api
import win32con as con
import win32gui as gui
class Window(object):
def __init__(self):
self.hwnd = gui.CreateWindowEx(0,
"Root",
"Python Window",
con.WS_OVERLAPPEDWINDOW,
con.CW_USEDEFAULT,
con.CW_USEDEFAULT,
con.CW_USEDEFAULT,
con.CW_USEDEFAULT,
0,
0,
0,
None)
gui.ShowWindow(self.hwnd, con.SW_SHOWDEFAULT)
Window()
Yesterday I readed something about register the window but I cant find it anymore. I think there is the problem. Can someone help me out?
Also if someone reads this question and can give me some general hints, I would be glad. To descripe my current situation I try to follow this documentation of MS and try to get an idea of translating C code with python by this example. But Im unable to follow, since the best documentation of ctypes I found wont help me to use ctypes only like in the example.