By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,526 Members | 1,618 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,526 IT Pros & Developers. It's quick & easy.

I need a simple windows form handle.

P: n/a
Hi all,

Today I was writing a simple test app for a video decoder library.

I use python to parse video files and input data to the library.

I got a problem here, I need a windows form, and send the form handle
to the library as a parameter, then it can output video on the form.

Here is my problem:

What is the simplest way to get a windows form which has a handle?

I tried to use win32py but it seems to be to complicate for my
purpose.
And the form would block the main thread even if I call its DoModal
method on another thread.

=================

PS: Finally I decided I can not finish it today so I write a WinForm
App in C# in 5 minutes and send video from my python app to it by UDP.

That works.
Nov 6 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Nov 6, 7:50 am, 一首诗 <newpt...@gmail.comwrote:
Hi all,

Today I was writing a simple test app for a video decoder library.

I use python to parse video files and input data to the library.

I got a problem here, I need a windows form, and send the form handle
to the library as a parameter, then it can output video on the form.

Here is my problem:

What is the simplest way to get a windows form which has a handle?

I tried to use win32py but it seems to be to complicate for my
purpose.
And the form would block the main thread even if I call its DoModal
method on another thread.

=================

PS: Finally I decided I can not finish it today so I write a WinForm
App in C# in 5 minutes and send video from my python app to it by UDP.

That works.
Why don't you write the GUI in Python? Check out 'wxPython' and
others. 'wx' programs can get pretty short, something like:

app= wx.PySimpleApp()
frame= wx.Frame( app )
canvas= wx.Canvas( frame )
canvas.Render( my_picture )
app.MainLoop()
Nov 6 '08 #2

P: n/a
On Nov 7, 4:55 am, Aaron Brady <castiro...@gmail.comwrote:
On Nov 6, 7:50 am, 一首诗 <newpt...@gmail.comwrote:
Hi all,
Today I was writing a simple test app for a video decoder library.
I use python to parse video files and input data to the library.
I got a problem here, I need a windows form, and send the form handle
to the library as a parameter, then it can output video on the form.
Here is my problem:
What is the simplest way to get a windows form which has a handle?
I tried to use win32py but it seems to be to complicate for my
purpose.
And the form would block the main thread even if I call its DoModal
method on another thread.
=================
PS: Finally I decided I can not finish it today so I write a WinForm
App in C# in 5 minutes and send video from my python app to it by UDP.
That works.

Why don't you write the GUI in Python? Check out 'wxPython' and
others. 'wx' programs can get pretty short, something like:

app= wx.PySimpleApp()
frame= wx.Frame( app )
canvas= wx.Canvas( frame )
canvas.Render( my_picture )
app.MainLoop()
Hi, that's because I guess wxpython does not use native windows forms
and could not provide
a "handle" property.

I will make more study.
Nov 7 '08 #3

P: n/a
On Nov 6, 7:58 pm, 一首诗 <newpt...@gmail.comwrote:
On Nov 7, 4:55 am, Aaron Brady <castiro...@gmail.comwrote:
On Nov 6, 7:50 am, 一首诗 <newpt...@gmail.comwrote:
Hi all,
Today I was writing a simple test app for a video decoder library.
I use python to parse video files and input data to the library.
I got a problem here, I need a windows form, and send the form handle
to the library as a parameter, then it can output video on the form.
Here is my problem:
What is the simplest way to get a windows form which has a handle?
I tried to use win32py but it seems to be to complicate for my
purpose.
And the form would block the main thread even if I call its DoModal
method on another thread.
=================
PS: Finally I decided I can not finish it today so I write a WinForm
App in C# in 5 minutes and send video from my python app to it by UDP..
That works.
Why don't you write the GUI in Python? Check out 'wxPython' and
others. 'wx' programs can get pretty short, something like:
app= wx.PySimpleApp()
frame= wx.Frame( app )
canvas= wx.Canvas( frame )
canvas.Render( my_picture )
app.MainLoop()

Hi, that's because I guess wxpython does not use native windows forms
and could not provide
a "handle" property.

I will make more study.
This other message says:

"""
On Windows, is there any chance of getting hold of an
MFC window handle for a Tkinter or wxPython window?
If so, how?
In wxPython, wxWindows have a method called GetHandle which will
return the HWND of the window.
"""

http://mail.python.org/pipermail/pyt...ne/211436.html

I've had some success doing background processing in separate threads
in wx, but there's always that mailing list to ask on.
Nov 7 '08 #4

P: n/a
On Nov 7, 2:58 am, 一首诗 <newpt...@gmail.comwrote:
Hi, that's because I guess wxpython does not use native windows forms
and could not provide
a "handle" property.
Huh?

I will make more study.
Take a look at wxFormBuilder. I have a wxPython tutorial in my blog.

http://sturlamolden.blogspot.com/200...-wxpython.html


Nov 7 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.