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

ShowDialog behaviour for my application from another application

P: n/a
Hi,

I have written a windows application with a GUI (let's call it MENU).
I own the code for this application and have access to it.

We have another application that is a third-part windows application
with a GUI interface as well (let's call it BASE). I don't have access
to the code of this application. This application has hooks through
which other applications can be called. I have defined a hook in this
application which bring up my first menu application.

The behaviour I am after is sort of like the "showdialog" behaviour,
where if my menu application is brought up, then the user can not
switch back to the base application without first closing or hitting
the OK button (which essentially will close my menu application) on my
menu application.

The user should still be able to switch to other open applications
without a problem. So in a way I am trying to immitate the feeling of
my menu application being a child window of the parent application -
though the only real behaviour I'm after is that the user should not
be able to switch to the parent application without closing my menu
application first.

Any ideas how I can achieve this, NOT having access to the code of
parent base application.

Asad

Feb 19 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Feb 19, 12:54 pm, asadik...@gmail.com wrote:
Hi,

I have written a windows application with a GUI (let's call it MENU).
I own the code for this application and have access to it.

We have another application that is a third-part windows application
with a GUI interface as well (let's call it BASE). I don't have access
to the code of this application. This application has hooks through
which other applications can be called. I have defined a hook in this
application which bring up my first menu application.

The behaviour I am after is sort of like the "showdialog" behaviour,
where if my menu application is brought up, then the user can not
switch back to the base application without first closing or hitting
the OK button (which essentially will close my menu application) on my
menu application.

The user should still be able to switch to other open applications
without a problem. So in a way I am trying to immitate the feeling of
my menu application being a child window of the parent application -
though the only real behaviour I'm after is that the user should not
be able to switch to the parent application without closing my menu
application first.

Any ideas how I can achieve this, NOT having access to the code of
parent base application.

Asad
Does the parent application provide you with its form handle or any
other information? You could try using the FindWindow and SetParent
API's to set the BASE application window as the parent of your
application window.

Just a thought

Feb 19 '07 #2

P: n/a
On Feb 19, 5:26 pm, "Chris Dunaway" <dunaw...@gmail.comwrote:
On Feb 19, 12:54 pm, asadik...@gmail.com wrote:
Hi,
I have written a windows application with a GUI (let's call it MENU).
I own the code for this application and have access to it.
We have another application that is a third-part windows application
with a GUI interface as well (let's call it BASE). I don't have access
to the code of this application. This application has hooks through
which other applications can be called. I have defined a hook in this
application which bring up my first menu application.
The behaviour I am after is sort of like the "showdialog" behaviour,
where if my menu application is brought up, then the user can not
switch back to the base application without first closing or hitting
the OK button (which essentially will close my menu application) on my
menu application.
The user should still be able to switch to other open applications
without a problem. So in a way I am trying to immitate the feeling of
my menu application being a child window of the parent application -
though the only real behaviour I'm after is that the user should not
be able to switch to the parent application without closing my menu
application first.
Any ideas how I can achieve this, NOT having access to the code of
parent base application.
Asad

Does the parent application provide you with its form handle or any
other information? You could try using the FindWindow and SetParent
API's to set the BASE application window as the parent of your
application window.

Just a thought
Yeah, I got that to work, but I am unable to get a showdialog kind of
behaviour. I used findwindow and setparent, so now the child
application is contained within the boundaries of the parent
application, and gets closed when the parent application closes.
However, I cant figure out how to make the child app window stay on
top as showdialog. Any ideas?

Asad

Feb 22 '07 #3

P: n/a
On Feb 22, 3:58 pm, asadik...@gmail.com wrote:
On Feb 19, 5:26 pm, "Chris Dunaway" <dunaw...@gmail.comwrote:
On Feb 19, 12:54 pm, asadik...@gmail.com wrote:
Hi,
I have written a windows application with a GUI (let's call it MENU).
I own the code for this application and have access to it.
We have another application that is a third-part windows application
with a GUI interface as well (let's call it BASE). I don't have access
to the code of this application. This application has hooks through
which other applications can be called. I have defined a hook in this
application which bring up my first menu application.
The behaviour I am after is sort of like the "showdialog" behaviour,
where if my menu application is brought up, then the user can not
switch back to the base application without first closing or hitting
the OK button (which essentially will close my menu application) on my
menu application.
The user should still be able to switch to other open applications
without a problem. So in a way I am trying to immitate the feeling of
my menu application being a child window of the parent application -
though the only real behaviour I'm after is that the user should not
be able to switch to the parent application without closing my menu
application first.
Any ideas how I can achieve this, NOT having access to the code of
parent base application.
>Asad
Does the parent application provide you with its form handle or any
other information? You could try using the FindWindow and SetParent
API's to set the BASE application window as the parent of your
application window.
Just a thought

Yeah, I got that to work, but I am unable to get a showdialog kind of
behaviour. I used findwindow and setparent, so now the child
application is contained within the boundaries of the parent
application, and gets closed when the parent application closes.
However, I cant figure out how to make the child app window stay on
top as showdialog. Any ideas?
You could try using SetWindowLong and SetWindowPos API. Go to
pinvoke.net and look up these functions and see if it might help. You
might try looking up the WS_POPUP style and see if that will help as
well.

Feb 23 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.