Searching "pygtk get window hwnd" on Google for a while, I found there is not much help in top results. So I decide to write this short article.
gtk.Window has a property called "window", it's almost same level as Window in winapi.
1 2 3 |
w = gtk.Window() print w.window |
Running above code will get following output:
<gtk.gdk.Window object at 0x2713be8 (GdkWindow at 0x1d9e160)>
Then we can get the hwnd by retrieving "handle" property of this gtk.gdk.Window object
1 2 3 |
w = gtk.Window() hwnd = w.window.handle |