Is it possible to use pywin32 to create a window

199 views
Skip to first unread message

shadowd_dog1

unread,
Jul 28, 2008, 2:24:14 PM7/28/08
to ShowMeDo-Learners
I am new to pywin32 and would like to use base win32 window create
functionality similar to this C code-

HWND hWnd;
WNDCLASSEX wc;

ZeroMemory(&wc, sizeof(WNDCLASSEX));

wc.cbSize = sizeof(WNDCLASSEX);
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC)WindowProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.lpszClassName = "PyWindow";

RegisterClassEx(&wc);

hWnd = CreateWindowEx(NULL,
"PyWindow",
"PyDemo",
WS_EX_TOPMOST | WS_POPUP,
0, 0,
SCREEN_WIDTH, SCREEN_HEIGHT,
NULL,
NULL,
hInstance,
NULL);

ShowWindow(hWnd, nCmdShow);

Is this even possible? If so, any idea where the structs and enums
are? win32api? pywintypes?

any help is appreciated.

Ian Ozsvald

unread,
Jul 28, 2008, 3:26:55 PM7/28/08
to showmedo...@googlegroups.com
Sadly you're already getting too involved for my knowledge of pyWin32 and the MS API, I haven't had to get down n'dirty with MFC and the like for 5 years.

I had a flip through the O'Reilly 'Python Programming on Win32' for you, it deliberately avoids getting too involved with C code and instead points the reader at the MS API docs (available via MS VC from memory). You probably want to check the book out though, it'll give you pointers for lots of topics.

You might have more joy asking in comp.lang.python (http://groups.google.com/group/comp.lang.python/topics)? There are some pyWin32 topics discussed there.

HTH,
Ian.

Dick Moores

unread,
Jul 28, 2008, 4:07:50 PM7/28/08
to showmedo...@googlegroups.com
Better, I think, would be
<http://mail.python.org/mailman/listinfo/python-win32>

Dick Moores

shadowd_dog1

unread,
Jul 28, 2008, 10:38:03 PM7/28/08
to ShowMeDo-Learners
Excellent, thank-you both for your responses... i have been working on
this code for a few days and appreciate your links... i will post on
the python.org link Dick and Ian added and if i am able to resolve
this, will post the answer.

thanks again for the responses.

-Steve.

Ian Ozsvald

unread,
Jul 29, 2008, 8:20:49 AM7/29/08
to showmedo...@googlegroups.com
*Much* better, cheers Dick. I searched for a pywin32 group link but didn't find it (must've been a bit too close to midnight for me!).
i.
Reply all
Reply to author
Forward
0 new messages