-
Re: Finding parent window?
Jan,
>I can get the Hwnd by enumerating the windows & comparing the title bars -
>but this is not very satisfactory as all sorts of side effects can occur
>(and there may be multiple instances of the app running).
Instead of doing a full enumeration, you can enumerate only the
windows in the current thread using EnumThreadWindows. That should
reduce the chance of getting the wrong window.
Matt
============================================
Mattias Sjögren - mattiass @ hem.passagen.se
CodeHound - Free VB Search Engine
http://www.codehound.com
-
Re: Finding parent window?
Jan,
>I can get the Hwnd by enumerating the windows & comparing the title bars -
>but this is not very satisfactory as all sorts of side effects can occur
>(and there may be multiple instances of the app running).
Instead of doing a full enumeration, you can enumerate only the
windows in the current thread using EnumThreadWindows. That should
reduce the chance of getting the wrong window.
Matt
============================================
Mattias Sjögren - mattiass @ hem.passagen.se
CodeHound - Free VB Search Engine
http://www.codehound.com
-
Re: Finding parent window?
Jan: In VB, App.ThreadId
Mark Bax
"Jan Sears" <jan.sears@aspentech.com> wrote in message
news:3a1418e6@news.devx.com...
> I am not at all experienced with Threads, so this maybe a silly question,
> but I take it then, that the several dll's sitting between the main App
and
> the Form hosting the GUI should all be in the same thread?
>
> How do I get the ThreadId? Would I have to do it from the C++ code or can
I
> get it from VB?
>
> thanks,
>
> Jan
>
>
-
Re: Finding parent window?
Jan: In VB, App.ThreadId
Mark Bax
"Jan Sears" <jan.sears@aspentech.com> wrote in message
news:3a1418e6@news.devx.com...
> I am not at all experienced with Threads, so this maybe a silly question,
> but I take it then, that the several dll's sitting between the main App
and
> the Form hosting the GUI should all be in the same thread?
>
> How do I get the ThreadId? Would I have to do it from the C++ code or can
I
> get it from VB?
>
> thanks,
>
> Jan
>
>
-
Finding parent window?
Hi all,
I have an OCX control, which is launched on a form contained in a VB
dll, which in turn is loaded & called from a C++ dll, which in turn has been
called by a WinGUI fronting a fortran engine. (phew! complicated or what?)
My problem is that I have to make the form hosting the OCX appear to be a
child window of the parent apps GUI - it has a limited API, but that doesn't
include passing it's Hwnd.
I can get the Hwnd by enumerating the windows & comparing the title bars -
but this is not very satisfactory as all sorts of side effects can occur
(and there may be multiple instances of the app running).
Can anybody think of another way? (Without having to change the parent Apps
code)
Thanks in advance for any ideas...
Jan
-
Re: Finding parent window?
I am not at all experienced with Threads, so this maybe a silly question,
but I take it then, that the several dll's sitting between the main App and
the Form hosting the GUI should all be in the same thread?
How do I get the ThreadId? Would I have to do it from the C++ code or can I
get it from VB?
thanks,
Jan
-
Re: Finding parent window?
I am not at all experienced with Threads, so this maybe a silly question,
but I take it then, that the several dll's sitting between the main App and
the Form hosting the GUI should all be in the same thread?
How do I get the ThreadId? Would I have to do it from the C++ code or can I
get it from VB?
thanks,
Jan
-
Re: Finding parent window?
And is it possible from C++ / C ?
"Mark Bax" <MarkB@BlaiseSoft.com> wrote in message
news:3a143c40@news.devx.com...
> Jan: In VB, App.ThreadId
>
> Mark Bax
>
> "Jan Sears" <jan.sears@aspentech.com> wrote in message
> news:3a1418e6@news.devx.com...
> > I am not at all experienced with Threads, so this maybe a silly
question,
> > but I take it then, that the several dll's sitting between the main App
> and
> > the Form hosting the GUI should all be in the same thread?
> >
> > How do I get the ThreadId? Would I have to do it from the C++ code or
can
> I
> > get it from VB?
> >
> > thanks,
> >
> > Jan
> >
> >
>
>
-
Re: Finding parent window?
And is it possible from C++ / C ?
"Mark Bax" <MarkB@BlaiseSoft.com> wrote in message
news:3a143c40@news.devx.com...
> Jan: In VB, App.ThreadId
>
> Mark Bax
>
> "Jan Sears" <jan.sears@aspentech.com> wrote in message
> news:3a1418e6@news.devx.com...
> > I am not at all experienced with Threads, so this maybe a silly
question,
> > but I take it then, that the several dll's sitting between the main App
> and
> > the Form hosting the GUI should all be in the same thread?
> >
> > How do I get the ThreadId? Would I have to do it from the C++ code or
can
> I
> > get it from VB?
> >
> > thanks,
> >
> > Jan
> >
> >
>
>
-
Re: Finding parent window?
Unfortunately it seems the in-process VB DLL runs in a new thread - so I get
it's own windows & the windows spawned by itself, but not those of the
application which called the DLL... grrrr
Any other ideas anyone?
-
Re: Finding parent window?
Unfortunately it seems the in-process VB DLL runs in a new thread - so I get
it's own windows & the windows spawned by itself, but not those of the
application which called the DLL... grrrr
Any other ideas anyone?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks