Solved

XP Z-order consistently messed up in my application

Posted on 2008-06-24
3
497 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

772 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

11 Experts available now in Live!

Get 1:1 Help Now