Modal dialog of a foreign window

  • Thread starter Alexander Eisenhuth
  • Start date
A

Alexander Eisenhuth

Hi,

I've a wxPython Application on Windows that glues a
database, Excel, and a GUI for configuration issues using
COM. Works pretty good. In the next step I want to integrate
the GUI-dialog more into Excel, so it should look like a
modal toplevel dialoge of Excel.

I've a class for the main dialog derived from wxFrame, and
doing on startup:
wxFrame.__init__(self, NULL, -1, cnfDesText, size=(800,600))

My Idea is now to give as parent the Window handle of Excel
to the constructor of wxFrame.

Not sure how the window handle can be retrieved (VBA,
win32-Extension, wxWindows, ...)

Any idea ??

Thanks a lot for all ideas, comments, hints in advance
Alexander
 
A

Alexander Eisenhuth

Alexander said:
Hi,

I've a wxPython Application on Windows that glues a database, Excel, and
a GUI for configuration issues using COM. Works pretty good. In the next
step I want to integrate the GUI-dialog more into Excel, so it should
look like a modal toplevel dialoge of Excel.

I've a class for the main dialog derived from wxFrame, and doing on
startup:
wxFrame.__init__(self, NULL, -1, cnfDesText, size=(800,600))

My Idea is now to give as parent the Window handle of Excel to the
constructor of wxFrame.

Not sure how the window handle can be retrieved (VBA, win32-Extension,
wxWindows, ...)

From gmane.comp.python.wxpython - list I got a hint:
If you can get the handle then you can probably use wx.Window_FromHWND to turn it into a wx.Window.

So I tried to get the process-id. A look into th e win32
extensions showed me a chapter of how to do it with a COM
server. I took the code:

win32pdh.EnumObjectItems(None,None,object,win32pdh.PERF_DETAIL_WIZARD)

Traceback (most recent call last):
File "<input>", line 1, in ?
error: (-1073738824, 'EnumObjectItems for buffer size', 'No
error message is available')

Have I overlook something ?? (I'm using XP Home)

Thanks a lot for comments
Alexander
 
C

Cameron Laird

.
.
.
So I tried to get the process-id. A look into th e win32
.
.
.
? This looks to me like working too hard. Does
import os
print "The process-id is %s." % os.getpid()
not meet your requirements?
 
A

Alexander Eisenhuth

Cameron said:
.
.
.


.
.
.
? This looks to me like working too hard. Does
import os
print "The process-id is %s." % os.getpid()
not meet your requirements?

Sorry, if I was to unprecisely, I need the id of a foreign
process. (I'm a COM server process and need the id of the
calling client)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,662
Latest member
sxarexu

Latest Threads

Top