Solved

Problems with modal forms

Posted on 2000-04-18
8
149 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
8 Comments
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
Listening
0
 
LVL 6

Expert Comment

by:DrDelphi
Comment Utility
Try using SetForegroundwindow.


Good luck!!
0
 
LVL 1

Expert Comment

by:flooder
Comment Utility
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
 

Author Comment

by:toesable
Comment Utility
Checking
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:toesable
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
de nada.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now