471,601 Members | 1,164 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,601 software developers and data experts.

ShowDialog behaviour for my application from another application

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
3 2554
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
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
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.

Similar topics

2 posts views Thread by Bill Burris | last post: by
1 post views Thread by NanoWizard | last post: by
1 post views Thread by No Sheds | last post: by
7 posts views Thread by dgk | last post: by
5 posts views Thread by scott blood | last post: by
2 posts views Thread by =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.