python win32all: Why Differences with C?

Tom Vrankar no at spam.net
Tue May 9 23:19:30 EDT 2000


I'm hacking with a Palm using pilot-xfer on Win98 (it's the only library I can 
find that's compiled for win32). I have an example program (kittykiller.c, if 
you know it) compiled from C which calls:

  // obtain the handle for the HotSync manager's window
  HWND    hWnd = FindWindow(HOTSYNC_APP_CLASS,NULL);

And the program works fine. It's small, and I would like to avoid the overhead 
of calling it via spawnv (any efforts to portably merge spawnv(os.P_WAIT...) 
into os.system?... but I digress), so I try to translate it to win32all build 
129.

After some stumbling around in the Python Win32 help files, I discover 
win32ui.FindWindow() which seems to have similar looking parameters, so I 
translate the above as:

wnd =win32ui.FindWindow (HOTSYNC_APP_CLASS, None)

But this gives me an exception:

win32ui: The window was created in a different thread and can not be mapped.

Same thing for FindwindowEx() with a pair of Nones added in. I understand 
Unix, tcl, python, and such things. I know nada about Windows. I have little 
idea of what the program above doing. Anyone have any suggestions about what 
I'm doing wrong and how to fix it? The only other thing I want to do in this 
translation is call wnd.SendMessage().

Thanks for any ideas.
-- 
                         ---------------------------------
                                               Tom Vrankar
                                            twv at ici.net
                                 http://home.ici.net/~twv/
                                         Rhode Island, USA




More information about the Python-list mailing list