Solved

Problems with modal forms

Posted on 2000-04-18
8
152 Views
Last Modified: 2010-04-04
We have ported a p-system based program into delphi and have some limitations at the present time which make it necessary for us to use showmodal on all of our forms. (About 80 such forms)  

The problem is that on occasion if there is another application running it will take the focus from our application while we are setting our main form visible/invisible or freeing one of the subforms. i.e. if we have a dos box up and we change from one form to another the dos box suddenly (and occasionally) will jump in front of the form we are bringging up.  In addition, sometimes this other application becomes the active application and sometimes it's just in front of our form.  Anyone got any clues how to get rid of this problem?
0
Comment
Question by:toesable
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2729352
Listening
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2729411
Try using SetForegroundwindow.


Good luck!!
0
 
LVL 1

Expert Comment

by:flooder
ID: 2729611
In your form.formstyle property set it to fsStayOnTop that should work.
If you dont want the form always on top you can toggle the style when you want to.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:toesable
ID: 2731673
Checking
0
 

Author Comment

by:toesable
ID: 2732647
Sorry flooder, this doesn't work because it takes over the computer completely.  Only if our program is the active program do we want to make sure we keep focus.  Dr Delphi's answer is a good one and it lead us to bringtofront in delphi.  We are currently testing that.  Any other suggestions are appreciated.
0
 
LVL 6

Accepted Solution

by:
DrDelphi earned 100 total points
ID: 2734502
BringToFront will work within the scope of your application, but if you want to make the form the topmost within Windows, you'll either have to go with the API I suggested (SetForegroundwindow), or SetWindowPos (another API)

Good luck!!
0
 

Author Comment

by:toesable
ID: 2737972
Thank you DrDelphi, over the past few days we have come to the same conclusion.  

Take care
toe
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2738101
de nada.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi parse string to params 3 155
How to renew a Delphi rad-studio licence? 5 76
Unique identifier on a terminal server (rdp) 4 74
DBGrid or StringGrid ? 6 120
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question