Solved

XP Z-order consistently messed up in my application

Posted on 2008-06-24
3
505 Views
Last Modified: 2010-04-21
Hi developers and experts.
I cannot tell you how frustrating this has been and the embarassment it has caused me with my client.
My application runs just fine on my PC - and even other PCs, but one particular client running Windows XP Professional Service Pack 2 find that my application hangs and he has to terminate it - this is because windows get 'stuck' behind other windows. This normally occurs if I show a "modal" window or stay-on-top window - things like popup messages asking you to choose Yes or No before it will let you continue. Well if XP re-arranges the Z-order then the modal windows can get stuck behind other windows in the application and the user cannot see the active window.

Now originally I thought I solved the problem - GHOSTING!.
In my application I disable XP ghosting - but it seems he continues to have a problem.

Sometimes Alt-Tabbing out of the application and back in brings the correct form to the front - but now even that's not doing the trick.

If anybody knows anything that can help me please share!
0
Comment
Question by:rfwoolf
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
ichian01 earned 500 total points
ID: 21887880
It has to do with the way the app is coded.  If the window is coded with the property Always On top is true, and its parent throws a modal dialog box, and the window covers that dialog box there's no way to access it, because that modal box belongs to the parent, and the floating window also belongs to the parent.  The only solution is that if you're popping modals is to pop it from the child.  Hope this makes sense.
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 21910123
Yes after digging even DEEPER (after many hours put in already into this problem in the past) I came up with the idea to check all my forms main settings:
-FormStyle
-PopupParent
-PopupStyle
and I saw a pattern with some of the problem forms were Stay-On-Top forms.
So I went through all 40 or so forms in my application and changed them to fsNormal - the client says the problem seems to be gone!
Other things I did:
  Instead of Showmessages my application now uses windows.messagebox(FormHandle, msg) because apparently this provides windows with a form handle to stipulate the parent of the message - whereas Showmessage could come from the application as a parent (therefore the Main Form).
  I also disabled Windows Ghosting.

Thanks for the answer though -you seem to have it right! @#$@ing fsStayOnTop is evil!!!
0
 
LVL 13

Author Closing Comment

by:rfwoolf
ID: 31470403
Thank you!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

777 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