473,241 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 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 2662
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bill Burris | last post by:
When you crate a Windows application the wizard adds a line like: Application.Run( new MyMainForm() ); Out of curiosity I replaced this with: MyMainForm myForm = new MyMainForm();...
1
by: NanoWizard | last post by:
Enclosed below is a class that contains one member item called _frm. It is just a standard System.Windows.Forms.Form class defined elsewhere (just disregard the definition of the object). My...
6
by: Samuel R. Neff | last post by:
I'm having weird results with a form that is already displayed modally (via ShowDialog) displaying a second form via ShowDialog. The last form is not modal even though it's called with ShowDialog....
1
by: No Sheds | last post by:
Hi I have an MDI application. I have a MDI child window within this application that shows another form using ShowDialog. This works fine, except that the final form shown with ShowDialog...
7
by: dgk | last post by:
I'm showing a form using ShowDialog (VB2003 in Visual Studio), and a button on that form pops up a FolderBrowserDialog. As soon as the FBD is closed, either by selecting or by cancel, the form...
8
by: WvH | last post by:
Hi, When I create a new application, with just one button, then this code works as expected: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
5
by: scott blood | last post by:
Hello, We currently have an application that has a lot of screens that allow users to add new data to the system. These forms are currently accessed via a browse form, such as the employee's...
0
by: agasca | last post by:
Hi. i'm using c# in net 2.0. winxp-sp2 machine. I have a form, say FormGrid in that i have to do some work... there is a problem, related to datagridview and the datatable in the DataSource, and...
2
by: =?Utf-8?B?a2VubmV0aG1Abm9zcGFtLm5vc3BhbQ==?= | last post by:
vs2005, c# Trying to understand why one way works but the other doesnt. I have not tried to create a simpler mdi/child/showdialog app for posting purposes (I think even this would not be so small...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.