Hello!
This simple code below works with win32all-153 and breaks with
155 and 157 saying:
Fatal Python error: This thread state must be current when releasing
So does some other demos from win32/demos like
"win32gui_dialog.py".
What could it be?
################################
import win32gui
import win32api
import win32con
def registerWindowClass():
def OnDestroy(hwnd, msg, wparam, lparam):
win32gui.PostQuitMessage(0) # Terminate the app.
message_map = {
win32con.WM_DESTROY: OnDestroy,
}
wc = win32gui.WNDCLASS()
wc.hInstance = hinst
wc.lpszClassName = "warkid.try_CreateWindow.WindowClass"
wc.lpfnWndProc = message_map # could also specify a wndproc.
return win32gui.RegisterClass(wc)
def createWindow(class_atom):
return win32gui.CreateWindow(
class_atom,
"a window",
0,
0, 0, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, \
0, 0, hinst, None)
hinst = win32api.GetModuleHandle(None)
hwnd = createWindow(registerWindowClass())
win32gui.ShowWindow(hwnd, True)
win32gui.PumpMessages()
###################################
Best regards,
Kerim mailto:[EMAIL PROTECTED]
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython